Adjust intellihide grab check for GS 42

This commit is contained in:
Charles Gagnon
2022-04-04 12:08:21 -04:00
parent bf70a6ebb2
commit 5c9a29e7ed
2 changed files with 24 additions and 6 deletions

View File

@@ -168,8 +168,11 @@ var Intellihide = class {
this._signalsHandler.add(
[
this._dtpPanel.taskbar,
'menu-closed',
() => this._panelBox.sync_hover()
['menu-closed', 'end-drag'],
() => {
this._panelBox.sync_hover();
this._onHoverChanged();
}
],
[
Me.settings,
@@ -312,7 +315,7 @@ var Intellihide = class {
_checkIfShouldBeVisible(fromRevealMechanism) {
if (Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.opened ||
this._panelBox.get_hover() || this._checkIfGrab()) {
this._dtpPanel.taskbar._dragMonitor || this._panelBox.get_hover() || this._checkIfGrab()) {
return true;
}
@@ -335,12 +338,24 @@ var Intellihide = class {
}
_checkIfGrab() {
if (GrabHelper._grabHelperStack && GrabHelper._grabHelperStack.some(gh => gh._owner == this._dtpPanel.panel.actor)) {
let isGrab
if (GrabHelper._grabHelperStack)
// gnome-shell < 42
isGrab = GrabHelper._grabHelperStack.some(gh => gh._owner == this._dtpPanel.panel.actor)
else if (global.stage.get_grab_actor) {
// gnome-shell >= 42
let sourceActor = global.stage.get_grab_actor()?._sourceActor
isGrab = sourceActor && (sourceActor == Main.layoutManager.dummyCursor ||
this._dtpPanel.panel.actor.contains(sourceActor))
}
if (isGrab)
//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 isGrab;
}
_revealPanel(immediate) {

View File

@@ -590,6 +590,9 @@ var Taskbar = class {
this._showAppsIcon.setDragApp(null);
DND.removeDragMonitor(this._dragMonitor);
this._dragMonitor = null;
this.emit('end-drag');
this._toggleFavortieHighlight();
}