diff options
author | Markus Ongyerth <ongy@ongy.net> | 2018-02-27 10:14:17 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-26 23:18:50 -0400 |
commit | 07ca9764891f8de90fe2892051dac980bd472df2 (patch) | |
tree | fbb4d79ae96e380dde3b5d440ab325e638edd26d /rootston | |
parent | 43d7459734423e5733fb89e95d866da46bf42842 (diff) |
only unfullscreen when necessary
Check whether the newly focused view is the same as the one currently
fullscreen on that output, or override redirect and don't unfullscreen
in these cases.
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/seat.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/rootston/seat.c b/rootston/seat.c index 052f63da..017e6221 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -715,16 +715,6 @@ struct roots_seat_view *roots_seat_view_from_view( return seat_view; } -static void release_fullscreen(struct roots_output *output) { - if (output->fullscreen_view) { - if (output->fullscreen_view->set_fullscreen) { - output->fullscreen_view->set_fullscreen( - output->fullscreen_view, false); - } - view_set_fullscreen(output->fullscreen_view, false, output->wlr_output); - } -} - void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) { // Make sure the view will be rendered on top of others, even if it's // already focused in this seat @@ -733,14 +723,30 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) { wl_list_insert(&seat->input->server->desktop->views, &view->link); } - struct roots_desktop *desktop = view->desktop; - struct roots_output *output; - struct wlr_box box; - view_get_box(view, &box); - wl_list_for_each(output, &desktop->outputs, link) { - if (wlr_output_layout_intersects(desktop->layout, - output->wlr_output, &box)) { - release_fullscreen(output); + + bool unfullscreen = true; + +#ifdef WLR_HAS_XWAYLAND + if (view && view->type == ROOTS_XWAYLAND_VIEW && + view->xwayland_surface->override_redirect) { + unfullscreen = false; + } +#endif + + if (unfullscreen) { + struct roots_desktop *desktop = view->desktop; + struct roots_output *output; + struct wlr_box box; + view_get_box(view, &box); + wl_list_for_each(output, &desktop->outputs, link) { + if (output->fullscreen_view && + output->fullscreen_view != view && + wlr_output_layout_intersects( + desktop->layout, + output->wlr_output, &box)) { + view_set_fullscreen(output->fullscreen_view, + false, NULL); + } } } |