コード例 #1
0
    def query(self, query):
        results = []
        query = query.lower()
        for w in matewnck.screen_get_default().get_windows_stacked():
            if w.is_skip_tasklist():
                continue

            for name in (w.get_name().lower(), w.get_application().get_name().lower()):
                if name.find(query) != -1:
                    results.append(
                        ISwitchWindowMatch(name=name, window=w, pixbuf=w.get_mini_icon(), priority=self.get_priority())
                    )
                    break

        self._emit_query_ready(query, results)
コード例 #2
0
def main():
    screen = matewnck.screen_get_default()
    # Process pending gtk+ events so that matewnck can find out about existing windows.
    while gtk.events_pending():
        gtk.main_iteration()
    for window in screen.get_windows():
        # A XID is a number that identifies a X window.
        xid = window.get_xid()
        # By calling gtk.gdk.window_foreign_new(xid), we are creating
        # a gtk.gdk.Window which wraps the window that is identified by
        # the XID. It will return None if it can't find the X window
        # identified by the XID in question.
        wrapped_window = gtk.gdk.window_foreign_new(xid)
        # We are maximizing the window here, but
        # you can do almost anything with a gtk.gdk.Window.
        wrapped_window.maximize()
コード例 #3
0
    def query(self, query):
        results = []
        query = query.lower()
        for w in matewnck.screen_get_default().get_windows_stacked():
            if w.is_skip_tasklist():
                continue

            for name in (w.get_name().lower(),
                         w.get_application().get_name().lower()):
                if name.find(query) != -1:
                    results.append(
                        ISwitchWindowMatch(name=name,
                                           window=w,
                                           pixbuf=w.get_mini_icon(),
                                           priority=self.get_priority()))
                    break

        self._emit_query_ready(query, results)