def _process_screens(self): if hasattr(self.config, 'fake_screens'): self._process_fake_screens() return # What's going on here is a little funny. What we really want is only # screens that don't overlap here; overlapping screens should see the # same parts of the root window (i.e. for people doing xrandr # --same-as). However, the order that X gives us psuedoscreens in is # important, because it indicates what people have chosen via xrandr # --primary or whatever. So we need to alias screens that should be # aliased, but preserve order as well. See #383. xywh = {} screenpos = [] for s in self.conn.pseudoscreens: pos = (s.x, s.y) (w, h) = xywh.get(pos, (0, 0)) if pos not in xywh: screenpos.append(pos) xywh[pos] = (max(w, s.width), max(h, s.height)) for i, (x, y) in enumerate(screenpos): (w, h) = xywh[(x, y)] if i + 1 > len(self.config.screens): scr = Screen() else: scr = self.config.screens[i] if not self.currentScreen: self.currentScreen = scr scr._configure( self, i, x, y, w, h, self.groups[i], ) self.screens.append(scr) if not self.screens: if self.config.screens: s = self.config.screens[0] else: s = Screen() self.currentScreen = s s._configure( self, 0, 0, 0, self.conn.default_screen.width_in_pixels, self.conn.default_screen.height_in_pixels, self.groups[0], ) self.screens.append(s)
def _process_screens(self): if hasattr(self.config, 'fake_screens'): self._process_fake_screens() return for i, s in enumerate(self.conn.pseudoscreens): if i + 1 > len(self.config.screens): scr = Screen() else: scr = self.config.screens[i] if not self.currentScreen: self.currentScreen = scr scr._configure( self, i, s.x, s.y, s.width, s.height, self.groups[i], ) self.screens.append(scr) if not self.screens: if self.config.screens: s = self.config.screens[0] else: s = Screen() self.currentScreen = s s._configure( self, 0, 0, 0, self.conn.default_screen.width_in_pixels, self.conn.default_screen.height_in_pixels, self.groups[0], ) self.screens.append(s)