From a3c8da82d418265ba255db1c3a217fb26303bb91 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Fri, 17 May 2019 15:40:00 -0400 Subject: [PATCH] Adjust intellihide for custom previews --- intellihide.js | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/intellihide.js b/intellihide.js index 4690500..233819d 100644 --- a/intellihide.js +++ b/intellihide.js @@ -20,7 +20,6 @@ const Clutter = imports.gi.Clutter; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; -const GrabHelper = imports.ui.grabHelper; const Layout = imports.ui.layout; const Main = imports.ui.main; const OverviewControls = imports.ui.overviewControls; @@ -33,12 +32,10 @@ const Utils = Me.imports.utils; //timeout intervals const CHECK_POINTER_MS = 200; -const CHECK_GRAB_MS = 400; const POST_ANIMATE_MS = 50; const MIN_UPDATE_MS = 250; //timeout names -const T1 = 'checkGrabTimeout'; const T2 = 'limitUpdateTimeout'; const T3 = 'postAnimateTimeout'; @@ -187,10 +184,12 @@ var Intellihide = Utils.defineClass({ [ this._panelBox, 'notify::hover', - () => { - this._hoveredOut = !this._panelBox.hover; - this._queueUpdatePanelPosition(); - } + () => this._onHoverChanged() + ], + [ + this._dtpPanel.taskbar.previewMenu, + 'notify::hover', + () => this._onHoverChanged() ], [ Main.overview, @@ -203,6 +202,11 @@ var Intellihide = Utils.defineClass({ ); }, + _onHoverChanged: function() { + this._hoveredOut = !this._panelBox.hover && !this._dtpPanel.taskbar.previewMenu.hover; + this._queueUpdatePanelPosition(); + }, + _setTrackPanel: function(reset, enable) { if (!reset) { Main.layoutManager._untrackActor(this._panelBox); @@ -291,7 +295,7 @@ var Intellihide = Utils.defineClass({ }, _checkIfShouldBeVisible: function(fromRevealMechanism) { - if (Main.overview.visibleTarget || this._checkIfGrab() || this._panelBox.get_hover()) { + if (Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.get_hover() || this._panelBox.get_hover()) { return true; } @@ -313,17 +317,6 @@ var Intellihide = Utils.defineClass({ return !this._windowOverlap; }, - _checkIfGrab: function() { - if (GrabHelper._grabHelperStack.some(gh => this._panelBox.contains(gh._owner))) { - //there currently is a grab on a child of the panel, check again soon to catch its release - this._timeoutsHandler.add([T1, CHECK_GRAB_MS, () => this._queueUpdatePanelPosition()]); - - return true; - } - - return false; - }, - _revealPanel: function(immediate) { this._animatePanel(0, immediate); },