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

Fix gnome shell problems with lock screen #1

Merged
merged 1 commit into from
May 22, 2019
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
15 changes: 9 additions & 6 deletions extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Copyright (c) 2016 - 2018 Eric Goller / projecthamster <elbenfreund@projecthamst
*/


const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Shell = imports.gi.Shell;
const Meta = imports.gi.Meta;
Expand Down Expand Up @@ -82,7 +81,7 @@ const WindowsProxyIface = ['',

let WindowsProxy = Gio.DBusProxy.makeProxyWrapper(WindowsProxyIface);


var isKeyBindingActive = 0; // Toggle whether keybinding is registered (attempt to fix crashing problems with Main.wm.RemoveKeyBinding in disable:)


/**
Expand Down Expand Up @@ -184,17 +183,21 @@ function Controller(extensionMeta) {
Shell.KeyBindingMode ? Shell.KeyBindingMode.ALL : Shell.ActionMode.ALL,
Lang.bind(this.panelWidget, this.panelWidget.toggle)
);
this.isKeyBindingActive = 1;
},

disable: function() {
this.shouldEnable = false;
Main.wm.removeKeybinding("show-hamster-dropdown");

if(this.isKeyBindingActive == 1) {
global.log('Removing keybinding.');
Main.wm.removeKeybinding("show-hamster-dropdown");
} else {
global.log('(!!) Skipped removing keybinding as it was not enabled... Probably avoided a crash!');
}
this.isKeyBindingActive = 0;
global.log('Shutting down hamster-shell-extension.');
this._removeWidget(this.placement);
Main.panel.menuManager.removeMenu(this.panelWidget.menu);
GLib.source_remove(this.panelWidget.timeout);
this.panelWidget.actor.destroy();
this.panelWidget.destroy();
this.panelWidget = null;
this.apiProxy = null;
Expand Down