diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2021-07-22 15:19:12 +0300 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2021-07-22 15:54:20 +0300 |
commit | c4a9e1bc29bd4ad28b7e44b8f3408583aa6b3d4f (patch) | |
tree | b0ed2ad9eb68a68049eeaead389cf3c37c93d59f /src/core/window.c | |
parent | de8ecbc922934cbe89d54275c562e33c43ffdda7 (diff) | |
download | metacity-c4a9e1bc29bd4ad28b7e44b8f3408583aa6b3d4f.tar.gz |
window: offset gravity position by invisible borders
https://gitlab.gnome.org/GNOME/metacity/-/issues/21
Diffstat (limited to 'src/core/window.c')
-rw-r--r-- | src/core/window.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/window.c b/src/core/window.c index 948687d7..953a9af9 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -4138,9 +4138,22 @@ meta_window_get_gravity_position (MetaWindow *window, else { if (window->frame == NULL) - frame_extents = window->rect; + { + frame_extents = window->rect; + } else - frame_extents = window->frame->rect; + { + MetaFrameBorders borders; + + frame_extents = window->frame->rect; + + meta_frame_calc_borders (window->frame, &borders); + + frame_extents.x += borders.invisible.left; + frame_extents.y += borders.invisible.top; + frame_extents.width -= borders.invisible.left + borders.invisible.right; + frame_extents.height -= borders.invisible.top + borders.invisible.bottom; + } } x = frame_extents.x; |