unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38163: GDK does not return the monitor's refresh rate
@ 2019-11-10 16:44 Alexandros Theodotou
  2019-11-11 20:53 ` Ludovic Courtès
  2020-05-27  0:10 ` Alexandros Theodotou
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandros Theodotou @ 2019-11-10 16:44 UTC (permalink / raw)
  To: 38163

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

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);
```

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-10 16:44 bug#38163: GDK does not return the monitor's refresh rate Alexandros Theodotou
@ 2019-11-11 20:53 ` Ludovic Courtès
  2019-11-11 21:31   ` Alexandros Theodotou
  2020-05-27  0:10 ` Alexandros Theodotou
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2019-11-11 20:53 UTC (permalink / raw)
  To: Alexandros Theodotou; +Cc: 38163

Hi Alexandros,

Alexandros Theodotou <alex@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’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-11 20:53 ` Ludovic Courtès
@ 2019-11-11 21:31   ` Alexandros Theodotou
  2019-11-13 20:56     ` Bengt Richter
  2019-11-15 18:24     ` Marius Bakke
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandros Theodotou @ 2019-11-11 21:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38163

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-11 21:31   ` Alexandros Theodotou
@ 2019-11-13 20:56     ` Bengt Richter
  2019-11-14 21:00       ` Ludovic Courtès
  2019-11-15 18:24     ` Marius Bakke
  1 sibling, 1 reply; 8+ messages in thread
From: Bengt Richter @ 2019-11-13 20:56 UTC (permalink / raw)
  To: Alexandros Theodotou; +Cc: 38163

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-13 20:56     ` Bengt Richter
@ 2019-11-14 21:00       ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-11-14 21:00 UTC (permalink / raw)
  To: Bengt Richter; +Cc: Alexandros Theodotou, 38163

Hi Bengt,

Bengt Richter <bokr@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’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-11 21:31   ` Alexandros Theodotou
  2019-11-13 20:56     ` Bengt Richter
@ 2019-11-15 18:24     ` Marius Bakke
  2019-11-16 15:07       ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Marius Bakke @ 2019-11-15 18:24 UTC (permalink / raw)
  To: Alexandros Theodotou, Ludovic Courtès; +Cc: 38163

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

Alexandros Theodotou <alex@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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-15 18:24     ` Marius Bakke
@ 2019-11-16 15:07       ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2019-11-16 15:07 UTC (permalink / raw)
  To: Marius Bakke; +Cc: Alexandros Theodotou, 38163

Hi,

Marius Bakke <mbakke@fastmail.com> skribis:

> Alexandros Theodotou <alex@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’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38163: GDK does not return the monitor's refresh rate
  2019-11-10 16:44 bug#38163: GDK does not return the monitor's refresh rate Alexandros Theodotou
  2019-11-11 20:53 ` Ludovic Courtès
@ 2020-05-27  0:10 ` Alexandros Theodotou
  1 sibling, 0 replies; 8+ messages in thread
From: Alexandros Theodotou @ 2020-05-27  0:10 UTC (permalink / raw)
  To: 38163-done

[-- Attachment #1: Type: text/plain, Size: 33 bytes --]

This was fixed a long time ago.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-27  0:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-10 16:44 bug#38163: GDK does not return the monitor's refresh rate Alexandros Theodotou
2019-11-11 20:53 ` Ludovic Courtès
2019-11-11 21:31   ` Alexandros Theodotou
2019-11-13 20:56     ` Bengt Richter
2019-11-14 21:00       ` Ludovic Courtès
2019-11-15 18:24     ` Marius Bakke
2019-11-16 15:07       ` Ludovic Courtès
2020-05-27  0:10 ` Alexandros Theodotou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).