Restore intellihide grabs check for PanelMenuButton

This commit is contained in:
Charles Gagnon
2019-05-29 00:10:07 -04:00
parent e448d5862d
commit 42ecac85e1
3 changed files with 19 additions and 3 deletions

View File

@@ -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);
},

View File

@@ -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;

View File

@@ -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