wayland/xdg-toplevel-drag: Add MetaWindowActor tied_to_drag state

- Skip placement constraints when it is set.
- Required to properly support about-to-be-mapped windows, which get
  "detached" when dragged out of its original owning window.

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4107>
This commit is contained in:
Nick Diego Yamane
2024-11-21 11:26:58 -03:00
parent 3e0fd4b26b
commit 3047b2ce26
3 changed files with 36 additions and 1 deletions

View File

@ -2298,6 +2298,13 @@ meta_window_update_visibility (MetaWindow *window)
implement_showing (window, meta_window_should_be_showing (window));
}
static gboolean
meta_window_is_tied_to_drag (MetaWindow *window)
{
MetaWindowActor *window_actor = meta_window_actor_from_window (window);
return window_actor && meta_window_actor_is_tied_to_drag (window_actor);
}
static void
meta_window_show (MetaWindow *window)
{
@ -4025,7 +4032,10 @@ meta_window_move_resize_internal (MetaWindow *window,
constrained_rect = unconstrained_rect;
temporary_rect = rect;
if (flags & META_MOVE_RESIZE_CONSTRAIN && window->monitor)
/* Do not constrain if it is tied to an ongoing window drag. */
if ((flags & META_MOVE_RESIZE_CONSTRAIN) &&
window->monitor &&
!meta_window_is_tied_to_drag (window))
{
MtkRectangle old_rect;