[mutter] window: Notify about size-change when changing monitor



commit 33dc8ca187e785a1eff347fcb4383907cebbf1a6
Author: Alessandro Bono <alessandro bono369 gmail com>
Date:   Sat Aug 6 13:02:19 2022 +0200

    window: Notify about size-change when changing monitor
    
    When moving to another monitor the window size may change in some
    cases. While unconditionally notifying a size change is not always
    correct, it animates the window when moved to another monitor in
    GNOME Shell.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2558>

 src/core/window.c     | 9 +++++++++
 src/meta/compositor.h | 1 +
 2 files changed, 10 insertions(+)
---
diff --git a/src/core/window.c b/src/core/window.c
index 0a1a97547c..895aa70707 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4089,9 +4089,18 @@ meta_window_move_to_monitor (MetaWindow  *window,
     }
   else
     {
+      MetaRectangle old_frame_rect, old_buffer_rect;
+
       if (monitor == window->monitor->number)
         return;
 
+      meta_window_get_frame_rect (window, &old_frame_rect);
+      meta_window_get_buffer_rect (window, &old_buffer_rect);
+
+      meta_compositor_size_change_window (window->display->compositor, window,
+                                          META_SIZE_CHANGE_MONITOR_MOVE,
+                                          &old_frame_rect, &old_buffer_rect);
+
       meta_window_move_between_rects (window, 0, &old_area, &new_area);
     }
 
diff --git a/src/meta/compositor.h b/src/meta/compositor.h
index e33abad998..9308ed852e 100644
--- a/src/meta/compositor.h
+++ b/src/meta/compositor.h
@@ -64,6 +64,7 @@ typedef enum
   META_SIZE_CHANGE_UNMAXIMIZE,
   META_SIZE_CHANGE_FULLSCREEN,
   META_SIZE_CHANGE_UNFULLSCREEN,
+  META_SIZE_CHANGE_MONITOR_MOVE,
 } MetaSizeChange;
 
 META_EXPORT


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]