summaryrefslogtreecommitdiff
path: root/src/ui/frames.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 14:51:31 -0400
committerVictor Kareh <[email protected]>2019-06-05 10:49:37 -0400
commitf194c1f102370081cdd35f7f873043fd27a4fb86 (patch)
tree60ab23a842a1287144055099c6e847ccaea810be /src/ui/frames.c
parent75bc924c16dfd8d3b2c243fa028339e501ada83e (diff)
downloadmarco-f194c1f102370081cdd35f7f873043fd27a4fb86.tar.bz2
marco-f194c1f102370081cdd35f7f873043fd27a4fb86.tar.xz
Fix scaling overcorrection when caching frame borders
Diffstat (limited to 'src/ui/frames.c')
-rw-r--r--src/ui/frames.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 8fcdd9fa..3cd7b81c 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -2368,7 +2368,6 @@ populate_cache (MetaFrames *frames,
MetaFrameBorders borders;
int width, height;
int frame_width, frame_height, screen_width, screen_height;
- gint scale;
CachedPixels *pixels;
MetaFrameType frame_type;
MetaFrameFlags frame_flags;
@@ -2399,7 +2398,6 @@ populate_cache (MetaFrames *frames,
&borders);
pixels = get_cache (frames, frame);
- scale = gdk_window_get_scale_factor (frame->window);
/* Setup the rectangles for the four visible frame borders. First top, then
* left, right and bottom. Top and bottom extend to the invisible borders
@@ -2413,28 +2411,28 @@ populate_cache (MetaFrames *frames,
* size without any border added. */
/* top */
- pixels->piece[0].rect.x = borders.invisible.left / scale;
- pixels->piece[0].rect.y = borders.invisible.top / scale;
- pixels->piece[0].rect.width = (width + borders.visible.left + borders.visible.right) * scale;
- pixels->piece[0].rect.height = borders.visible.top * scale;
+ pixels->piece[0].rect.x = borders.invisible.left;
+ pixels->piece[0].rect.y = borders.invisible.top;
+ pixels->piece[0].rect.width = width + borders.visible.left + borders.visible.right;
+ pixels->piece[0].rect.height = borders.visible.top;
/* left */
- pixels->piece[1].rect.x = borders.invisible.left / scale;
- pixels->piece[1].rect.y = borders.total.top / scale;
- pixels->piece[1].rect.width = borders.visible.left * scale;
- pixels->piece[1].rect.height = height * scale;
+ pixels->piece[1].rect.x = borders.invisible.left;
+ pixels->piece[1].rect.y = borders.total.top;
+ pixels->piece[1].rect.width = borders.visible.left;
+ pixels->piece[1].rect.height = height;
/* right */
- pixels->piece[2].rect.x = (borders.total.left + width) / scale;
- pixels->piece[2].rect.y = borders.total.top / scale;
- pixels->piece[2].rect.width = borders.visible.right * scale;
- pixels->piece[2].rect.height = height * scale;
+ pixels->piece[2].rect.x = borders.total.left + width;
+ pixels->piece[2].rect.y = borders.total.top;
+ pixels->piece[2].rect.width = borders.visible.right;
+ pixels->piece[2].rect.height = height;
/* bottom */
- pixels->piece[3].rect.x = borders.invisible.left / scale;
- pixels->piece[3].rect.y = (borders.total.top + height) / scale;
- pixels->piece[3].rect.width = (width + borders.visible.left + borders.visible.right) * scale;
- pixels->piece[3].rect.height = borders.visible.bottom * scale;
+ pixels->piece[3].rect.x = borders.invisible.left;
+ pixels->piece[3].rect.y = borders.total.top + height;
+ pixels->piece[3].rect.width = width + borders.visible.left + borders.visible.right;
+ pixels->piece[3].rect.height = borders.visible.bottom;
for (i = 0; i < 4; i++)
{