Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

… disabling the extension works.
  • Loading branch information...
commit ac1ef8bd18c74cfb4db17d034c47b75a49b2b2d5 1 parent 73282a5
@mathematicalcoffee mathematicalcoffee authored
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() {
Please sign in to comment.
Something went wrong with that request. Please try again.