diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 15:03:58 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 18:20:34 +1000 |
commit | f057a0195ee79dfcaeddbcab026c06e310998c75 (patch) | |
tree | 5c09cc286ae3a6d852341a0ae4796d28bb6155b0 /sway/desktop/xwayland.c | |
parent | Merge pull request #2559 from RyanDwyer/xwayland-check-modal (diff) | |
download | sway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.gz sway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.zst sway-f057a0195ee79dfcaeddbcab026c06e310998c75.zip |
Implement focus_on_window_activation
Depends on https://github.com/swaywm/wlroots/pull/1223
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 68d70b64..10faf91d 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -337,6 +337,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
337 | wl_list_remove(&xwayland_view->request_fullscreen.link); | 337 | wl_list_remove(&xwayland_view->request_fullscreen.link); |
338 | wl_list_remove(&xwayland_view->request_move.link); | 338 | wl_list_remove(&xwayland_view->request_move.link); |
339 | wl_list_remove(&xwayland_view->request_resize.link); | 339 | wl_list_remove(&xwayland_view->request_resize.link); |
340 | wl_list_remove(&xwayland_view->request_activate.link); | ||
340 | wl_list_remove(&xwayland_view->set_title.link); | 341 | wl_list_remove(&xwayland_view->set_title.link); |
341 | wl_list_remove(&xwayland_view->set_class.link); | 342 | wl_list_remove(&xwayland_view->set_class.link); |
342 | wl_list_remove(&xwayland_view->set_window_type.link); | 343 | wl_list_remove(&xwayland_view->set_window_type.link); |
@@ -463,6 +464,19 @@ static void handle_request_resize(struct wl_listener *listener, void *data) { | |||
463 | seat_begin_resize_floating(seat, view->swayc, seat->last_button, e->edges); | 464 | seat_begin_resize_floating(seat, view->swayc, seat->last_button, e->edges); |
464 | } | 465 | } |
465 | 466 | ||
467 | static void handle_request_activate(struct wl_listener *listener, void *data) { | ||
468 | struct sway_xwayland_view *xwayland_view = | ||
469 | wl_container_of(listener, xwayland_view, request_activate); | ||
470 | struct sway_view *view = &xwayland_view->view; | ||
471 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | ||
472 | if (!xsurface->mapped) { | ||
473 | return; | ||
474 | } | ||
475 | view_request_activate(view); | ||
476 | |||
477 | transaction_commit_dirty(); | ||
478 | } | ||
479 | |||
466 | static void handle_set_title(struct wl_listener *listener, void *data) { | 480 | static void handle_set_title(struct wl_listener *listener, void *data) { |
467 | struct sway_xwayland_view *xwayland_view = | 481 | struct sway_xwayland_view *xwayland_view = |
468 | wl_container_of(listener, xwayland_view, set_title); | 482 | wl_container_of(listener, xwayland_view, set_title); |
@@ -555,6 +569,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
555 | &xwayland_view->request_fullscreen); | 569 | &xwayland_view->request_fullscreen); |
556 | xwayland_view->request_fullscreen.notify = handle_request_fullscreen; | 570 | xwayland_view->request_fullscreen.notify = handle_request_fullscreen; |
557 | 571 | ||
572 | wl_signal_add(&xsurface->events.request_activate, | ||
573 | &xwayland_view->request_activate); | ||
574 | xwayland_view->request_activate.notify = handle_request_activate; | ||
575 | |||
558 | wl_signal_add(&xsurface->events.request_move, | 576 | wl_signal_add(&xsurface->events.request_move, |
559 | &xwayland_view->request_move); | 577 | &xwayland_view->request_move); |
560 | xwayland_view->request_move.notify = handle_request_move; | 578 | xwayland_view->request_move.notify = handle_request_move; |