Skip to content

Commit 05c064e

Browse files
Oliver Mangoldraveit65
authored andcommitted
Use gdk screen resolution for font in keyboard status notification icon, to get correct scaling on HiPDI displays.
1 parent 12341e4 commit 05c064e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎libmatekbd/matekbd-status.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ matekbd_status_render_cairo (cairo_t * cr, int group)
159159
PangoLayout *pl;
160160
int lwidth, lheight;
161161
gchar *layout_name, *lbl_title;
162+
double screen_res;
162163
cairo_font_options_t *fo;
163164
static GHashTable *ln2cnt_map = NULL;
164165

@@ -186,6 +187,10 @@ matekbd_status_render_cairo (cairo_t * cr, int group)
186187

187188
pcc = pango_cairo_create_context (cr);
188189

190+
screen_res = gdk_screen_get_resolution (gdk_screen_get_default ());
191+
if (screen_res > 0)
192+
pango_cairo_context_set_resolution (pcc, screen_res);
193+
189194
fo = cairo_font_options_copy (gdk_screen_get_font_options
190195
(gdk_screen_get_default ()));
191196
/* SUBPIXEL antialiasing gives bad results on in-memory images */

0 commit comments

Comments
 (0)