On Sat, May 31, 2014 at 11:32:57AM -0500, Tycho Andersen wrote:
> On Sat, May 31, 2014 at 06:21:44PM +0200, Björn Lindström wrote:
> > On Sat, May 31, 2014 at 6:07 PM, Tycho Andersen <[email protected]> wrote:
> > 
> > > On Sat, May 31, 2014 at 03:27:55AM -0700, Björn Lindström wrote:
> > > > After updating to the lastest git version the screen I have set as
> > > primary
> > > > with xrandr is no longer considered screen 0. Previously I could just 
> > > > use
> > > > that in order to make the bar go on the external monitor whenever I
> > > connect
> > > > one to my laptop. It also leads to keyboard shortcut confusion when the
> > > > physical screens are placed on different sides of where I can put my
> > > > laptop. Can anyone tell what changed and could it be reverted?
> > >
> > > 114b2a0cb / PR383 is probably what did it, that's the only thing
> > > that's changed in this area recently. What do you mean by "primary" in
> > > xrandr? Is that something we could check?
> > 
> > 
> > It's this option (xrandr man page):
> > 
> >         --primary
> >               Set the output as primary.  It will be sorted first in
> > Xinerama and RANDR geometry requests.
> > 
> > For instance, the command line I run at home to set the relative position
> > of my external screen to the right of my laptop and make it primary is
> > "xrandr --output DisplayPort-0 --primary --mode 1920x1080 --pos 1600x0
> > --output LVDS --mode 1600x900 --pos 0x0".
> 
> Ah, there is also 1a0e4fbf7247580ddc7f748cf1023522c34059ac, I suppose
> reverting that fixes it?

Ah, nope even that's probably not going to fix it (or rather, it'll
fix it randomly, depending on dictionary ordering :-).

Does this (untested) fix it?

diff --git a/libqtile/manager.py b/libqtile/manager.py
index 97e9264..8675074 100644
--- a/libqtile/manager.py
+++ b/libqtile/manager.py
@@ -213,12 +213,16 @@ class Qtile(command.CommandObject):
             return
 
         xywh = {}
+        screenpos = []
         for s in self.conn.pseudoscreens:
             pos = (s.x, s.y)
             (w, h) = xywh.get(pos, (0, 0))
-            xywh[pos] = (max(s.width, w), max(s.height, h))
+            if pos not in xywh or s.width > w or s.height > h:
+                xywh[pos] = (s.width, s.height)
+                screenpos.append(pos)
 
-        for i, ((x, y), (w, h)) in enumerate(sorted(xywh.items())):
+        for i, (x, y) in enumerate(screenpos):
+            (w, h) = xywh[(x, y)]
             if i + 1 > len(self.config.screens):
                 scr = Screen()
             else:

\t

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to