summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOmar Zeidan <[email protected]>2019-08-02 12:01:35 +0200
committerraveit65 <[email protected]>2019-08-02 23:22:05 +0200
commite40111206094aa69f6a94fa575cce316bbf8c470 (patch)
tree9820218e7971fdae41386a0542314fcd77ded940 /src
parent1960241cc70814439bfc9432dd94bd6057a60652 (diff)
downloadmarco-e40111206094aa69f6a94fa575cce316bbf8c470.tar.bz2
marco-e40111206094aa69f6a94fa575cce316bbf8c470.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 7950d48e..e94d1824 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2550,28 +2550,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;
}