diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-10 17:21:48 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-10 17:21:48 +0000 |
| commit | 2be999a752a31a55e9c3c5a0edbe7c3bd31d8054 (patch) | |
| tree | 118f1d90539deb783c38ffb61e0dd9bad3dc464d | |
| parent | doc/foot.1: keyboard shortcuts: add pointer to foot(5) (diff) | |
| parent | changelog: updated to mention fix for #3 (diff) | |
Merge branch 'master' into bindings
| -rw-r--r-- | CHANGELOG.md | 10 | ||||
| -rw-r--r-- | client.c | 4 | ||||
| -rw-r--r-- | shm.c | 13 | ||||
| -rw-r--r-- | terminal.c | 2 | ||||
| -rw-r--r-- | wayland.c | 1 |
5 files changed, 21 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e52a01f..642dc0c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,20 @@ ## Unreleased ### Added + ### Changed +* Changed icon name in `foot.desktop` and `foot-server.desktop` from + _terminal_ to _utilities-terminal_. +* `XDG_SESSION_ID` is now included in the server/daemon default socket + path. + ### Deprecated ### Removed + ### Fixed +* Window size doubling when moving window between outputs with + different scaling factors (https://codeberg.org/dnkl/foot/issues/3). + ### Security ## 1.2.1 @@ -34,7 +34,7 @@ print_usage(const char *prog_name) printf("Options:\n"); printf(" -t,--term=TERM value to set the environment variable TERM to (foot)\n" " --login-shell start shell as a login shell\n" - " -s,--server-socket=PATH path to the server UNIX domain socket (default=XDG_RUNTIME_DIR/foot.sock)\n" + " -s,--server-socket=PATH path to the server UNIX domain socket (default=$XDG_RUNTIME_DIR/foot-$XDG_SESSION_ID.sock)\n" " -l,--log-colorize=[never|always|auto] enable/disable colorization of log output on stderr\n" " -v,--version show the version number and quit\n"); } @@ -145,7 +145,7 @@ main(int argc, char *const *argv) if (connect(fd, (const struct sockaddr *)&addr, sizeof(addr)) == 0) connected = true; else - LOG_WARN("%s/foot.sock: failed to connect, will now try /tmp/foot.sock", xdg_runtime); + LOG_WARN("%s: failed to connect, will now try /tmp/foot.sock", addr.sun_path); } if (!connected) { @@ -6,6 +6,7 @@ #include <sys/types.h> #include <sys/mman.h> +#include <linux/mman.h> #include <linux/memfd.h> #include <fcntl.h> @@ -104,7 +105,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) */ int pool_fd = -1; - void *mmapped = NULL; + void *mmapped = MAP_FAILED; size_t size = 0; struct wl_shm_pool *pool = NULL; @@ -142,9 +143,9 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) } } - mmapped = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, pool_fd, 0); + mmapped = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_UNINITIALIZED, pool_fd, 0); if (mmapped == MAP_FAILED) { - LOG_ERR("failed to mmap SHM backing memory file"); + LOG_ERRNO("failed to mmap SHM backing memory file"); goto err; } @@ -163,7 +164,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) /* We use the entire pool for our single buffer */ wl_shm_pool_destroy(pool); pool = NULL; - close(pool_fd); + close(pool_fd); pool_fd = -1; /* One pixman image for each worker thread (do we really need multiple?) */ pix = pixman_image_create_bits_no_clear( @@ -198,9 +199,11 @@ err: wl_shm_pool_destroy(pool); if (pool_fd != -1) close(pool_fd); - if (mmapped != NULL) + if (mmapped != MAP_FAILED) munmap(mmapped, size); + /* We don't handle this */ + abort(); return NULL; } @@ -525,7 +525,7 @@ term_set_fonts(struct terminal *term, struct font *fonts[static 4]) term->fonts[0]->ascent + term->fonts[0]->descent); LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height); - render_resize_force(term, term->width, term->height); + render_resize_force(term, term->width / term->scale, term->height / term->scale); return true; } @@ -279,7 +279,6 @@ static const struct wp_presentation_listener presentation_listener = { .clock_id = &clock_id, }; - static bool verify_iface_version(const char *iface, uint32_t version, uint32_t wanted) { |
