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

Hide overview before locking screen #2219

Closed
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
33 changes: 33 additions & 0 deletions docking.js
Original file line number Diff line number Diff line change
Expand Up @@ -1662,10 +1662,42 @@ const WorkspaceIsolation = class DashToDockWorkspaceIsolation {


export class DockManager {
_restoreLock() {
Object.getPrototypeOf(Main.screenShield).lock = this._oldLock;
Main.overview.disconnect(this._lockHiddenID);
this._lockHiddenID = 0;
}

_modifyLock() {
// This replaces the Lock() method in ScreenShield singleton
// to ensure that trying to lock the screen in Overview mode will return first
// to normal mode. This is needed to avoid https://github.com/micheleg/dash-to-dock/issues/2214
// until a definitive fix is sent.
const oldLock = Object.getPrototypeOf(Main.screenShield).lock;
this._oldLock = oldLock;
this._lockHiddenID = Main.overview.connect('hidden', () => {
if (this._lockAfterHide) {
this._lockAfterHide = false;
if (!Main.overview.visible)
oldLock.bind(Main.screenShield)(this._lockAnimate);
}
});
Object.getPrototypeOf(Main.screenShield).lock = function (animate) {
if (!Main.overview.visible) {
oldLock.bind(Main.screenShield)(animate);
return;
}
this._lockAfterHide = true;
this._lockAnimate = animate;
Main.overview.hide();
}.bind(this);
}

constructor(extension) {
if (DockManager._singleton)
throw new Error('DashToDock has been already initialized');
DockManager._singleton = this;
this._modifyLock();
this._extension = extension;
this._signalsHandler = new Utils.GlobalSignalsHandler(this);
this._methodInjections = new Utils.InjectionsHandler(this);
Expand Down Expand Up @@ -2531,6 +2563,7 @@ export class DockManager {
}
this._restoreDash();
this._deleteDocks();
this._restoreLock();
this._revertPanelCorners();
if (this._oldSelectorMargin)
this.searchController.margin_bottom = this._oldSelectorMargin;
Expand Down