Merge branch 'master' into bindings

This commit is contained in:
Daniel Eklöf 2020-03-10 18:21:48 +01:00
commit 2be999a752
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 21 additions and 9 deletions

View file

@ -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

View file

@ -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) {

13
shm.c
View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)
{