aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-07-19 13:29:58 +0100
committerLibravatar GitHub <noreply@github.com>2018-07-19 13:29:58 +0100
commit3a13455b4e23990bb8cdc96f231ab7a78c2d98df (patch)
treedd9e58923e6425aa8de4dc099f097de68d67ff5c
parentMerge pull request #2305 from RyanDwyer/focus-output (diff)
parentMerge branch 'master' into xwayland-set-hints (diff)
downloadsway-3a13455b4e23990bb8cdc96f231ab7a78c2d98df.tar.gz
sway-3a13455b4e23990bb8cdc96f231ab7a78c2d98df.tar.zst
sway-3a13455b4e23990bb8cdc96f231ab7a78c2d98df.zip
Merge pull request #2309 from RyanDwyer/xwayland-set-hints
Allow xwayland views to become urgent when on a non-visible workspace
-rw-r--r--include/sway/tree/view.h1
-rw-r--r--sway/desktop/xwayland.c21
2 files changed, 18 insertions, 4 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index e270f851..068d92c6 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -140,6 +140,7 @@ struct sway_xwayland_view {
140 struct wl_listener set_title; 140 struct wl_listener set_title;
141 struct wl_listener set_class; 141 struct wl_listener set_class;
142 struct wl_listener set_window_type; 142 struct wl_listener set_window_type;
143 struct wl_listener set_hints;
143 struct wl_listener map; 144 struct wl_listener map;
144 struct wl_listener unmap; 145 struct wl_listener unmap;
145 struct wl_listener destroy; 146 struct wl_listener destroy;
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 7737a33a..72dc7ca2 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -290,10 +290,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
290 } 290 }
291 291
292 view_damage_from(view); 292 view_damage_from(view);
293
294 if (view->allow_request_urgent) {
295 view_set_urgent(view, (bool)xsurface->hints_urgency);
296 }
297} 293}
298 294
299static void handle_destroy(struct wl_listener *listener, void *data) { 295static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -312,6 +308,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
312 wl_list_remove(&xwayland_view->set_title.link); 308 wl_list_remove(&xwayland_view->set_title.link);
313 wl_list_remove(&xwayland_view->set_class.link); 309 wl_list_remove(&xwayland_view->set_class.link);
314 wl_list_remove(&xwayland_view->set_window_type.link); 310 wl_list_remove(&xwayland_view->set_window_type.link);
311 wl_list_remove(&xwayland_view->set_hints.link);
315 wl_list_remove(&xwayland_view->map.link); 312 wl_list_remove(&xwayland_view->map.link);
316 wl_list_remove(&xwayland_view->unmap.link); 313 wl_list_remove(&xwayland_view->unmap.link);
317 view_destroy(&xwayland_view->view); 314 view_destroy(&xwayland_view->view);
@@ -437,6 +434,19 @@ static void handle_set_window_type(struct wl_listener *listener, void *data) {
437 view_execute_criteria(view); 434 view_execute_criteria(view);
438} 435}
439 436
437static void handle_set_hints(struct wl_listener *listener, void *data) {
438 struct sway_xwayland_view *xwayland_view =
439 wl_container_of(listener, xwayland_view, set_hints);
440 struct sway_view *view = &xwayland_view->view;
441 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
442 if (!xsurface->mapped) {
443 return;
444 }
445 if (view->allow_request_urgent) {
446 view_set_urgent(view, (bool)xsurface->hints_urgency);
447 }
448}
449
440struct sway_view *view_from_wlr_xwayland_surface( 450struct sway_view *view_from_wlr_xwayland_surface(
441 struct wlr_xwayland_surface *xsurface) { 451 struct wlr_xwayland_surface *xsurface) {
442 return xsurface->data; 452 return xsurface->data;
@@ -489,6 +499,9 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
489 &xwayland_view->set_window_type); 499 &xwayland_view->set_window_type);
490 xwayland_view->set_window_type.notify = handle_set_window_type; 500 xwayland_view->set_window_type.notify = handle_set_window_type;
491 501
502 wl_signal_add(&xsurface->events.set_hints, &xwayland_view->set_hints);
503 xwayland_view->set_hints.notify = handle_set_hints;
504
492 wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap); 505 wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap);
493 xwayland_view->unmap.notify = handle_unmap; 506 xwayland_view->unmap.notify = handle_unmap;
494 507