mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
view: Rediscover output in view_adjust_for_layout_change()
This commit is contained in:
parent
d83e99ff66
commit
f018ca708d
1 changed files with 19 additions and 12 deletions
31
src/view.c
31
src/view.c
|
|
@ -740,19 +740,26 @@ void
|
||||||
view_adjust_for_layout_change(struct view *view)
|
view_adjust_for_layout_change(struct view *view)
|
||||||
{
|
{
|
||||||
assert(view);
|
assert(view);
|
||||||
if (view->fullscreen) {
|
|
||||||
if (output_is_usable(view->output)) {
|
/* Exit fullscreen if output is lost */
|
||||||
/* recompute fullscreen geometry */
|
bool was_fullscreen = view->fullscreen;
|
||||||
view_apply_fullscreen_geometry(view);
|
if (was_fullscreen && !output_is_usable(view->output)) {
|
||||||
|
set_fullscreen(view, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Rediscover nearest output as it may have changed */
|
||||||
|
view_discover_output(view);
|
||||||
|
|
||||||
|
if (!view_apply_special_geometry(view)) {
|
||||||
|
if (was_fullscreen) {
|
||||||
|
view_apply_natural_geometry(view);
|
||||||
} else {
|
} else {
|
||||||
/* output is gone, exit fullscreen */
|
/* reposition view if it's offscreen */
|
||||||
view_set_fullscreen(view, false, NULL);
|
if (!wlr_output_layout_intersects(
|
||||||
}
|
view->server->output_layout,
|
||||||
} else if (!view_apply_special_geometry(view)) {
|
NULL, &view->pending)) {
|
||||||
/* reposition view if it's offscreen */
|
view_center(view, NULL, NULL);
|
||||||
if (!wlr_output_layout_intersects(view->server->output_layout,
|
}
|
||||||
NULL, &view->pending)) {
|
|
||||||
view_center(view, NULL, NULL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (view->toplevel.handle) {
|
if (view->toplevel.handle) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue