Skip to content

Commit

Permalink
Use gdk screen resolution for font in keyboard status notification ic…
Browse files Browse the repository at this point in the history
…on, to get correct scaling on HiPDI displays.
  • Loading branch information
Oliver Mangold authored and raveit65 committed Feb 28, 2018
1 parent 12341e4 commit 90dba6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libmatekbd/matekbd-status.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 90dba6e

Please sign in to comment.