summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Webster <[email protected]>2019-12-05 10:19:28 -0500
committerVictor Kareh <[email protected]>2019-12-05 13:39:03 -0500
commitaf17e33e008e948e25e3df5dbe0931d0c1cf8908 (patch)
tree82026ac0afd036e15c892c152955d8029fb8ff5a /src
parent11d825ce320ae118e8216f44fdc7e781d9ee183c (diff)
downloadmarco-af17e33e008e948e25e3df5dbe0931d0c1cf8908.tar.bz2
marco-af17e33e008e948e25e3df5dbe0931d0c1cf8908.tar.xz
theme.c: Fix window control hidpi rendering for all themes.
By scaling the pixbuf when loading, existing assets can be used.
Diffstat (limited to 'src')
-rw-r--r--src/ui/theme.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index e15cf2ec..6c9636ec 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -4134,8 +4134,8 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
if (op->data.image.pixbuf)
{
- env->object_width = gdk_pixbuf_get_width (op->data.image.pixbuf);
- env->object_height = gdk_pixbuf_get_height (op->data.image.pixbuf);
+ env->object_width = gdk_pixbuf_get_width (op->data.image.pixbuf) / scale;
+ env->object_height = gdk_pixbuf_get_height (op->data.image.pixbuf) / scale;
}
rwidth = parse_size_unchecked (op->data.image.width, env) * scale;
@@ -5672,7 +5672,19 @@ meta_theme_load_image (MetaTheme *theme,
char *full_path;
full_path = g_build_filename (theme->dirname, filename, NULL);
- pixbuf = gdk_pixbuf_new_from_file (full_path, error);
+ gint width, height;
+
+ if (gdk_pixbuf_get_file_info (full_path, &width, &height) == NULL)
+ {
+ g_free (full_path);
+ return NULL;
+ }
+
+ width *= scale;
+ height *= scale;
+
+ pixbuf = gdk_pixbuf_new_from_file_at_size (full_path, width, height, error);
+
if (pixbuf == NULL)
{
g_free (full_path);