diff options
author | kraftwerk28 <kefirchik3@gmail.com> | 2022-04-17 21:16:35 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-04-18 08:57:16 +0200 |
commit | acdb48a59c2633044064ad2e6c352874cc9e6ffa (patch) | |
tree | 81ba6b56b0ba82648ff0f95d2eeb35658a20b957 | |
parent | layer_shell: keep output non-NULL wherever possible (diff) | |
download | sway-acdb48a59c2633044064ad2e6c352874cc9e6ffa.tar.gz sway-acdb48a59c2633044064ad2e6c352874cc9e6ffa.tar.zst sway-acdb48a59c2633044064ad2e6c352874cc9e6ffa.zip |
Chase wlroots X11 hints update
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 10 | ||||
-rw-r--r-- | 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) | |||
69 | fish_comp = dependency('fish', required: false) | 69 | fish_comp = dependency('fish', required: false) |
70 | math = cc.find_library('m') | 70 | math = cc.find_library('m') |
71 | rt = cc.find_library('rt') | 71 | rt = cc.find_library('rt') |
72 | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) | ||
72 | 73 | ||
73 | wlroots_features = { | 74 | wlroots_features = { |
74 | 'xwayland': false, | 75 | '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 @@ | |||
6 | #include <wlr/types/wlr_output_layout.h> | 6 | #include <wlr/types/wlr_output_layout.h> |
7 | #include <wlr/types/wlr_output.h> | 7 | #include <wlr/types/wlr_output.h> |
8 | #include <wlr/xwayland.h> | 8 | #include <wlr/xwayland.h> |
9 | #include <xcb/xcb_icccm.h> | ||
9 | #include "log.h" | 10 | #include "log.h" |
10 | #include "sway/desktop.h" | 11 | #include "sway/desktop.h" |
11 | #include "sway/desktop/transaction.h" | 12 | #include "sway/desktop/transaction.h" |
@@ -311,7 +312,7 @@ static bool wants_floating(struct sway_view *view) { | |||
311 | } | 312 | } |
312 | } | 313 | } |
313 | 314 | ||
314 | struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; | 315 | xcb_size_hints_t *size_hints = surface->size_hints; |
315 | if (size_hints != NULL && | 316 | if (size_hints != NULL && |
316 | size_hints->min_width > 0 && size_hints->min_height > 0 && | 317 | size_hints->min_width > 0 && size_hints->min_height > 0 && |
317 | (size_hints->max_width == size_hints->min_width || | 318 | (size_hints->max_width == size_hints->min_width || |
@@ -365,7 +366,7 @@ static void destroy(struct sway_view *view) { | |||
365 | static void get_constraints(struct sway_view *view, double *min_width, | 366 | static void get_constraints(struct sway_view *view, double *min_width, |
366 | double *max_width, double *min_height, double *max_height) { | 367 | double *max_width, double *min_height, double *max_height) { |
367 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; | 368 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; |
368 | struct wlr_xwayland_surface_size_hints *size_hints = surface->size_hints; | 369 | xcb_size_hints_t *size_hints = surface->size_hints; |
369 | 370 | ||
370 | if (size_hints == NULL) { | 371 | if (size_hints == NULL) { |
371 | *min_width = DBL_MIN; | 372 | *min_width = DBL_MIN; |
@@ -684,14 +685,15 @@ static void handle_set_hints(struct wl_listener *listener, void *data) { | |||
684 | if (!xsurface->mapped) { | 685 | if (!xsurface->mapped) { |
685 | return; | 686 | return; |
686 | } | 687 | } |
687 | if (!xsurface->hints_urgency && view->urgent_timer) { | 688 | const bool hints_urgency = xcb_icccm_wm_hints_get_urgency(xsurface->hints); |
689 | if (!hints_urgency && view->urgent_timer) { | ||
688 | // The view is in the timeout period. We'll ignore the request to | 690 | // The view is in the timeout period. We'll ignore the request to |
689 | // unset urgency so that the view remains urgent until the timer clears | 691 | // unset urgency so that the view remains urgent until the timer clears |
690 | // it. | 692 | // it. |
691 | return; | 693 | return; |
692 | } | 694 | } |
693 | if (view->allow_request_urgent) { | 695 | if (view->allow_request_urgent) { |
694 | view_set_urgent(view, (bool)xsurface->hints_urgency); | 696 | view_set_urgent(view, hints_urgency); |
695 | } | 697 | } |
696 | } | 698 | } |
697 | 699 | ||
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 = [ | |||
220 | wayland_server, | 220 | wayland_server, |
221 | wlroots, | 221 | wlroots, |
222 | xkbcommon, | 222 | xkbcommon, |
223 | xcb_icccm, | ||
223 | ] | 224 | ] |
224 | 225 | ||
225 | if have_xwayland | 226 | if have_xwayland |