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 595531 - gdm login is displayed on secondary monitor
gdm login is displayed on secondary monitor
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: login-screen
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: Ray Strode [halfline]
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-09-18 03:22 UTC by rockorequin
Modified: 2013-12-16 20:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description rockorequin 2009-09-18 03:22:26 UTC
gdm 2.26 used to prompt for login on my primary monitor, but 2.27 displays its login screen on the secondary monitor, which of course is especially confusing if I happen to have it plugged in but turned off.

I have an nvidia GeForce 8600M GT card and am using nvidia 190.32 and xrandr 1.3. It doesn't make any difference if the second monitor is HDMI or VGA.

See also https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/395314
Comment 1 Alfred Carlsson 2009-11-03 02:11:17 UTC
Same thing for me. It seems like the login screen is appearing on whichever monitor contains the mouse pointer. In my case (at bootup) the mouse pointer seems to be automatically placed one or a few pixels right of centre, resulting in a login screen on my secondary monitor. 

If the primary screen could be identified and used instead that would be way better. :)
Comment 2 Cody Russell 2009-11-23 22:11:35 UTC
Not sure if this is relevant to this problem, but I've written a patch for gtk+ to add support for querying the primary monitor from xrandr.  This could be useful to fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=601712
Comment 3 Phil Housley 2011-04-23 19:40:05 UTC
This seems to happen more often in GDM 3 than previously. The login screen will always be on the screen where the cursor is as GDM loads, amd at boot that now always seems to be the wrong screen.

Is there actually a use case that requires GDM to display on anything other than the primary screen?
Comment 4 Ray Strode [halfline] 2011-04-26 17:34:41 UTC
we fixed this a while ago:

http://git.gnome.org/browse/gdm/commit/?id=90ab791544d676629800e80fcf7a28a628f94e94
Comment 5 Phil Housley 2011-04-28 10:42:44 UTC
As far as I understand that patch, it seems that what's happening now is that GDM is intentionally putting the cursor on the second screen, and so the greeter will always be there also.

I would guess that this is because nvidia presents the two screens together, and so the "*x = crtc_info->x + .9 * crtc_info->width;" means mostly to the right, so somewhere on the second screen.

Unless there is some way to identify where each physical screen lives, would it be possible to simply aim the cursor somewhere else (top left-ish?), assuming that second screen to the right is actually the more common choice.
Comment 6 Brian Cameron 2011-04-28 12:00:13 UTC
The old GDM 2.20 supported configuration options where the sysadmin could control things like the position of the login GUI.  If the nvidia driver makes it too difficult for GDM to just "do the right thing" by default, then perhaps we should add configuration options to the GUI to address this sort of limitation?
Comment 7 Ray Strode [halfline] 2011-04-28 18:24:04 UTC
crtc_info is the info for a particular monitor, not the aggregrate of them all.

It's looking for the "primary" monitor (as configured) and putting the cursor in the lower right of that monitor.
Comment 8 tomasz.stelmach 2011-04-30 08:56:17 UTC
I just started experiencing the problem and I don't think this bug should be marked as RESOLVED. I suspect the nVidia driver is reporting both monitors as one and hence crtc_info contains the info about aggregate of both.

I used to have two screens: main monitor 1600x1200 and an LCD TV 1366x768. The LCD was on the right and the "center of both" was somewhere on the main monitor. The login screen was always appearing in the expected place (main monitor).

Yesterday I installed my new TV which is 1920x1080. This has moved the "center of both" to the secondary screen (TV). Now the login screen always starts on the TV unless I manage to move the cursor to the left before it pops up.

It's very annoying for my wife. I don't care that much - I don't need to see the login screen to enter my credentials as I remember which keyboard keys to press. But other users have a problem (since they're not the first in the user list).

I really think it would be beneficial, if the users were given an option to override the default behavior and to put the login window wherever they want. I don't expect you can cover all configuration cases (one, two, three, four, more monitors, on the left, right, top, bottom, across...) with simple formulas. Please give us an option to choose manually.
Comment 9 Ray Strode [halfline] 2011-05-02 18:59:30 UTC
Reopening.
Comment 10 spider-jerusalem 2011-05-07 07:05:16 UTC
I've got the same problem here with GDM 3, Nvidia 7600 GT, TFT monitor + CRT TV; with TV right of monitor but most time turned off.
It would be really nice to have an option to place the login window wherever the user wants it in X/Y coordinates. In times where more and more users have more than one screen this should be standard for almost every application, but sadly is not.
Comment 11 Ray Strode [halfline] 2011-05-16 15:24:33 UTC
I believe you can drag the window around with the alt key.  it's not persistent though.
Comment 12 Christoph Wickert 2011-10-09 08:55:24 UTC
So what should people with laptops and docking stations do? I'd like to be able to leave the lid closed when the laptop is docked. In the GDM 2.x times this was possible, but now the greeter is always shown on the laptop's display *even*though* the lid is closed and the display is turned of.

I'm using GDM 3.0.4 on Fedora 15.
Comment 13 spider-jerusalem 2011-10-09 15:29:20 UTC
I found a workaround. Install xwit and add the line
xwit -root -warp XPOS YPOS
to /etc/gdm/Init/Default (just befor the exit 0 line)
XPOS and YPOS should be replaced with values from the screen where you want the login window to appear. xwit moves the mouse pointer to that position.
But this workaround only helps if you always want to have the login window always on the same screen. 
If for some reason you want it to appear on another screen sometimes, you have to move the mouse to the active screen and hit ESCAPE. No need to drag the window with the ALT key.
Comment 14 Ray Strode [halfline] 2011-10-10 15:23:38 UTC
Christoph, if we're marking the laptop display as "primary" when the lid is closed that's probably a bug in gnome-settings-daemon and/or X that needs to be investigated.
Comment 15 Christoph Wickert 2011-10-25 15:53:54 UTC
So how can I find out if g-s-d marks it primary?

The greeter appears even on the laptop screen if the lid is closed and the display is turned of. Once I open it the display gets cloned to both screens but uses the lower resolution of the internal screen.
Comment 16 Christoph Wickert 2011-11-16 17:21:50 UTC
Ray, any idea how to debug gnome-settings-daemon?
Comment 17 Ray Strode [halfline] 2011-11-16 18:24:10 UTC
oh federico is investigating it now, let me find the bug
Comment 18 Ray Strode [halfline] 2011-11-16 18:26:08 UTC
bug 663126
Comment 19 Christoph Wickert 2011-12-01 14:03:05 UTC
Bug 663126 is about problems with docking stations but it turns out my problem even appears when my laptop is not docked and has a display attached directly to vga-out. The greeter is *always* displayed on the internal display, even if is closed and regardless of the laptop being docked or not or on AC or not.
Comment 20 Ray Strode [halfline] 2011-12-01 15:22:01 UTC
Yea, I'm pretty sure we don't try to differentiate between those two cases (anymore)
Comment 21 Christoph Wickert 2011-12-03 17:02:38 UTC
But that would mean that the whole testing and providing fixes for docking stations is completely useless and g-s-d's handling of external displays is completely broken.
Comment 22 Ray Strode [halfline] 2011-12-05 14:56:46 UTC
Not sure I follow. Can you explain what you mean  in greater detail?

The relevant code is in upowerd at upower/src/linux/up-dock.c up_dock_refresh(),
paraphrased here:

count = 0;

/* the metric we're using here is that a machine is docked when there is more than one connected output */
devices = g_udev_client_query_by_subsystem (dock->priv->gudev_client), "drm");

for each device in devices:
    if (device status file reads "connected")
        count++;

if (count > 1)
   up_daemon_set_is_locked (daemon, TRUE);
Comment 23 Christoph Wickert 2011-12-06 10:31:01 UTC
Sorry if I was unclear or my comment sounded like a rant. That was not my intention.

Not that I read the code I understand that the laptop is considered docked if there is more then one display connected. But why is a display seen as connected if it is closed? I guess this is a bug in upowerd.

But what about setting the external display as primary. Is this an assumption that gdm should could make in order to display the greeter there?
Comment 24 Ray Strode [halfline] 2011-12-06 15:00:32 UTC
> Now that I read the code I understand that the laptop is considered docked if
> there is more then one display connected. But why is a display seen as
> connected if it is closed?
I believe the kernel used to mark displays as inactive (but still connected) when the lid was closed, but the code was causing problems with a number of machines so it was removed out right.

There's a discussion about it here:
http://people.freedesktop.org/~halfline/the-troubling-tale-of-fibbing-laptop-lids.txt

So now the idea is to handle it all in gnome-settings-daemon.  It presumably will also cause problems with a set of laptops, but hopefully we can fix those as they crop up.
 
> But what about setting the external display as primary. Is this an assumption
> that gdm should could make in order to display the greeter there?
GDM does make sure it uses the primary display for its login window.

From the other bug it looks like you're going to give the g-s-d patches a try. Let me know if they fix things for you.
Comment 25 Christoph Wickert 2012-03-25 22:13:26 UTC
Which patches exactly? YOu mean http://git.gnome.org/browse/gdm/commit/?id=90ab791544d676629800e80fcf7a28a628f94e94 ?

That change was in 3.0 already and meanwhile I am using gdm-3.2.1.1-14.fc17.x86_64 - but still the greeter is displayed on the closed lid.
Comment 26 Ray Strode [halfline] 2012-03-26 15:01:49 UTC
yea that's the gdm side.  Do you have federico's changes in gnome-settings-daemon?
Comment 27 Christoph Wickert 2012-03-26 16:45:23 UTC
I think so. They were merged into master on 2012-01-11, this means just before g-s-d 3.3.4. I am running gnome-settings-daemon-3.3.92-1.fc17.x86_64.
Comment 28 Ray Strode [halfline] 2012-03-26 17:06:37 UTC
okay so the problem is we look for the primary monitor before gnome-settings-daemon runs.  We should watch for the primary to change and then move the chooser I guess.
Comment 29 Conley Moorhous 2013-05-01 12:57:47 UTC
This is happening to me in 3.8.1. It worked correctly in 3.6, however.
Comment 30 Ray Strode [halfline] 2013-12-16 20:01:17 UTC
i think this is fixed these days now that the greeter is maintained by gnome-shell.

It just does:

        this.actor.add_constraint(new Layout.MonitorConstraint({ primary: true }));•