def update_workarea(): ''' We update the current workarea either by autodetecting struts, or by using margins specified in the config file. Never both, though. ''' global workarea if hasattr(config, 'use_margins') and config.use_margins: workarea = monitors[:] for physm, margins in enumerate(config.margins): i = phys_monitors[physm] mx, my, mw, mh = workarea[i] workarea[i] = (mx + margins['left'], my + margins['top'], mw - (margins['left'] + margins['right']), mh - (margins['top'] + margins['bottom'])) else: workarea = rect.monitor_rects(monitors)
def update_workarea(): """ We update the current workarea either by autodetecting struts, or by using margins specified in the config file. Never both, though. """ global workarea if hasattr(config, "use_margins") and config.use_margins: workarea = monitors[:] for physm, margins in enumerate(config.margins): if physm == len(phys_monitors): break i = phys_monitors[physm] mx, my, mw, mh = workarea[i] workarea[i] = ( mx + margins["left"], my + margins["top"], mw - (margins["left"] + margins["right"]), mh - (margins["top"] + margins["bottom"]), ) else: workarea = rect.monitor_rects(monitors)
def __init__(self): self.window_manager = self.get_window_manager() monitors = xinerama.get_monitors() self.workareas = [ Rectangle(*mon) for mon in rect.monitor_rects(monitors) ] self.workareas = sorted(self.workareas, key=lambda rect: rect.x)