def goto_window(win_name_or_id): wid = win_name_or_id if isinstance(wid, basestring): clients = ewmh.get_client_list().reply() for c in clients: if wid == ewmh.get_wm_name(c).reply(): wid = c break if isinstance(wid, int): wdesk = ewmh.get_wm_desktop(wid).reply() if wdesk not in ewmh.get_visible_desktops().reply(): ewmh.request_current_desktop_checked(wdesk).check() ewmh.request_active_window_checked(wid, source=2).check()
def do_goto_window(letter): if letter not in marked: print("mark %s does not exist" % letter, file=sys.stderr) return wid = marked[letter] try: wdesk = ewmh.get_wm_desktop(wid).reply() desktop = ewmh.get_current_desktop().reply() visibles = ewmh.get_visible_desktops().reply() or [desktop] if wdesk is not None and wdesk not in visibles: ewmh.request_current_desktop_checked(wdesk).check() ewmh.request_active_window_checked(wid, source=1).check() except xproto.BadWindow: print("%d no longer exists" % wid, file=sys.stderr)
def do_goto_window(letter): if letter not in marked: print >> sys.stderr, 'mark %s does not exist' % letter return wid = marked[letter] try: wdesk = ewmh.get_wm_desktop(wid).reply() desktop = ewmh.get_current_desktop().reply() visibles = ewmh.get_visible_desktops().reply() or [desktop] if wdesk is not None and wdesk not in visibles: ewmh.request_current_desktop_checked(wdesk).check() ewmh.request_active_window_checked(wid, source=1).check() except xcb.xproto.BadWindow: print >> sys.stderr, '%d no longer exists' % wid
def activate(self): ewmh.request_active_window_checked(self.wid, source=1).check()
def undoMinimized(self): # TODO: showNormal() should work here, but actually it doesn't. # It's likely a bug of Qt, so I just used the xcb way, which # should be relaced in the future with the Qt way. cookie = request_active_window_checked(self.winId().__int__()) cookie.check()
def activate(self): ewmh.request_active_window_checked(self.wid, source=1).check() debug("Activate done %s" % self)