Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix bug where you can't disable the extension #1

merged 1 commit into from

2 participants



I fixed your bug where you can't disable the extension.

When you connect to an event via object.connect(signal, callback); it returns an ID that you can use to disconnect that event later.

So when you disconnect in disable you should use the same IDs that were returned when you connected in enable, not a new connection ID (which is what you are currently doing).

That's why I've created some global variables showID and hideID, I store the ID returned from Overview.connect, and use it to disconnect in disable.

Hope that helps :) Keep up playing with extensions, it's fun!

@jancborchardt jancborchardt merged commit 6f7d136 into jancborchardt:master

People like you is why I love open source. Thank you so much, especially for the good explanation! :rocket:


And the fix is now up and approved:

Thanks again @mathematicalcoffee !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 30, 2012
  1. @mathematicalcoffee
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +6 −4
@@ -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() {
- 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);
- Overview.disconnect(Overview.connect('hiding', hideDistractions));
- Overview.disconnect(Overview.connect('showing', showDistractions));
function hideDistractions() {
Something went wrong with that request. Please try again.