diff --git a/intellihide.js b/intellihide.js index 7ab838a..e725715 100644 --- a/intellihide.js +++ b/intellihide.js @@ -20,6 +20,7 @@ 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; @@ -32,10 +33,12 @@ 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'; @@ -295,7 +298,8 @@ var Intellihide = Utils.defineClass({ }, _checkIfShouldBeVisible: function(fromRevealMechanism) { - if (Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.opened || this._panelBox.get_hover()) { + if (Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.opened || + this._panelBox.get_hover() || this._checkIfGrab()) { return true; } @@ -317,6 +321,17 @@ 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); }, diff --git a/panel.js b/panel.js index afdf0b3..ae9c8fc 100644 --- a/panel.js +++ b/panel.js @@ -267,7 +267,6 @@ var dtpPanelWrapper = Utils.defineClass({ this._setAppmenuVisible(false); if(this.appMenu) this.panel._leftBox.add_child(this.appMenu.container); - this.taskbar.destroy(); if (this.startIntellihideId) { Mainloop.source_remove(this.startIntellihideId); @@ -288,6 +287,8 @@ var dtpPanelWrapper = Utils.defineClass({ this.dynamicTransparency.destroy(); } + this.taskbar.destroy(); + // reset stored icon size to the default dash Main.overview.dashIconSize = Main.overview._controls.dash.iconSize; diff --git a/panelManager.js b/panelManager.js index 06c8f87..146af74 100755 --- a/panelManager.js +++ b/panelManager.js @@ -282,7 +282,7 @@ var dtpPanelManager = Utils.defineClass({ }, _getBoxPointerPreferredHeight: function(boxPointer, alloc, monitor) { - if (boxPointer._dtpInPanel && this._dtpSettings.get_boolean('intellihide')) { + if (boxPointer._dtpInPanel && boxPointer.sourceActor && this._dtpSettings.get_boolean('intellihide')) { monitor = monitor || Main.layoutManager.findMonitorForActor(boxPointer.sourceActor); let excess = alloc.natural_size + this._dtpSettings.get_int('panel-size') + 10 - monitor.height; // 10 is arbitrary