Merge branch 'master' into fix/opacity-runtime-only-docs

This commit is contained in:
Francesco 2026-06-05 10:44:14 +00:00 committed by GitHub
commit 80cc8fd903
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -78,6 +78,7 @@
#define SWAY_LAYER_SHELL_VERSION 5 #define SWAY_LAYER_SHELL_VERSION 5
#define SWAY_FOREIGN_TOPLEVEL_LIST_VERSION 1 #define SWAY_FOREIGN_TOPLEVEL_LIST_VERSION 1
#define SWAY_PRESENTATION_VERSION 2 #define SWAY_PRESENTATION_VERSION 2
#define SWAY_XDG_DECORATION_VERSION 2
bool unsupported_gpu_detected = false; bool unsupported_gpu_detected = false;
@ -396,7 +397,8 @@ bool server_init(struct sway_server *server) {
wl_list_init(&server->decorations); wl_list_init(&server->decorations);
server->xdg_decoration_manager = server->xdg_decoration_manager =
wlr_xdg_decoration_manager_v1_create(server->wl_display); wlr_xdg_decoration_manager_v1_create(server->wl_display,
SWAY_XDG_DECORATION_VERSION);
if (!server->xdg_decoration_manager) { if (!server->xdg_decoration_manager) {
sway_log(SWAY_ERROR, "Failed to create XDG decoration manager"); sway_log(SWAY_ERROR, "Failed to create XDG decoration manager");
return false; return false;

View file

@ -66,17 +66,17 @@ static int read_pixmap(sd_bus_message *msg, struct swaybar_sni *sni,
} }
const void *pixels; const void *pixels;
size_t npixels; size_t pixel_data_size; // size in bytes, each pixel is 4 bytes
ret = sd_bus_message_read_array(msg, 'y', &pixels, &npixels); ret = sd_bus_message_read_array(msg, 'y', &pixels, &pixel_data_size);
if (ret < 0) { if (ret < 0) {
sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret)); sway_log(SWAY_ERROR, "%s %s: %s", sni->watcher_id, prop, strerror(-ret));
goto error; goto error;
} }
if (height > 0 && width == height) { if (height > 0 && width == height && (size_t)width * height <= pixel_data_size / 4) {
sway_log(SWAY_DEBUG, "%s %s: found icon w:%d h:%d", sni->watcher_id, prop, width, height); sway_log(SWAY_DEBUG, "%s %s: found icon w:%d h:%d", sni->watcher_id, prop, width, height);
struct swaybar_pixmap *pixmap = struct swaybar_pixmap *pixmap =
malloc(sizeof(struct swaybar_pixmap) + npixels); malloc(sizeof(struct swaybar_pixmap) + pixel_data_size);
pixmap->size = height; pixmap->size = height;
// convert from network byte order to host byte order // convert from network byte order to host byte order