mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -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
|
|
@ -144,7 +144,8 @@ static void
|
|||
handle_request_maximize(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct view *view = wl_container_of(listener, view, request_maximize);
|
||||
view_maximize(view, view->xdg_surface->toplevel->requested.maximized);
|
||||
view_maximize(view, view->xdg_surface->toplevel->requested.maximized,
|
||||
/*store_natural_geometry*/ true);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -310,7 +311,8 @@ xdg_toplevel_view_map(struct view *view)
|
|||
view_set_fullscreen(view, true,
|
||||
requested->fullscreen_output);
|
||||
} else if (!view->maximized && requested->maximized) {
|
||||
view_maximize(view, true);
|
||||
view_maximize(view, true,
|
||||
/*store_natural_geometry*/ true);
|
||||
}
|
||||
|
||||
view_moved(view);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue