Skip to content
Open
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
21 changes: 19 additions & 2 deletions intellihide.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export class Intellihide {
enable() {
this._isEnabled = true;
this._status = OverlapStatus.UNDEFINED;
this._checkOverlapTimeoutContinue = false;
Copy link
Copy Markdown
Collaborator

@3v1n0 3v1n0 Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're removing the timeout, this call has no effect. Otherwise _checkOverlapTimeoutContinue is unset (thus false) by default.

Maybe you do want to remove the timeout on disable though.

if (this._checkOverlapTimeoutId > 0) {
GLib.source_remove(this._checkOverlapTimeoutId);
this._checkOverlapTimeoutId = 0;
}
global.get_window_actors().forEach(function (wa) {
this._addWindowSignals(wa);
}, this);
Expand All @@ -128,11 +133,15 @@ export class Intellihide {
}

_windowCreated(display, metaWindow) {
this._addWindowSignals(metaWindow.get_compositor_private());
const dominated = metaWindow.get_compositor_private();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If've a metaWindow, then we also have a the compositor private side.

if (dominated)
this._addWindowSignals(dominated);
this._doCheckOverlap();
}

_addWindowSignals(wa) {
if (this._trackedWindows.has(wa))
return;
if (!this._handledWindow(wa))
return;
const signalId = wa.connect('notify::allocation', this._checkOverlap.bind(this));
Expand Down Expand Up @@ -175,7 +184,11 @@ export class Intellihide {

this._checkOverlapTimeoutId = GLib.timeout_add(
GLib.PRIORITY_DEFAULT, INTELLIHIDE_CHECK_INTERVAL, () => {
this._doCheckOverlap();
try {
this._doCheckOverlap();
} catch (e) {
logError(e, 'intellihide overlap check failed');
}
if (this._checkOverlapTimeoutContinue) {
this._checkOverlapTimeoutContinue = false;
return GLib.SOURCE_CONTINUE;
Expand Down Expand Up @@ -248,8 +261,12 @@ export class Intellihide {
// Optionally skip windows of other applications
_intellihideFilterInteresting(wa) {
const metaWin = wa.get_meta_window();
if (!metaWin)
return false;
const currentWorkspace = global.workspace_manager.get_active_workspace_index();
const workspace = metaWin.get_workspace();
if (!workspace)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC this can happen only if the window is being destroyed, so in such case we should not even be here.

return false;
const workspaceIndex = workspace.index();

// Depending on the intellihide mode, exclude non-relevent windows
Expand Down