Subject: Re: bug#38163: GDK does not return the monitor's refresh rate

From: Bengt Richter <[email-masked]>
Date: Wed, 13 Nov 2019 12:56:24 -0800

Hi Guix,

On +2019-11-11 21:31:23 +0000, Alexandros Theodotou wrote:
> Hi Ludo,
> 
> > Looking at GTK+, the ‘init_randr*’ functions in ‘gdkscreen-x11.c’
> > appear
> > to be those responsible for setting the ‘refresh_rate’ field.
> > 
> > However, AFAICS, our ‘gtk+’ package does not depend on ‘libxrandr’,
> > and
> > thus that functionality is simply compiled out (the function returns
> > 0
> > unconditionally).
> > 
> > Could you try adding that dependency on ‘libxrandr’ in ‘gtk+’?
> 
> Just tried that and it worked! It's returning the correct refresh rate
> now:
> ** Message: 21:20:40.548: refresh rate returned by GDK: 60.0
> 
> > We won’t make this change in ‘master’ because it entails too many
> > rebuilds, but it could go on the next branch for massive rebuilds. 
> 
> Makes sense. I will be using my local gtk+ version for a while then
> until this change goes live.
> 
> Thanks for taking a look at this.
> 
> Alex

I'm wondering about a narrowly-X solution.

Shouldn't this really come from udevd noticing display changes?
What about a multi-display seat, with potentially different refresh rates?

IIUC it seems like libdrm and KMS can get at all that, so a light-weight solution
should be possible, ISTM, and accessible from console command line without X.
-- 
Regards,
Bengt Richter