main: GDK_SCALE is read once
Both popups read it, each just before its own textinit, and the second copy needed a comment to say why it was there at all. One frontend runs per session and popupscale is one global, so threadmain reads it before it starts either -- which is before any setfont, the only ordering the two copies were keeping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
6
main.c
6
main.c
@@ -47,11 +47,15 @@ erealloc(void *p, ulong n)
|
|||||||
void
|
void
|
||||||
threadmain(int argc, char **argv)
|
threadmain(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *display;
|
char *display, *scale;
|
||||||
|
|
||||||
if(argc != 2)
|
if(argc != 2)
|
||||||
usage();
|
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);
|
drawc = chancreate(sizeof(Drawcmd), 4);
|
||||||
keyc = chancreate(sizeof(Keyreq), 0);
|
keyc = chancreate(sizeof(Keyreq), 0);
|
||||||
langinit(argv[1]);
|
langinit(argv[1]);
|
||||||
|
|||||||
4
win.c
4
win.c
@@ -197,11 +197,7 @@ wininit(void)
|
|||||||
xcb_randr_query_version_cookie_t rc;
|
xcb_randr_query_version_cookie_t rc;
|
||||||
xcb_randr_query_version_reply_t *rr;
|
xcb_randr_query_version_reply_t *rr;
|
||||||
const xcb_query_extension_reply_t *rext;
|
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);
|
conn = xcb_connect(nil, &n);
|
||||||
if(xcb_connection_has_error(conn)){
|
if(xcb_connection_has_error(conn)){
|
||||||
fprint(2, "strans: popup disabled: cannot connect to X display\n");
|
fprint(2, "strans: popup disabled: cannot connect to X display\n");
|
||||||
|
|||||||
6
wl.c
6
wl.c
@@ -647,7 +647,6 @@ void
|
|||||||
wlthread(void*)
|
wlthread(void*)
|
||||||
{
|
{
|
||||||
struct pollfd pfd;
|
struct pollfd pfd;
|
||||||
char *scale;
|
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
threadsetname("wl");
|
threadsetname("wl");
|
||||||
@@ -657,11 +656,6 @@ wlthread(void*)
|
|||||||
wllog("cannot make an xkb context");
|
wllog("cannot make an xkb context");
|
||||||
return;
|
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();
|
textinit();
|
||||||
im = zwp_input_method_manager_v2_get_input_method(immgr, seat);
|
im = zwp_input_method_manager_v2_get_input_method(immgr, seat);
|
||||||
zwp_input_method_v2_add_listener(im, &imlisten, nil);
|
zwp_input_method_v2_add_listener(im, &imlisten, nil);
|
||||||
|
|||||||
Reference in New Issue
Block a user