GNU bug report logs - #38163
GDK does not return the monitor's refresh rate

Previous Next

Package: guix;

Reported by: Alexandros Theodotou <alex <at> zrythm.org>

Date: Sun, 10 Nov 2019 16:45:01 UTC

Severity: normal

Done: Alexandros Theodotou <alex <at> zrythm.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38163 in the body.
You can then email your comments to 38163 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Sun, 10 Nov 2019 16:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alexandros Theodotou <alex <at> zrythm.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 10 Nov 2019 16:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alexandros Theodotou <alex <at> zrythm.org>
To: bug-guix <at> gnu.org
Subject: GDK does not return the monitor's refresh rate
Date: Sun, 10 Nov 2019 16:44:23 +0000
[Message part 1 (text/plain, inline)]
I have been developing and testing my GTK app (Zrythm) on many distros
and Guix is the only case that the monitor's refresh rate is returned
as 0.

The API I am using is this:
https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-refresh-rate

I was developing/testing on Parabola GNU/Linux-libre before and it was
giving me a correct rate of 60 Hz.

Other distros I have tested this API before on:
Various ubuntu versions, debian 9 and 10, manjaro (arch), various
fedora versions, plus a few others that users tested on.

I suspect GDK is trying to access something that guix doesn't make
available to it, but I don't have much knowledge of the internals of
GDK or Guix to debug this myself.

I will post a package from my guix channel that you can test this on
soon.

To call the API, one basically calls the following, after including
<gtk/gtk.h>, so any GTK program will do.
```
GdkDisplay * display = gdk_display_get_default ();
GdkMonitor * monitor = gdk_display_get_primary_monitor (display);
int refresh_rate = gdk_monitor_get_refresh_rate (monitor);
```
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Mon, 11 Nov 2019 20:54:01 GMT) Full text and rfc822 format available.

Message #8 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Alexandros Theodotou <alex <at> zrythm.org>
Cc: 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Mon, 11 Nov 2019 21:53:07 +0100
Hi Alexandros,

Alexandros Theodotou <alex <at> zrythm.org> skribis:

> I have been developing and testing my GTK app (Zrythm) on many distros
> and Guix is the only case that the monitor's refresh rate is returned
> as 0.
>
> The API I am using is this:
> https://developer.gnome.org/gdk3/stable/GdkMonitor.html#gdk-monitor-get-refresh-rate

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+’?

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.

Thanks for your report,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Mon, 11 Nov 2019 21:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Alexandros Theodotou <alex <at> zrythm.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Mon, 11 Nov 2019 21:31:23 +0000
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Wed, 13 Nov 2019 20:57:03 GMT) Full text and rfc822 format available.

Message #14 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Bengt Richter <bokr <at> bokr.com>
To: Alexandros Theodotou <alex <at> zrythm.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
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




Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Thu, 14 Nov 2019 21:01:02 GMT) Full text and rfc822 format available.

Message #17 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bengt Richter <bokr <at> bokr.com>
Cc: Alexandros Theodotou <alex <at> zrythm.org>, 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Thu, 14 Nov 2019 22:00:30 +0100
Hi Bengt,

Bengt Richter <bokr <at> bokr.com> skribis:

> On +2019-11-11 21:31:23 +0000, Alexandros Theodotou wrote:

[...]

>> > 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

[...]

> 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.

You’re right, but note that GDK has several backends (not just X11), and
this issue was about fixing the problem with the X11 backend.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Fri, 15 Nov 2019 18:25:01 GMT) Full text and rfc822 format available.

Message #20 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Alexandros Theodotou <alex <at> zrythm.org>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Fri, 15 Nov 2019 19:24:12 +0100
[Message part 1 (text/plain, inline)]
Alexandros Theodotou <alex <at> zrythm.org> writes:

> Hi Ludo,
>
>> 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.

Note that this change is already in the staging branch since commit
52b61e999101724c7e2d341586e9a6150614f208.

Unfortunately the branch has gone stale due to some Qt/qmake plugin
issues & I haven't had time to work on it.  I will try to find a
workaround this weekend, if nothing else, as only a handful packages are
affected.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#38163; Package guix. (Sat, 16 Nov 2019 15:08:02 GMT) Full text and rfc822 format available.

Message #23 received at 38163 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Alexandros Theodotou <alex <at> zrythm.org>, 38163 <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Sat, 16 Nov 2019 16:07:34 +0100
Hi,

Marius Bakke <mbakke <at> fastmail.com> skribis:

> Alexandros Theodotou <alex <at> zrythm.org> writes:
>
>> Hi Ludo,
>>
>>> 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.
>
> Note that this change is already in the staging branch since commit
> 52b61e999101724c7e2d341586e9a6150614f208.

Nice! I wasn’t aware of it.

> Unfortunately the branch has gone stale due to some Qt/qmake plugin
> issues & I haven't had time to work on it.  I will try to find a
> workaround this weekend, if nothing else, as only a handful packages are
> affected.

Let’s motivate each other on IRC over the week-end.  I’d be happy to
give a hand to get that branch merged!

Thanks,
Ludo’.




Reply sent to Alexandros Theodotou <alex <at> zrythm.org>:
You have taken responsibility. (Wed, 27 May 2020 00:11:02 GMT) Full text and rfc822 format available.

Notification sent to Alexandros Theodotou <alex <at> zrythm.org>:
bug acknowledged by developer. (Wed, 27 May 2020 00:11:02 GMT) Full text and rfc822 format available.

Message #28 received at 38163-done <at> debbugs.gnu.org (full text, mbox):

From: Alexandros Theodotou <alex <at> zrythm.org>
To: 38163-done <at> debbugs.gnu.org
Subject: Re: bug#38163: GDK does not return the monitor's refresh rate
Date: Wed, 27 May 2020 01:10:35 +0100
[Message part 1 (text/plain, inline)]
This was fixed a long time ago.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 24 Jun 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.