From 2b1e5cb8772f22195ac6b2817b1194a4f33c079a Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Mon, 24 Apr 2023 22:10:26 +0200 Subject: [PATCH] :beetle: Fix invisible-window bug --- extension.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/extension.js b/extension.js index 50ebd16..8608fe5 100644 --- a/extension.js +++ b/extension.js @@ -468,12 +468,18 @@ class Extension { // If that was the case, we also check the application name. if (matches && profileApp != '') { - const app = actor.meta_window.get_wm_class().toLowerCase(); + const wmClass = actor.meta_window.get_wm_class(); - // Split app names at |, remove any whitespace, and transform to lower case. - const profileApps = - profileApp.split('|').map(item => item.trim().toLowerCase()); - matches = profileApps.includes(app); + if (wmClass) { + const app = wmClass.toLowerCase(); + + // Split app names at |, remove any whitespace, and transform to lower case. + const profileApps = + profileApp.split('|').map(item => item.trim().toLowerCase()); + matches = profileApps.includes(app); + } else { + matches = false; + } } // If the profile is still matching, we also check the color scheme.