mirror of
https://github.com/labwc/labwc.git
synced 2026-02-15 22:05:25 -05:00
view: keep and restore the output-relative position on layout changes
Before this patch, we always tried to preserve the global positions of floating windows across layout changes, which meant that windows could jump to different outputs if the output coordinates changed. Instead, this patch adds the output name and output-relative position in `view->last_placement` to keep them across layout changes, like KDE and GNOME do. This also allows us to remove `view->lost_output_due_to_layout_change`, which was required to keep the output of fullscreen/maximized windows, since we now always try to keep `view->output` whether or not the window is floating.
This commit is contained in:
parent
f58b532214
commit
37c7de32c8
2 changed files with 56 additions and 33 deletions
|
|
@ -214,17 +214,21 @@ struct view {
|
|||
*/
|
||||
struct wlr_box natural_geometry;
|
||||
/*
|
||||
* Whenever an output layout change triggers a view relocation, the
|
||||
* last pending position will be saved so the view may be restored
|
||||
* to its original location on a subsequent layout change.
|
||||
* last_placement represents the last view position set by the user
|
||||
* before layout changes. output_name and relative_geo are used to
|
||||
* keep or restore the view position relative to the output and
|
||||
* layout_geo is used to keep the global position when the output is
|
||||
* lost.
|
||||
*/
|
||||
struct {
|
||||
char *output_name;
|
||||
/* view geometry in output-relative coordinates */
|
||||
struct wlr_box relative_geo;
|
||||
/* view geometry in layout coordinates */
|
||||
struct wlr_box layout_geo;
|
||||
} last_placement;
|
||||
/* Set temporarily when moving view due to layout change */
|
||||
bool adjusting_for_layout_change;
|
||||
/* True if original output was disconnected or disabled */
|
||||
bool lost_output_due_to_layout_change;
|
||||
|
||||
/* used by xdg-shell views */
|
||||
uint32_t pending_configure_serial;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue