From acdb48a59c2633044064ad2e6c352874cc9e6ffa Mon Sep 17 00:00:00 2001 From: kraftwerk28 Date: Sun, 17 Apr 2022 21:16:35 +0300 Subject: Chase wlroots X11 hints update --- meson.build | 1 + sway/desktop/xwayland.c | 10 ++++++---- sway/meson.build | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 5bedeb2e..46352da5 100644 --- a/meson.build +++ b/meson.build @@ -69,6 +69,7 @@ bash_comp = dependency('bash-completion', required: false) fish_comp = dependency('fish', required: false) math = cc.find_library('m') rt = cc.find_library('rt') +xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) wlroots_features = { 'xwayland': false, diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 483398e9..7c5dde53 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "log.h" #include "sway/desktop.h" #include "sway/desktop/transaction.h" @@ -311,7 +312,7 @@ static bool wants_floating(struct sway_view *view) { } } - struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; + xcb_size_hints_t *size_hints = surface->size_hints; if (size_hints != NULL && size_hints->min_width > 0 && size_hints->min_height > 0 && (size_hints->max_width == size_hints->min_width || @@ -365,7 +366,7 @@ static void destroy(struct sway_view *view) { static void get_constraints(struct sway_view *view, double *min_width, double *max_width, double *min_height, double *max_height) { struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; - struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; + xcb_size_hints_t *size_hints = surface->size_hints; if (size_hints == NULL) { *min_width = DBL_MIN; @@ -684,14 +685,15 @@ static void handle_set_hints(struct wl_listener *listener, void *data) { if (!xsurface->mapped) { return; } - if (!xsurface->hints_urgency && view->urgent_timer) { + const bool hints_urgency = xcb_icccm_wm_hints_get_urgency(xsurface->hints); + if (!hints_urgency && view->urgent_timer) { // The view is in the timeout period. We'll ignore the request to // unset urgency so that the view remains urgent until the timer clears // it. return; } if (view->allow_request_urgent) { - view_set_urgent(view, (bool)xsurface->hints_urgency); + view_set_urgent(view, hints_urgency); } } diff --git a/sway/meson.build b/sway/meson.build index 5f34ce6b..4ccb2ba1 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -220,6 +220,7 @@ sway_deps = [ wayland_server, wlroots, xkbcommon, + xcb_icccm, ] if have_xwayland -- cgit v1.2.3-54-g00ecf