diff options
author | Oliver Mangold <[email protected]> | 2018-02-17 22:53:56 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-02-28 16:56:43 +0100 |
commit | 05c064eaa74e03ac9558a3c91c23355600eb584f (patch) | |
tree | 02da41ff392f486391da8b20acd03d854e05da2b | |
parent | 12341e48da67c74925fea78fd42423a2893a6e0c (diff) | |
download | libmatekbd-05c064eaa74e03ac9558a3c91c23355600eb584f.tar.bz2 libmatekbd-05c064eaa74e03ac9558a3c91c23355600eb584f.tar.xz |
Use gdk screen resolution for font in keyboard status notification icon, to get correct scaling on HiPDI displays.
-rw-r--r-- | libmatekbd/matekbd-status.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libmatekbd/matekbd-status.c b/libmatekbd/matekbd-status.c index 49ad0db..0183529 100644 --- a/libmatekbd/matekbd-status.c +++ b/libmatekbd/matekbd-status.c @@ -159,6 +159,7 @@ matekbd_status_render_cairo (cairo_t * cr, int group) PangoLayout *pl; int lwidth, lheight; gchar *layout_name, *lbl_title; + double screen_res; cairo_font_options_t *fo; static GHashTable *ln2cnt_map = NULL; @@ -186,6 +187,10 @@ matekbd_status_render_cairo (cairo_t * cr, int group) pcc = pango_cairo_create_context (cr); + screen_res = gdk_screen_get_resolution (gdk_screen_get_default ()); + if (screen_res > 0) + pango_cairo_context_set_resolution (pcc, screen_res); + fo = cairo_font_options_copy (gdk_screen_get_font_options (gdk_screen_get_default ())); /* SUBPIXEL antialiasing gives bad results on in-memory images */ |