Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intellihide: Fix unexpected unredirection disable with overview #2196

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ const DockedDash = GObject.registerClass({
this._autohideIsEnabled = null;
this._intellihideIsEnabled = null;

// This variable counts how many times Meta.disable_unredirect_for_display() is called
// This variable marks if Meta.disable_unredirect_for_display() is called
// to help restore the original state when intelihide is disabled.
this._disableUnredirectCount = 0;
this._unredirectDisabled = false;

// Create intellihide object to monitor windows overlapping
this._intellihide = new Intellihide.Intellihide(this.monitorIndex);
Expand Down Expand Up @@ -669,9 +669,10 @@ const DockedDash = GObject.registerClass({
}

_restoreUnredirect() {
for (let i = 0; i < this._disableUnredirectCount; i++)
if (this._unredirectDisabled) {
Meta.enable_unredirect_for_display(global.display);
this._disableUnredirectCount = 0;
this._unredirectDisabled = false;
}
}

/**
Expand Down Expand Up @@ -827,9 +828,9 @@ const DockedDash = GObject.registerClass({
}

_animateIn(time, delay) {
if (this._intellihideIsEnabled) {
if (!this._unredirectDisabled && this._intellihideIsEnabled) {
Meta.disable_unredirect_for_display(global.display);
this._disableUnredirectCount++;
this._unredirectDisabled = true;
}
this._dockState = State.SHOWING;
this.dash.iconAnimator.start();
Expand Down Expand Up @@ -868,9 +869,9 @@ const DockedDash = GObject.registerClass({
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
this._dockState = State.HIDDEN;
if (this._intellihideIsEnabled && this._disableUnredirectCount > 0) {
if (this._intellihideIsEnabled && this._unredirectDisabled) {
Meta.enable_unredirect_for_display(global.display);
this._disableUnredirectCount--;
this._unredirectDisabled = false;
}
// Remove queued barried removal if any
if (this._removeBarrierTimeoutId > 0)
Expand Down