xdm monitor selection

Warren Block wblock at wonkity.com
Tue Jan 27 16:36:25 PST 2009


On Tue, 27 Jan 2009, Robert Noland wrote:

> On Tue, 2009-01-27 at 16:24 -0700, Warren Block wrote:
>> On Tue, 27 Jan 2009, Yuri Pankov wrote:
>>
>>> On Mon, Jan 26, 2009 at 08:08:23PM -0700, Warren Block wrote:
>>>> Is there a way to tell xdm which monitor of a dual-monitor setup to use
>>>> for the login screen?
>>>
>>> I had to set xlogin.Login.{x,y,width,height} for Login window to appear
>>> on my second monitor - I'm using dual DVI output NVIDIA card with nv(4)
>>> and screen size set to 2560 x 1024.
>>>
>>> /usr/local/lib/X11/xdm/Xresources contents:
>>> xlogin.Login.x: 1620
>>> xlogin.Login.y: 492
>>> xlogin.Login.width: 600
>>> xlogin.Login.height: 240
>>
>> That works, although the mouse pointer is still on the other screen.  I
>> came up with a patch to xdm to fix that, but there's more that should be
>> done.  I'd like to add a setting for a monitor or screen, but don't know
>> if there's an existing keyword to use.
>
> I may be a bad example, as I'm running server 1.6rc and rc xrandr bits
> as well, but it seems to me that gdm is coming up on whichever display
> that I have the mouse on.  For me the mouse initially starts out
> centered in my framebuffer... This is all anecdotal actually, I haven't
> had time to look at the code...

With Xinerama, xdm helpfully (dimwittedly) centers the mouse pointer in 
screen[0]:

     if (
         XineramaIsActive(dpy) &&
         (screens = XineramaQueryScreens(dpy, &s_num)) != NULL
        )
     {
         XWarpPointer(dpy, None, XRootWindowOfScreen (scrn),
                         0, 0, 0, 0,
                         screens[0].x_org + screens[0].width / 2,
                         screens[0].y_org + screens[0].height / 2);

That code wrongly assumes that screens[0] is the main monitor and that 
the login window is in the center of that screen.  Not to mention the 
annoyance of having the pointer cover up where you're typing.

So there's a 1920x1200 monitor (Monitor0 in xorg.conf) and then a 
1024x768 monitor to the left that is not always on.

Two weeks ago, screens[0] corresponded with Monitor0.  The new xorg 
server seems to sort or count screens differently so that it's now 
screens[1].  With Xresources

xlogin.Login.x: 1614
xlogin.Login.y: 460

The mouse pointer is still on the other screen [1024x768].  I've patched 
that, but it's only the first step.  The second step would be to have 
something like

xlogin.Login.Screen: 1

My ignorance of X resources is such that I don't know if I can just make 
up a keyword, or there is something appropriate already.  Nor how to get 
that value, but it's a learning exercise.

Optional, for style points: the third step would be to make the login 
screen draggable and add buttons to identify which monitor is which 
screen and to save those settings so it comes up that way next time.

-Warren Block * Rapid City, South Dakota USA


More information about the freebsd-x11 mailing list