After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692871 - Need to expose output information to make GdkScreen API work
Need to expose output information to make GdkScreen API work
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-01-30 11:48 UTC by Rob Bradford
Modified: 2013-03-27 10:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] wayland: Handle wl_output in GdkWaylandScreen (8.82 KB, patch)
2013-02-11 19:13 UTC, Jan Arne Petersen
committed Details | Review

Description Rob Bradford 2013-01-30 11:48:45 UTC
Currently the screen dimensions are hardcoded as 8192 x 8192.

We need to listen for the output global object and then store the data we receive from that in a useful manner.

Some of the GDK APIs we can neatly implement, e.g. gdk_screen_get_monitor_at_point since we have the information we need there.

However for something like gdk_screen_get_monitor_at_window we are going to need to track which output a surface is on using the output enter/leave events. However this API call tries to the work based on gdk_screen_get_monitor_at_point and the global position of the window. However the client doesn't know the global position of the window.
Comment 1 Matthias Clasen 2013-01-31 00:28:54 UTC
It might be worth looking at the callers of gdk_screen_get_monitor_... apis.
It think these apis are almost exclusively used for positioning of override-redirect windows - something that has to be done differently in wayland anyway.
Comment 2 Rob Bradford 2013-02-05 16:39:02 UTC
Matthias, a good point. But the use case that I found that triggered the filing of this bug is in evince. Where it calls gdk_screen_get_monitor_at_window and then tries to get the geometry of that monitor in order to "fullscreen" onto the monitor that the window is on.
Comment 3 Matthias Clasen 2013-02-06 02:48:26 UTC
that sounds wrong  - simply calling gdk_window_fullscreen should be good enough for that.
Comment 4 Jan Arne Petersen 2013-02-11 19:13:46 UTC
Created attachment 235732 [details] [review]
[PATCH] wayland: Handle wl_output in GdkWaylandScreen


Expose information about outputs in GdkScreen (gdk_screen_get_n_monitors
and gdk_screen_get_monitor_*).
---
 gdk/wayland/gdkdisplay-wayland.c |  30 +---------
 gdk/wayland/gdkprivate-wayland.h |   4 ++
 gdk/wayland/gdkscreen-wayland.c  | 122 +++++++++++++++++++++++++--------------
 3 files changed, 85 insertions(+), 71 deletions(-)
Comment 5 Rob Bradford 2013-02-13 15:58:18 UTC
Review of attachment 235732 [details] [review]:

So, Jan - this is really close to my WIP (down to the function names and the refactoring into GdkScreen!) on this. The main difference being I handled the multiple output case. So i'm going to pull in your change and then rebase my changes onto it so you get the credit for your hard work.
Comment 6 Rob Bradford 2013-02-13 15:58:19 UTC
Review of attachment 235732 [details] [review]:

So, Jan - this is really close to my WIP (down to the function names and the refactoring into GdkScreen!) on this. The main difference being I handled the multiple output case. So i'm going to pull in your change and then rebase my changes onto it so you get the credit for your hard work.
Comment 7 Matthias Clasen 2013-03-23 17:56:02 UTC
Rob, is there any more coming here ?
Comment 8 Matthias Clasen 2013-03-24 19:09:09 UTC
this can be tested with testxinerama in tests/
Comment 9 Kristian Høgsberg 2013-03-26 21:05:18 UTC
The fix for bug 696340 also fixes the missing monitor geometry here.  testxinerama now reports the right monitor size, at least for my laptop, haven't tried with an external monitor.
Comment 10 Kristian Høgsberg 2013-03-26 21:41:30 UTC
Commited

commit abe7dc6bb42a80b653b87b5bc051bbb78859ec76
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Tue Mar 26 17:23:31 2013 -0400

    wayland: Set screen size to bounding box of all outputs
    
    Don't hardcode 8192x8192.  We don't get this info from wayland, so we
    compute it as we receive information about the available wl_outputs.
    
to avoid hardcoding 8192x8192.  We still need to handle hotplug, but for static configurations, I think we're all set now.

Oh, we need to get the subpixel info from the geometry event and feed that into the g_settings machinery, but I couldn't immediately figure out how to do that.
Comment 11 Kristian Høgsberg 2013-03-26 21:42:51 UTC
And I did test this with an external monitor and it worked fine.
Comment 12 Rob Bradford 2013-03-27 10:15:11 UTC
Hey Kristian, Matthias, I think that was the only change remaining I had in mind. And along with the other fixes that have gone into master today I think this one can be closed.