From ede426db58ccba38568d7b7a5674dc25bd0c78ef Mon Sep 17 00:00:00 2001 From: Artyom Zorin Date: Tue, 6 Mar 2018 22:51:20 +0000 Subject: [PATCH] Created app hover blacklist & added Remmina to it Apps which behave irregularly upon window preview hover have been separated into a blacklist and Remmina has been added to the blacklist. --- windowPreview.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/windowPreview.js b/windowPreview.js index 72f375a..ef39ce2 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -47,6 +47,12 @@ const AppIcons = Me.imports.appIcons; let DEFAULT_THUMBNAIL_WIDTH = 350; let DEFAULT_THUMBNAIL_HEIGHT = 200; +let HOVER_APP_BLACKLIST = [ + "Oracle VM VirtualBox", + "Virtual Machine Manager", + "Remmina" + ] + var thumbnailPreviewMenu = new Lang.Class({ Name: 'DashToPanel.ThumbnailPreviewMenu', Extends: PopupMenu.PopupMenu, @@ -194,14 +200,23 @@ var thumbnailPreviewMenu = new Lang.Class({ this._hoverCloseTimeoutId = null; } }, + + _appInHoverBlacklist: function (appName) { + for (let i = 0; i < HOVER_APP_BLACKLIST.length; i++) { + if (appName === HOVER_APP_BLACKLIST[i]) + return true; + } + + return false; + }, hoverOpen: function () { this._hoverOpenTimeoutId = null; if (!this.isOpen && this._dtpSettings.get_boolean("show-window-previews")) { this.popup(); let focusedApp = Shell.WindowTracker.get_default().focus_app; - if (focusedApp && (focusedApp.get_name() === "Oracle VM VirtualBox" || focusedApp.get_name() === "Virtual Machine Manager")) { - this.actor.grab_key_focus(); + if (focusedApp && this._appInHoverBlacklist(focusedApp.get_name())) { + this.actor.grab_key_focus(); } } },