mirror of
https://github.com/brl/mutter.git
synced 2025-04-16 15:19:39 +00:00
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:
parent
39b3244a3e
commit
047b9de1c6
@ -2644,18 +2644,14 @@ handle_move_to_corner_backend (MetaDisplay *display,
|
|||||||
MetaRectangle outer;
|
MetaRectangle outer;
|
||||||
int orig_x, orig_y;
|
int orig_x, orig_y;
|
||||||
int new_x, new_y;
|
int new_x, new_y;
|
||||||
int frame_width, frame_height;
|
|
||||||
|
|
||||||
meta_window_get_work_area_all_monitors (window, &work_area);
|
meta_window_get_work_area_all_monitors (window, &work_area);
|
||||||
meta_window_get_outer_rect (window, &outer);
|
meta_window_get_outer_rect (window, &outer);
|
||||||
meta_window_get_position (window, &orig_x, &orig_y);
|
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) {
|
if (xchange) {
|
||||||
new_x = work_area.x + (to_right ?
|
new_x = work_area.x + (to_right ?
|
||||||
(work_area.width + frame_width) - outer.width :
|
work_area.width - outer.width :
|
||||||
0);
|
0);
|
||||||
} else {
|
} else {
|
||||||
new_x = orig_x;
|
new_x = orig_x;
|
||||||
@ -2663,18 +2659,16 @@ handle_move_to_corner_backend (MetaDisplay *display,
|
|||||||
|
|
||||||
if (ychange) {
|
if (ychange) {
|
||||||
new_y = work_area.y + (to_bottom ?
|
new_y = work_area.y + (to_bottom ?
|
||||||
(work_area.height + frame_height) - outer.height :
|
work_area.height - outer.height :
|
||||||
0);
|
0);
|
||||||
} else {
|
} else {
|
||||||
new_y = orig_y;
|
new_y = orig_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_window_move_resize (window,
|
meta_window_move_frame (window,
|
||||||
FALSE,
|
TRUE,
|
||||||
new_x,
|
new_x,
|
||||||
new_y,
|
new_y);
|
||||||
window->rect.width,
|
|
||||||
window->rect.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user