diff options
author | Victor Kareh <[email protected]> | 2019-05-23 14:51:31 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-16 18:12:44 +0200 |
commit | 35ede5754870c4c94da9687f461f4ccc0494c1ec (patch) | |
tree | 7dcf7c247441bc9bed64c00b94047c5844996c62 /src | |
parent | e7d16e453c05d836fcef30fc84cd3f07f242f693 (diff) | |
download | marco-35ede5754870c4c94da9687f461f4ccc0494c1ec.tar.bz2 marco-35ede5754870c4c94da9687f461f4ccc0494c1ec.tar.xz |
Fix scaling overcorrection when caching frame borders
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/frames.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index 953736a5..a9db1689 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -2370,7 +2370,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; @@ -2401,7 +2400,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 @@ -2415,28 +2413,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++) { |