Subject: bug#76481: 31.0.50; Extreme weirdness with GDK_SCALE=

From: Po Lu <[email-masked]>
Date: Sat, 22 Feb 2025 09:23:15 +0800

Jonathan Corbet <[email-masked]> writes:

> With emacs built to use GTK, and running under Wayland...  run:
>
>    $ GDK_SCALE= emacs
>
> The result is a number of hallucinogenic effects ranging from emacs just
> showing up as a black square on the screen to window-resizing attempts
> setting the frame to random sizes unrelated to mouse movements.
>
> Things work much better without GDK_SCALE= and I can happily take that
> out (it was put into my scripts years ago for long-forgotten reasons),
> but other users may be tripped up by this too.
>
> This happens even with "emacs -q".

Are you building the X11 configuration of Emacs with GTK, or the PGTK
configuration?

At all events, please place a breakpoint on xg_get_scale and ascertain
what it returns.  I suspect an oversigt in GDK, as it appears that Emacs
does not access this environment variable directly.