mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
interactive: Refactor natural_geometry/tiled state handling
Currently, snapping to a screen edge and then snapping to maximize results in both the natural_geometry and tiled state of the view getting messed up. After unmaximize, the view ends up in a weird state (tiled location but natural/untiled size). There are also a couple of sketchy things going on in the code: - interactive_begin() pokes its own values into view->natural_geometry to force view_maximize() to set a particular geometry. - interactive_end() "fixes" view->natural_geometry after calling view_maximize() to save the original geometry from the start of the interactive move/resize. To fix all this: - Adjust/expand the API of view.c so that the interactive.c can avoid this "back door" of overwriting view->natural_geometry directly. - Save the natural geometry and the tiled state of the view in interactive_begin() when starting to move the view. When done, interactive_end() will update the tiled state if appropriate but *not* overwrite the natural geometry.
This commit is contained in:
parent
636b38561b
commit
9021020f6e
7 changed files with 192 additions and 120 deletions
|
|
@ -20,7 +20,8 @@ handle_toplevel_handle_request_maximize(struct wl_listener *listener, void *data
|
|||
toplevel_handle_request_maximize);
|
||||
struct wlr_foreign_toplevel_handle_v1_maximized_event *event = data;
|
||||
if (view) {
|
||||
view_maximize(view, event->maximized);
|
||||
view_maximize(view, event->maximized,
|
||||
/*store_natural_geometry*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue