diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/xwayland.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index c972fd3a..db21dc78 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -222,6 +222,11 @@ static void set_activated(struct sway_view *view, bool activated) { | |||
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; | 224 | struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface; |
225 | |||
226 | if (activated && surface->minimized) { | ||
227 | wlr_xwayland_surface_set_minimized(surface, false); | ||
228 | } | ||
229 | |||
225 | wlr_xwayland_surface_activate(surface, activated); | 230 | wlr_xwayland_surface_activate(surface, activated); |
226 | } | 231 | } |
227 | 232 | ||
@@ -406,6 +411,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
406 | wl_list_remove(&xwayland_view->destroy.link); | 411 | wl_list_remove(&xwayland_view->destroy.link); |
407 | wl_list_remove(&xwayland_view->request_configure.link); | 412 | wl_list_remove(&xwayland_view->request_configure.link); |
408 | wl_list_remove(&xwayland_view->request_fullscreen.link); | 413 | wl_list_remove(&xwayland_view->request_fullscreen.link); |
414 | wl_list_remove(&xwayland_view->request_minimize.link); | ||
409 | wl_list_remove(&xwayland_view->request_move.link); | 415 | wl_list_remove(&xwayland_view->request_move.link); |
410 | wl_list_remove(&xwayland_view->request_resize.link); | 416 | wl_list_remove(&xwayland_view->request_resize.link); |
411 | wl_list_remove(&xwayland_view->request_activate.link); | 417 | wl_list_remove(&xwayland_view->request_activate.link); |
@@ -508,6 +514,21 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
508 | transaction_commit_dirty(); | 514 | transaction_commit_dirty(); |
509 | } | 515 | } |
510 | 516 | ||
517 | static void handle_request_minimize(struct wl_listener *listener, void *data) { | ||
518 | struct sway_xwayland_view *xwayland_view = | ||
519 | wl_container_of(listener, xwayland_view, request_minimize); | ||
520 | struct sway_view *view = &xwayland_view->view; | ||
521 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | ||
522 | if (!xsurface->mapped) { | ||
523 | return; | ||
524 | } | ||
525 | |||
526 | struct wlr_xwayland_minimize_event *e = data; | ||
527 | struct sway_seat *seat = input_manager_current_seat(); | ||
528 | bool focused = seat_get_focus(seat) == &view->container->node; | ||
529 | wlr_xwayland_surface_set_minimized(xsurface, !focused && e->minimize); | ||
530 | } | ||
531 | |||
511 | static void handle_request_move(struct wl_listener *listener, void *data) { | 532 | static void handle_request_move(struct wl_listener *listener, void *data) { |
512 | struct sway_xwayland_view *xwayland_view = | 533 | struct sway_xwayland_view *xwayland_view = |
513 | wl_container_of(listener, xwayland_view, request_move); | 534 | wl_container_of(listener, xwayland_view, request_move); |
@@ -653,6 +674,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
653 | &xwayland_view->request_fullscreen); | 674 | &xwayland_view->request_fullscreen); |
654 | xwayland_view->request_fullscreen.notify = handle_request_fullscreen; | 675 | xwayland_view->request_fullscreen.notify = handle_request_fullscreen; |
655 | 676 | ||
677 | wl_signal_add(&xsurface->events.request_minimize, | ||
678 | &xwayland_view->request_minimize); | ||
679 | xwayland_view->request_minimize.notify = handle_request_minimize; | ||
680 | |||
656 | wl_signal_add(&xsurface->events.request_activate, | 681 | wl_signal_add(&xsurface->events.request_activate, |
657 | &xwayland_view->request_activate); | 682 | &xwayland_view->request_activate); |
658 | xwayland_view->request_activate.notify = handle_request_activate; | 683 | xwayland_view->request_activate.notify = handle_request_activate; |