[d-feet] Don't use Wnck to get app-icons under non-X11



commit c9d202ede2474f4a748be78fac78ba077e958399
Author: Simon McVittie <smcv debian org>
Date:   Sun Apr 17 14:16:28 2016 +0100

    Don't use Wnck to get app-icons under non-X11
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=763615
    Bug-Debian: https://bugs.debian.org/821294
    Signed-off-by: Simon McVittie <smcv debian org>

 src/dfeet/wnck_utils.py |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/dfeet/wnck_utils.py b/src/dfeet/wnck_utils.py
index c631793..ff92e72 100644
--- a/src/dfeet/wnck_utils.py
+++ b/src/dfeet/wnck_utils.py
@@ -24,17 +24,19 @@ class IconTable(object):
 
         if has_libwnck:
             screen = Wnck.Screen.get_default()
-            Wnck.Screen.force_update(screen)
-            screen.connect('application_opened', self.on_app_open)
-            screen.connect('application_closed', self.on_app_close)
-
-            for w in screen.get_windows():
-                app = w.get_application()
-                pid = app.get_pid()
-                icon = app.get_mini_icon()
-
-                if pid not in self.app_map.keys():
-                    self.app_map[pid] = icon
+            # screen is None under Wayland
+            if screen is not None:
+                Wnck.Screen.force_update(screen)
+                screen.connect('application_opened', self.on_app_open)
+                screen.connect('application_closed', self.on_app_close)
+
+                for w in screen.get_windows():
+                    app = w.get_application()
+                    pid = app.get_pid()
+                    icon = app.get_mini_icon()
+
+                    if pid not in self.app_map.keys():
+                        self.app_map[pid] = icon
 
     def on_app_open(self, screen, app):
         icon = app.get_mini_icon()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]