def prevLayout(self): self.layout.hide() self.currentLayout = (self.currentLayout - 1)%(len(self.layouts)) hook.fire("layout_change", self.layouts[self.currentLayout]) self.layoutAll() screen = self.screen.get_rect() self.layout.show(screen)
def handle_EnterNotify(self, e): hook.fire("client_mouse_enter", self) if self.qtile.config.follow_mouse_focus and \ self.group.currentWindow != self: self.group.focus(self, False) if self.group.screen and self.qtile.currentScreen != self.group.screen: self.qtile.toScreen(self.group.screen.index) return True
def unmanage(self, win): c = self.windowMap.get(win) if c: hook.fire("client_killed", c) if getattr(c, "group", None): c.unmap() c.state = window.wmState.WITHDRAWN c.group.remove(c) del self.windowMap[win]
def addGroup(self, name): if name not in self.groupMap.keys(): g = Group(name) self.groups.append(g) g._configure(self.config.layouts, self.config.floating_layout, self) self.groupMap[name] = g hook.fire("addgroup") return True return False
def disablefloating(self): if self._float_state != floatStates.NOT_FLOATING: if self._float_state == floatStates.FLOATING: # store last size fi = self._float_info fi['w'] = self.width fi['h'] = self.height self._float_state = floatStates.NOT_FLOATING self.group.mark_floating(self, False) hook.fire('float_change')
def layout(self, layout): """ "layout" is a string with matching the name of a Layout object. """ for index, obj in enumerate(self.layouts): if obj.name == layout: self.currentLayout = index hook.fire("layout_change", self.layouts[self.currentLayout]) self.layoutAll() return raise ValueError("No such layout: %s"%layout)
def updateHints(self): """ update the local copy of the window's WM_HINTS http://tronche.com/gui/x/icccm/sec-4.html#WM_HINTS """ try: h = self.get_wm_hints() normh = self.get_wm_normal_hints() except (xcb.xproto.BadWindow, xcb.xproto.BadAccess): return # FIXME # h values #{ # 'icon_pixmap': 4194337, # 'icon_window': 0, # 'icon_mask': 4194340, # 'icon_y': 0, # 'input': 1, # 'icon_x': 0, # 'window_group': 4194305 # 'initial_state': 1, # 'flags': set(['StateHint', # 'IconMaskHint', # 'WindowGroupHint', # 'InputHint', # 'UrgencyHint', # 'IconPixmapHint']), #} if normh: normh.pop('flags') if(not normh['base_width'] and normh['min_width'] and normh['width_inc']): # seems xcb does ignore base width :( normh['base_width'] = normh['min_width'] % normh['width_inc'] if(not normh['base_height'] and normh['min_height'] and normh['height_inc']): # seems xcb does ignore base height :( normh['base_height'] = normh['min_height'] % normh['height_inc'] self.hints.update(normh) if h and 'UrgencyHint' in h['flags']: self.hints['urgent'] = True hook.fire('client_urgent_hint_changed', self) elif self.urgent: self.hints['urgent'] = False hook.fire('client_urgent_hint_changed', self) if getattr(self, 'group', None): self.group.layoutAll() return
def delGroup(self, name): if len(self.groups) == 1: raise ValueError("Can't delete all groups.") if name in self.groupMap.keys(): group = self.groupMap[name] prev = group.prevGroup() for i in list(group.windows): i.togroup(prev.name) if self.currentGroup.name == name: self.currentGroup.cmd_prevgroup() self.groups.remove(group) del(self.groupMap[name]) hook.fire("delgroup")
def _reconfigure_floating(self, new_float_state=floatStates.FLOATING): if new_float_state == floatStates.MINIMIZED: self.state = wmState.ICONIC self.hide() else: # make sure x, y is on the screen screen = self.qtile.find_closest_screen(self.x, self.y) if screen is not None and self.group is not None and \ self.group.screen is not None and screen != self.group.screen: self.x = self.group.screen.x self.y = self.group.screen.y self.place(self.x, self.y, self.width, self.height, self.borderwidth, self.bordercolor, above=True, ) if self._float_state != new_float_state: self._float_state = new_float_state if self.group: # may be not, if it's called from hook self.group.mark_floating(self, True) hook.fire('float_change')