Bug 402734 - Make sure Primary Screen in login manager/desktop is still connected
Summary: Make sure Primary Screen in login manager/desktop is still connected
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 11.0
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Final
Hardware: Other Other
: P2 - High : Enhancement (vote)
Target Milestone: ---
Assignee: Federico Mena Quintero
QA Contact: E-mail List
URL:
Whiteboard: x-server
Keywords:
Depends on:
Blocks: randr-tracker
  Show dependency treegraph
 
Reported: 2008-06-23 11:30 UTC by Francis Giannaros
Modified: 2010-09-18 12:56 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
sax log (94.23 KB, text/x-log)
2008-06-23 11:31 UTC, Francis Giannaros
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Giannaros 2008-06-23 11:30:09 UTC
When I plug in an external monitor and reconfigure SaX, it always puts the external monitor as primary instead of the laptop screen. This is pretty undesirable when you i.e. unplug the external monitor, and the icons+panel are on the other screen.

Also, this didn't happen in 10.3 with the same computer and monitor.
Comment 1 Francis Giannaros 2008-06-23 11:31:11 UTC
Created attachment 223709 [details]
sax log
Comment 2 Stefan Dirsch 2008-06-23 12:46:42 UTC
I'm assuming you'have configured a side-by-side monitor setup by SaX2. Simply
change the order left/right monitor Dualhead Mode configuration dialogue. Let me know, if this helps.
Comment 3 Francis Giannaros 2008-06-23 12:50:10 UTC
Yes, but that only changes the way around that the monitors are (left or right), but doesn't change the primary one (external still primary). 
Comment 4 Stefan Dirsch 2008-06-23 12:53:51 UTC
Then this seems to be a desktop issue, i.e. trying to use always VGA instead of LVDS. Which desktop are you using?
Comment 5 Francis Giannaros 2008-06-23 21:42:15 UTC
GNOME, KDE3 and KDE4 all put the panel on the external monitor (which makes me think it might not be a desktop issue; this is a change since 10.3 too), though it's mostly a problem in KDE4 because you cannot easily move the panel and there are some dual-screen bugs with it. Also for example the KDM login screen now appears on the external monitor.
Comment 6 Stefan Dirsch 2008-06-24 02:18:10 UTC
Ok. Reassigning to KDE4.
Comment 7 Stephan Binner 2008-06-24 07:56:12 UTC
Why do you reassign it to KDE4? Only because a work-around for the problem is not easily possible there? Can the original problem please be fixed?
Comment 8 Stefan Dirsch 2008-06-24 08:04:00 UTC
The original problem is that the desktops apparently always uses the VGA/external screen as primary screen. And with KDE4 you cannot change this easily due to Dualhead bugs. Therefore I reassigned it to KDE4 component. 
Comment 9 Dirk Mueller 2008-06-24 09:21:08 UTC
there is no such thing as "primary screen" anymore with xrandr 1.2. it puts the panel on the biggest screen by default. 

implementing primary screen support is a x.org bug (or rather the libxinerama emulation over it).

Comment 10 Stefan Dirsch 2008-06-24 09:30:45 UTC
> there is no such thing as "primary screen" anymore with xrandr 1.2. it puts
> the panel on the biggest screen by default. 

This is exactly the issue here. Please make it at least configurable (including KDM login screen). Thanks.

  ==> Enhancement
Comment 11 Lubos Lunak 2008-06-26 15:09:19 UTC
I think you misunderstood. We only use the Xinerama* functions from libXinerama (and react on XRANDR events by re-reading). The first screen we get from X is the primary one, the same way this has always been. If you want an option for this, it belongs to X, not to KDE (how about non-KDE apps?).

Comment 12 Stefan Dirsch 2008-06-26 15:28:33 UTC
I'm not really familiar with programming the Xinerama extension. So what I understand is that you still get a display as primary screen although it's disconnected. So there is no way to verify if it's still connected via Xinerama extension. Is this correct?

I would assume that you can check for connected displays with RANDR 1.2 to make sure the primary screen is connected. I think Federico is willing to help here. :-)
Comment 13 Lubos Lunak 2008-06-27 12:15:52 UTC
AFAIK Xinerama only provides what is there, so disconnecting a display would mean the XineramaQueryScreens() function would return one screen less (and whichever else screen will be the first one becomes the "primary" one). I assume the Xinerama "implementation" these ways works by wrapping RANDR to keep providing the old Xinerama-style information.

Comment 14 Stefan Dirsch 2008-06-27 12:30:34 UTC
So it would even be possible to fix the issue by using the Xinerama extension, making the internal laptop panel the primary screen, when the external monitor has been unplugged. SaX2 only creates a static configuration. For dynamic configuration changes the desktops are responsible. Maybe Federico wants to work on this. Enhancement with low priority.
Comment 15 Federico Mena Quintero 2008-06-30 20:59:24 UTC
Your SaX log indicates that you have an Intel 965 card.  The driver for this has a bug where it will report the VGA output *before* the integrated LCD when you list the available outputs (see bug #343858 and bug #310208, for example).  KDE and GNOME assume that the first output in that list is the "primary" one.

Ubuntu supposedly has a patch for this in their Intel driver.
Comment 16 Stefan Dirsch 2008-07-06 15:56:40 UTC
Federico, in case you know where to find this Ubuntu patch, please let me know. Thanks.
Comment 17 Federico Mena Quintero 2008-11-29 22:12:38 UTC
Sigh, the way things are looking, it seems that we'll have to make the desktops implement the "primary screen" policy themselves.

I'm leaning towards making GTK+ see if there is a RANDR output called "LVDS"; if so, it should make it the first element in the list of returned monitors in gdk_screen_get_monitor_*().

I've been looking through all the RANDR bugs we have, and pretty much all of the ones similar to "$fooapp thinks the external monitor is the primary one" would be fixed with this scheme.

Alternatively, we could patch the X server to actually return LVDS first in XRRGetScreenInfo().
Comment 18 Matthias Hopf 2008-12-01 14:42:50 UTC
FWIW, RandR 1.3 will have properties that will tell you exactly the type of the outputs. I'll go into details as soon as it's actually implemented (I'm done with the spec, but implementation need some time, and all drivers have to adopt). When going for the name, please also check for "PANEL", because that's what we use for RadeonHD.

Patching the Xserver is IMHO a no-go, because the order is up to the driver.
Comment 19 Federico Mena Quintero 2008-12-01 21:21:16 UTC
(In reply to comment #18 from Matthias Hopf)
> FWIW, RandR 1.3 will have properties that will tell you exactly the type of the
> outputs. I'll go into details as soon as it's actually implemented (I'm done
> with the spec, but implementation need some time, and all drivers have to
> adopt). When going for the name, please also check for "PANEL", because that's
> what we use for RadeonHD.

Could RadeonHD use "LVDS" just like the other drivers?  If the logic to check the output names indeed has to live in the clients, I'd rather have a standard naming scheme rather than having to adjust to differences in drivers.

[Otherwise someone will write another driver for another chipset and call the built-in display "foobar" - then the software will fail :) ]

> Patching the Xserver is IMHO a no-go, because the order is up to the driver.

Actually, what if we let the driver return whatever it wants, but then have the hardware-independent part reorder the list of outputs?  Each output/CRTC/etc. would still keep its ID, so the XRR* functions would still work as expected.
Comment 20 Matthias Hopf 2008-12-03 16:19:23 UTC
(In reply to comment #19 from Federico Mena Quintero)
> Could RadeonHD use "LVDS" just like the other drivers?  If the logic to check

No.
The term LVDS is a technical term and people cannot be forced to use them, IMHO it has been a bad decision by the radeon developers in the first place. Also, it's bad to use a de-facto standard for something that is (apparently) not standardized. That's exactly what the properties should be for.

We recently had a poll for changing output names (for different issues). Result was that if at all they should be changed only slightly. Everybody agreed that PANEL is superior to LVDS.

> the output names indeed has to live in the clients, I'd rather have a standard
> naming scheme rather than having to adjust to differences in drivers.

There is already none. And you're not guaranteed that there will ever be one.

> [Otherwise someone will write another driver for another chipset and call the
> built-in display "foobar" - then the software will fail :) ]

Exactly.
Never EVER use names for meta-information. Period. That's one of the lessons that should have been learned a long time ago.

That said, using the name as decision maker is probably the best you can do for SLE 11 ATM :-(
Depends on the release schedule whether we would have Xserver 1.6 (which would - hopefully - include standard property support), but ATM I doubt that.

> Actually, what if we let the driver return whatever it wants, but then have the
> hardware-independent part reorder the list of outputs?  Each output/CRTC/etc.
> would still keep its ID, so the XRR* functions would still work as expected.

In that case you're forcing a heuristics-based order upon the order the driver issued, and while the driver might have had a clue about the order, the Xserver will never have. E.g. in the radeonhd driver you can change the order of the outputs if the BIOS isn't telling you the correct order, that would no longer work if the Xserver reorders everything.

Comment 21 Stefan Dirsch 2010-09-18 12:56:27 UTC
SaX2 has been dropped with openSUSE 11.3. I guess the issues in the RANDR >= 1.2 tools in KDE4/Gnome have been fixed. Otherwise please reopen.