Skip to content
Browse files

save the signal connection IDs so that we can use them to disconnect;…

… disabling the extension works.
  • Loading branch information...
1 parent 73282a5 commit ac1ef8bd18c74cfb4db17d034c47b75a49b2b2d5 @mathematicalcoffee mathematicalcoffee committed
Showing with 6 additions and 4 deletions.
  1. +6 −4 distraction-free@jancborchardt.net/extension.js
View
10 distraction-free@jancborchardt.net/extension.js
@@ -5,21 +5,23 @@ const Overview = imports.ui.main.overview;
const Panel = imports.ui.main.panel;
const MessageTray = imports.ui.main.messageTray;
+let showID, hideID;
+
function init() {
}
function enable() {
hideDistractions();
Panel._activitiesButton.actor.hide();
- Overview.connect('hiding', hideDistractions);
- Overview.connect('showing', showDistractions);
+ hideID = Overview.connect('hiding', hideDistractions);
+ showID = Overview.connect('showing', showDistractions);
}
function disable() {
+ Overview.disconnect(showID);
+ Overview.disconnect(hideID);
showDistractions();
Panel._activitiesButton.actor.show();
- Overview.disconnect(Overview.connect('hiding', hideDistractions));
- Overview.disconnect(Overview.connect('showing', showDistractions));
}
function hideDistractions() {

0 comments on commit ac1ef8b

Please sign in to comment.
Something went wrong with that request. Please try again.