[mutter] Fix move-to-corner keybindings



commit 047b9de1c61e2f1a490e9444a0fb26d38c22eb89
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 12 15:40:12 2012 -0400

    Fix move-to-corner keybindings
    
    The move-to-corner keybindings weren't treated as user actions, which
    resulted in them not affecting the saved position - they weren't
    always being treated as sticky. Marking them as a user action revealed
    bugs in the positioning logic that were hidden by the constraint
    code applied to automated moves. Fix those as well. Bug tracked
    down by Mariusz Libera.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661256

 src/core/keybindings.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 473110e..bb974c2 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2644,18 +2644,14 @@ handle_move_to_corner_backend (MetaDisplay    *display,
   MetaRectangle outer;
   int orig_x, orig_y;
   int new_x, new_y;
-  int frame_width, frame_height;
 
   meta_window_get_work_area_all_monitors (window, &work_area);
   meta_window_get_outer_rect (window, &outer);
   meta_window_get_position (window, &orig_x, &orig_y);
 
-  frame_width = (window->frame ? window->frame->child_x : 0);
-  frame_height = (window->frame ? window->frame->child_y : 0);
-
   if (xchange) {
     new_x = work_area.x + (to_right ?
-            (work_area.width + frame_width) - outer.width :
+            work_area.width - outer.width :
             0);
   } else {
     new_x = orig_x;
@@ -2663,18 +2659,16 @@ handle_move_to_corner_backend (MetaDisplay    *display,
 
   if (ychange) {
     new_y = work_area.y + (to_bottom ?
-            (work_area.height + frame_height) - outer.height :
+            work_area.height - outer.height :
             0);
   } else {
     new_y = orig_y;
   }
 
-  meta_window_move_resize (window,
-          FALSE,
-          new_x,
-          new_y,
-          window->rect.width,
-          window->rect.height);
+  meta_window_move_frame (window,
+                          TRUE,
+                          new_x,
+                          new_y);
 }
 
 static void



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