]> git.mdlowis.com Git - proto/labwc.git/commit
interactive: Refactor natural_geometry/tiled state handling
authorJohn Lindgren <john@jlindgren.net>
Sat, 19 Nov 2022 17:58:52 +0000 (12:58 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 20 Nov 2022 20:45:50 +0000 (20:45 +0000)
commit9021020f6e37150d8c67d389fa7da3410ef71ba4
treed681c35071a1187e32788a73d85a44e24628976d
parent636b38561b36d0fd1dddcc45710d7c8a825f2200
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.
include/labwc.h
src/action.c
src/cursor.c
src/foreign.c
src/interactive.c
src/view.c
src/xdg.c