From 047b9de1c61e2f1a490e9444a0fb26d38c22eb89 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 12 Mar 2012 15:40:12 -0400 Subject: [PATCH] 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 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 473110e49..bb974c2a1 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