diff --git a/main.c b/main.c index afdfe9d..23c6964 100644 --- a/main.c +++ b/main.c @@ -47,11 +47,15 @@ erealloc(void *p, ulong n) void threadmain(int argc, char **argv) { - char *display; + char *display, *scale; if(argc != 2) usage(); + /* Whichever popup runs is sized from it, and setfont reads Fontsz. */ + scale = getenv("GDK_SCALE"); + if(scale != nil && atoi(scale) > 1) + popupscale = min(atoi(scale), 4); drawc = chancreate(sizeof(Drawcmd), 4); keyc = chancreate(sizeof(Keyreq), 0); langinit(argv[1]); diff --git a/win.c b/win.c index 9bc24a7..94aab0d 100644 --- a/win.c +++ b/win.c @@ -197,11 +197,7 @@ wininit(void) xcb_randr_query_version_cookie_t rc; xcb_randr_query_version_reply_t *rr; const xcb_query_extension_reply_t *rext; - char *scale; - scale = getenv("GDK_SCALE"); - if(scale != nil && atoi(scale) > 1) - popupscale = min(atoi(scale), 4); conn = xcb_connect(nil, &n); if(xcb_connection_has_error(conn)){ fprint(2, "strans: popup disabled: cannot connect to X display\n"); diff --git a/wl.c b/wl.c index 9b1c091..569c8da 100644 --- a/wl.c +++ b/wl.c @@ -647,7 +647,6 @@ void wlthread(void*) { struct pollfd pfd; - char *scale; int n; threadsetname("wl"); @@ -657,11 +656,6 @@ wlthread(void*) wllog("cannot make an xkb context"); return; } - /* drawthread no longer runs, so the scale comes first: setfont - * reads Fontsz. */ - scale = getenv("GDK_SCALE"); - if(scale != nil && atoi(scale) > 1) - popupscale = min(atoi(scale), 4); textinit(); im = zwp_input_method_manager_v2_get_input_method(immgr, seat); zwp_input_method_v2_add_listener(im, &imlisten, nil);