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 diff --git a/client.c b/client.c index 30271c86..faa7c919 100644 --- a/client.c +++ b/client.c @@ -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) { diff --git a/shm.c b/shm.c index 56395fab..a33b4334 100644 --- a/shm.c +++ b/shm.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -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; } diff --git a/terminal.c b/terminal.c index 0a7e5b5e..2a742268 100644 --- a/terminal.c +++ b/terminal.c @@ -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; } diff --git a/wayland.c b/wayland.c index dae16dc3..1e351caf 100644 --- a/wayland.c +++ b/wayland.c @@ -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) {