diff options
author | Michael Webster <[email protected]> | 2019-12-05 10:19:28 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-12-05 20:14:14 +0100 |
commit | 65ca099740d44e39bbda8d5955df47ce1047b459 (patch) | |
tree | ddeb21c8f741943addedf3dfbe669af7d64a391d /src/ui/theme.c | |
parent | 30f023482f9281b9e3bd116d600e86ea1682743a (diff) | |
download | marco-65ca099740d44e39bbda8d5955df47ce1047b459.tar.bz2 marco-65ca099740d44e39bbda8d5955df47ce1047b459.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/ui/theme.c')
-rw-r--r-- | src/ui/theme.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c index d277b687..35ef80eb 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -4136,8 +4136,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; @@ -5674,7 +5674,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); |