[mutter] constraints: Use ConstraintInfo window size when placing



commit 8b0e9706ca8953ae0bcf3df513e78079123fd6b7
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Oct 18 16:28:18 2016 +0800

    constraints: Use ConstraintInfo window size when placing
    
    The frame rect will at this point not be set for Wayland popups, since
    the popup is placed and constrained before the actual buffer will be
    attached. To still be able to calculate a proper monitor to be used for
    constraining, use the ConstraintInfo::current dimensions instead, since
    they will have the expected size. This should not cause any issues with
    present paths since when a window is otherwise placed, it usually
    doesn't change monitor calculation result.
    
    This fixes opening a popup menu that would be positioned on the left
    edge of a not-left-most monitor, for example a 'File' menu on a window
    maximized on a second monitor.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773141

 src/core/constraints.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 7c4d61a..a9d983e 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -465,7 +465,12 @@ place_window_if_needed(MetaWindow     *window,
       MetaWorkspace *cur_workspace;
       const MetaMonitorInfo *monitor_info;
 
-      meta_window_get_frame_rect (window, &placed_rect);
+      placed_rect = (MetaRectangle) {
+        .x = window->rect.x,
+        .y = window->rect.y,
+        .width = info->current.width,
+        .height = info->current.height
+      };
 
       orig_rect = info->orig;
 


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