window: Add place flags

Replace a boolean argument and a temporary MetaWindow struct field with
a `MetaPlaceFlag` passed where relevant. This includes
`meta_window_move_resize_internal()` and `meta_window_constrain()`, as
placement may happen during constraining, and also
`meta_window_force_placement()`.

The struct field (denied_focus_and_not_transient) was only ever set in
meta_window_show(), before meta_window_force_placement(), and
immediately unset as a side effect of that. In .._show() we'll always
force placement if the window wasn't already placed, and in
meta_window_constrain(), we'd only ever call meta_window_place() if the
window wasn't already placed, meaning the variable would only ever be
relevant during `meta_window_show()`. Having it as a flag makes that
relationship and temporary state clearer.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3879>
This commit is contained in:
Jonas Ådahl
2024-07-11 14:23:26 +02:00
committed by Sebastian Wick
parent f4b79441fa
commit 9ebbf83e95
9 changed files with 88 additions and 41 deletions

View File

@ -27,6 +27,7 @@
void meta_window_constrain (MetaWindow *window,
MetaMoveResizeFlags flags,
MetaPlaceFlag place_flags,
MetaGravity resize_gravity,
const MtkRectangle *orig,
MtkRectangle *new,