From 718668673e171806cc30709af5366c029746ba34 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Tue, 9 Aug 2022 00:50:24 -0400 Subject: [PATCH] windowAttentionHandler: remove notification fallback, re-add all 5.2 names to the pass-thru list. - Some people don't use window lists, but 3rd-party docks instead, so there's no need for notifications. Assume we have window lists or a dock for attention grabbing. - Tests seemed to indicate focus issues were resolved with the apps originally listed as 'pass-thru', but with more users now it seems not to entirely be the case, so just restore the entire list. Fixes #11024 Fixes #11018 --- data/org.cinnamon.gschema.xml | 2 +- js/ui/windowAttentionHandler.js | 41 ++++++++------------------------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/data/org.cinnamon.gschema.xml b/data/org.cinnamon.gschema.xml index 5e1fb4f842..7b8fa10387 100644 --- a/data/org.cinnamon.gschema.xml +++ b/data/org.cinnamon.gschema.xml @@ -543,7 +543,7 @@ - ['firefox'] + ['gnome-screenshot', 'lxterminal', 'xfce4-terminal', 'firefox', 'libreoffice', 'soffice'] WM class names to always give focus to in windowAttentionHandler.js diff --git a/js/ui/windowAttentionHandler.js b/js/ui/windowAttentionHandler.js index 381e6ad96f..dbc89187c2 100644 --- a/js/ui/windowAttentionHandler.js +++ b/js/ui/windowAttentionHandler.js @@ -34,42 +34,21 @@ WindowAttentionHandler.prototype = { * user's attention (like blinking in the window list). Some windows aren't * directly tied to a user action, but are generated by the user's action anyhow - * these we make an exception for and focus them. */ - try { - if (!window || window.has_focus() || window.is_skip_taskbar() || !Main.isInteresting(window)) { - return; - } + if (!window || window.has_focus() || window.is_skip_taskbar() || !Main.isInteresting(window)) { + return; + } - let wmclass = window.get_wm_class(); + let wmclass = window.get_wm_class(); - if (wmclass) { - let ignored_classes = global.settings.get_strv("demands-attention-passthru-wm-classes"); + if (wmclass) { + let ignored_classes = global.settings.get_strv("demands-attention-passthru-wm-classes"); - for (let i = 0; i < ignored_classes.length; i++) { - if (wmclass.toLowerCase().includes(ignored_classes[i].toLowerCase())) { - window.activate(global.get_current_time()); - return; - } + for (let i = 0; i < ignored_classes.length; i++) { + if (wmclass.toLowerCase().includes(ignored_classes[i].toLowerCase())) { + window.activate(global.get_current_time()); + return; } } - - if (AppletManager.get_role_provider_exists(Main.AppletManager.Roles.WINDOW_ATTENTION_HANDLER)) { - return; - } - - let app = this._tracker.get_window_app(window); - - let name = "" - if (app !== null) { - name = app.get_name(); - } - - let source = new WindowHandlerSource(app, window); - Main.messageTray.add(source); - - let notification = new MessageTray.Notification(source, name, window.get_title()); - source.notify(notification); - } catch (e) { - global.logError('Error showing window demanding attention', e); } } };