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 614894 - [GdkScreenX11] Add heuristic for pre XRandR 1.3 drivers
[GdkScreenX11] Add heuristic for pre XRandR 1.3 drivers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-04-05 17:51 UTC by drago01
Modified: 2010-04-06 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[GdkScreenX11] Add heuristic for pre XRandR 1.3 drivers (2.16 KB, patch)
2010-04-05 17:52 UTC, drago01
none Details | Review
Add heuristic for pre XRandR 1.3 drivers (1.59 KB, patch)
2010-04-06 00:13 UTC, drago01
committed Details | Review

Description drago01 2010-04-05 17:51:40 UTC
See Patch
Comment 1 drago01 2010-04-05 17:52:04 UTC
Created attachment 157989 [details] [review]
[GdkScreenX11] Add heuristic for pre XRandR 1.3 drivers

Currently gdk_screen_get_primary_monitor just returns the first monitor,
in this case but both the panel and now gnome-shell use an additional
heuristic to prefer LVDS as primary if present.

Move this heuristic to gdk_screen_get_primary_monitor to avoid duplicating
it all over the place.
Comment 2 drago01 2010-04-06 00:13:44 UTC
Created attachment 158008 [details] [review]
Add heuristic for pre XRandR 1.3 drivers

Currently gdk_screen_get_primary_monitor just returns the first monitor,
in this case but both the panel and now gnome-shell use an additional
heuristic to prefer LVDS as primary if present.

Move this heuristic to gdk_screen_get_primary_monitor to avoid duplicating
it all over the place.

The fallback heuristic is also used when no primary output is set.
Comment 3 Matthias Clasen 2010-04-06 00:24:37 UTC
Review of attachment 158008 [details] [review]:

Looks good to me, modulo the one minor comment. Please commit. I'll cherry-pick it to the stable 2.20 branch, once I create it.

::: gdk/x11/gdkscreen-x11.c
@@ +772,3 @@
 	XRRGetOutputInfo (dpy, resources, resources->outputs[i]);
 
+      if (primary_output != None && resources->outputs[i] == primary_output)

I think the != None check is redundant here, None will never be returned in the outputs array.
Comment 4 drago01 2010-04-06 00:38:37 UTC
Pushed without the redundant None check.