Subject: bug#56832: 29.0.50; Emacs pgtk started on low-DPI doesn't adapt to hi-DPI

From: Po Lu <[email-masked]>
Date: Sat, 30 Jul 2022 09:01:41 +0800

Olivier Crête <[email-masked]> writes:

> Hi,
>
> If I start emacs on my low DPI screen (a normal 1080p screen), when I
> switch it to another screen which is 4K, it doesn't adapt correctly but
> instead I get the blurry scaling from the compositor. I'd expect it to
> listen to the appropriate Wayland events and change its internal
> scaling factor.
>
> This is all using master built with pgtk (from the copr).

Could you please put a breakpoint here:

static void
update_watched_scale_factor (struct atimer *timer)
{
  struct frame *f = timer->client_data;
  double scale_factor = FRAME_SCALE_FACTOR (f);

  if (scale_factor != FRAME_X_OUTPUT (f)->watched_scale_factor)
    {
      FRAME_X_OUTPUT (f)->watched_scale_factor = scale_factor;
      pgtk_cr_update_surface_desired_size (f,
					   FRAME_CR_SURFACE_DESIRED_WIDTH (f),
====>					   FRAME_CR_SURFACE_DESIRED_HEIGHT (f),
					   true);
    }
}

with the following commands:

  p scale_factor
  c

and see if it is ever called, and what the value scale_factor is, once
you move the frame to the other monitor.

Thanks.