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
This commit is contained in:
Owen W. Taylor 2012-03-12 15:40:12 -04:00
parent 39b3244a3e
commit 047b9de1c6

View File

@ -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