labwc/include
John Lindgren a837fefc80 Adjust views to account for output layout changes
labwc currently doesn't handle output layout changes very well:

 - Windows can end up "lost" completely offscreen
 - Maximized/fullscreen windows can end up spanning multiple outputs

Currently, new_output_notify() and output_destroy_notify() contain logic
to update the cursor and force a repaint when outputs are added or
removed.  This logic in fact needs to run on any output layout change,
so consolidate it into a new function, output_update_for_layout_change().

Then add a second new function, view_adjust_for_layout_change(), which
adjusts window placement to account for the new layout.

The behavior is roughly as follows:

 - Normal windows that end up offscreen are centered on the closest
   output (making use of the existing view_center() logic)
 - Maximized windows are re-maximized on the closest output.  Logic is
   also added to the unmaximize step to check that the original
   unmaximized position is still on-screen.
 - Fullscreen windows are re-fullscreened on the same output if
   possible; otherwise they are un-fullscreened.

Minimized windows don't require any special handling.  Their placement
is adjusted just the same, but invisible to the user until they are
later unminimized.

There is some positioning glitch still with un-fullscreening a window
whose output has been disconnected/disabled; it can end up in an
unexpected position (but at least has the correct size and decoration).
I don't think this is due to a bug in my change per se, but perhaps the
change has exposed a bug elsewhere.

Fixes: #177
2022-01-01 16:20:13 +00:00
..
common Add SPDX identifiers 2021-11-13 21:56:53 +00:00
config config/rcxml: Allow multiple <action>s inside of a <mousebind> 2021-12-23 09:53:11 -05:00
menu menu: support inline submenus 2021-11-08 17:20:37 +00:00
xbm Add SPDX identifiers 2021-11-13 21:56:53 +00:00
key-state.h keyboard: absolve release event if press was bound 2021-12-22 10:37:25 -05:00
labwc.h Adjust views to account for output layout changes 2022-01-01 16:20:13 +00:00
layers.h Add SPDX identifiers 2021-11-13 21:56:53 +00:00
meson.build Make xwayland support optional 2020-12-30 10:29:21 +00:00
resistance.h Add SPDX identifiers 2021-11-13 21:56:53 +00:00
ssd.h define ssd_part_contains to define the mouse context subset relation 2021-12-02 17:58:31 +00:00
theme.h Add SPDX identifiers 2021-11-13 21:56:53 +00:00