summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOmar Zeidan <[email protected]>2019-08-02 12:01:35 +0200
committerraveit65 <[email protected]>2019-09-12 15:07:54 +0200
commitf63d442d409a6e70c3765a86a2df9b00bd4ea250 (patch)
treef07e54da96b5e29c06f8a22becd11c559ce65488 /src
parentcb77089c8d3683672790b35e7baf4cb5c67b0b0c (diff)
downloadmarco-f63d442d409a6e70c3765a86a2df9b00bd4ea250.tar.bz2
marco-f63d442d409a6e70c3765a86a2df9b00bd4ea250.tar.xz
Fixed moving windows to edges to work with CSD clients.
Diffstat (limited to 'src')
-rw-r--r--src/core/keybindings.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 6211a941..83ff9854 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2533,28 +2533,31 @@ handle_move_to_corner_backend (MetaDisplay *display,
MetaRectangle work_area;
MetaRectangle outer;
int orig_x, orig_y;
+ int delta_x, delta_y;
int new_x, new_y;
- int frame_width, frame_height;
meta_window_get_work_area_all_xineramas (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 :
- 0);
+ if (to_right) {
+ delta_x = (work_area.x + work_area.width) - (outer.x + outer.width);
+ } else {
+ delta_x = work_area.x - outer.x;
+ }
+ new_x = orig_x + delta_x;
} else {
new_x = orig_x;
}
if (ychange) {
- new_y = work_area.y + (to_bottom ?
- (work_area.height + frame_height) - outer.height :
- 0);
+ if (to_bottom) {
+ delta_y = (work_area.y + work_area.height) - (outer.y + outer.height);
+ } else {
+ delta_y = work_area.y - outer.y;
+ }
+ new_y = orig_y + delta_y;
} else {
new_y = orig_y;
}