Skip to content

Commit

Permalink
Fix gnome shell problems with lock screen
Browse files Browse the repository at this point in the history
- Credits to @NikMel in this [issue](projecthamster#295 (comment))
  • Loading branch information
PriOliveira committed Jan 24, 2019
1 parent 0d815b2 commit 4616307
Showing 1 changed file with 9 additions and 6 deletions.
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 comment has been minimized.

Copy link
@NikMel

NikMel Jan 25, 2019

This log entry can probably be dropped. I include just to see if I actually was able to hit the bug...

}
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

0 comments on commit 4616307

Please sign in to comment.