emiapwil / glassy-gnome

To bring opacity features to gnome windows.
GNU General Public License v2.0
63 stars 9 forks source link

get_wm_class() may return NULL for some windows #3

Closed ipaq3870 closed 8 years ago

ipaq3870 commented 8 years ago

Hi,

For some reasons, get_wm_class() might return null for some unnamed windows, and generate some error messages in the logs. I propose the following patch that works for me:

--- extension.js.1  2016-04-14 10:12:11.687902943 +0800
+++ extension.js    2016-04-18 16:52:24.785771615 +0800
@@ -52,11 +52,12 @@
             offset:     0
         };
     }
+    let window_class = meta_win.get_wm_class();
     for (let i in filters) {
         let filter = filters[i];
         for (let j in filter.patterns) {
             let pattern = filter.patterns[j];
-            if (meta_win.get_wm_class().match('^' + pattern + '$')) {
+            if (window_class && window_class.match('^' + pattern + '$')) {
                 meta_win.glassy.filter = filter;
                 return;
             }
emiapwil commented 8 years ago

Hello @ipaq3870, the latest patch should work for this problem now. Can you build the extension from source and see if it solves the problem? Thanks very much!