-
Notifications
You must be signed in to change notification settings - Fork 532
intellihide: fix overlap check getting permanently stuck #2552
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,11 @@ export class Intellihide { | |
| enable() { | ||
| this._isEnabled = true; | ||
| this._status = OverlapStatus.UNDEFINED; | ||
| this._checkOverlapTimeoutContinue = false; | ||
| if (this._checkOverlapTimeoutId > 0) { | ||
| GLib.source_remove(this._checkOverlapTimeoutId); | ||
| this._checkOverlapTimeoutId = 0; | ||
| } | ||
| global.get_window_actors().forEach(function (wa) { | ||
| this._addWindowSignals(wa); | ||
| }, this); | ||
|
|
@@ -128,11 +133,15 @@ export class Intellihide { | |
| } | ||
|
|
||
| _windowCreated(display, metaWindow) { | ||
| this._addWindowSignals(metaWindow.get_compositor_private()); | ||
| const dominated = metaWindow.get_compositor_private(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)); | ||
|
|
@@ -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; | ||
|
|
@@ -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) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
_checkOverlapTimeoutContinueis unset (thus false) by default.Maybe you do want to remove the timeout on disable though.