multiple display support broken

Bug #774624 reported by Brian May
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ratpoison (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: ratpoison

If I select a window on my second display, that window gets keyboard focus (good), however any new programs I start appear on the first screen. This was fine before I upgraded from Maverick to Natty.

To create a window on the second display, I have to do it manually, e.g.:

export DISPLAY=:0.1
xterm

Will try downgrading ratpoision and see if this helps.

Revision history for this message
Brian May (brian-microcomaustralia) wrote :

Ummm... ok, the version of ratpoison in maverick is the same version. Looks like some incompatible change with the X server???

Revision history for this message
Nicolas FAURE (n-faure) wrote :

I have the same issue.
A workaround is to start ratpoison with "-d :0.0" (can be changed in /usr/share/xsessions/ratpoison.desktop)

Revision history for this message
Brian May (brian-microcomaustralia) wrote :

Hmmm.... Looks like DISPLAY, by default, is set to :0 not :0.0 now.

ratpoison doesn't add the screen number if there isn't already one there.

I am guessing the exact code is screen.c, from line 277:

=== cut ===
  /* Build the display string for each screen */
  s->display_string = xmalloc (strlen(DisplayString (dpy)) + 21);
  sprintf (s->display_string, "DISPLAY=%s", DisplayString (dpy));
  if (strrchr (DisplayString (dpy), ':'))
    {
      char *dot;

      dot = strrchr(s->display_string, '.');
      if (dot)
        sprintf(dot, ".%i", screen_num);
    }

  PRINT_DEBUG (("%s\n", s->display_string));
=== cut ===

If the "if (dot)" condition fails, it needs to append the string at the end I think. So something like (not tested):

char * dot;
dot = strrchr(s->display_string, '.');
if (!dot) dot = s->display_string + strlen(s->display_string);
sprintf(dot, ".%i", screen_num);

I think the buffer should already be big enough for this - strlen(DisplayString (dpy)) + 21 bytes.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.