[mutter] Fix positioning error for manually positioned windows



commit 4c2e39bf2cfe549a07cf7c61df24d6e6de2ea671
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Mar 5 17:04:50 2014 -0500

    Fix positioning error for manually positioned windows
    
    The "original coordinates" passed into meta_window_place() were the
    coordinates of the client rectangle not the frame rectangle. When
    meta_window_place() didn't place because the window was manually
    positioned (e.g., 'xterm -geometry +x+y') that resulted in a window
    being offset by the frame dimensions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724049

 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 fc5dc6f..b59aa06 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -491,12 +491,17 @@ place_window_if_needed(MetaWindow     *window,
       !window->minimized &&
       !window->fullscreen)
     {
+      MetaRectangle orig_rect;
       MetaRectangle placed_rect;
       MetaWorkspace *cur_workspace;
       const MetaMonitorInfo *monitor_info;
 
       meta_window_get_frame_rect (window, &placed_rect);
-      meta_window_place (window, info->orig.x, info->orig.y,
+
+      orig_rect = info->orig;
+      extend_by_frame (window, &orig_rect);
+
+      meta_window_place (window, orig_rect.x, orig_rect.y,
                          &placed_rect.x, &placed_rect.y);
       did_placement = TRUE;
 


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