mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-24 10:59:48 +01:00
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.
This commit is contained in:
parent
43d7459734
commit
07ca976489
1 changed files with 24 additions and 18 deletions
|
@ -715,16 +715,6 @@ struct roots_seat_view *roots_seat_view_from_view(
|
||||||
return seat_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) {
|
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
|
// Make sure the view will be rendered on top of others, even if it's
|
||||||
// already focused in this seat
|
// 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);
|
wl_list_insert(&seat->input->server->desktop->views, &view->link);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct roots_desktop *desktop = view->desktop;
|
|
||||||
struct roots_output *output;
|
bool unfullscreen = true;
|
||||||
struct wlr_box box;
|
|
||||||
view_get_box(view, &box);
|
#ifdef WLR_HAS_XWAYLAND
|
||||||
wl_list_for_each(output, &desktop->outputs, link) {
|
if (view && view->type == ROOTS_XWAYLAND_VIEW &&
|
||||||
if (wlr_output_layout_intersects(desktop->layout,
|
view->xwayland_surface->override_redirect) {
|
||||||
output->wlr_output, &box)) {
|
unfullscreen = false;
|
||||||
release_fullscreen(output);
|
}
|
||||||
|
#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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue