GNOME Bugzilla – Bug 581769
Reorganize overlay hiding/showing code
Last modified: 2009-05-07 21:04:37 UTC
This was inspired by the sidebar work. The sidebar has to hide itself when the overlay is displayed, and reshow itself when the overlay is hidden. But it has to reshow itself after the overlay *finishes* hiding, and there was no non-hacky way to do that. So this changes things around so that overlay.js is more in control of the overlay show/hide process, and also so that it emits signals indicating its state. So the sidebar code will be able to listen to 'showing' and 'hidden' and DTRT.
Created attachment 134207 [details] [review] Reorganize overlay hiding/showing code Rather than having main.js manage this, put it into overlay.js, and have the overlay object emit signals that other code can watch to do things when the overlay is showing/shown/hiding/hidden.
Your patch looks good. I just noticed that we have an overlayHidden() function in panel.js that never gets called. I think the intent of this function was to release the Activities button when the overlay is exited with an Esc key. Right now the button just stays pressed. Similarly, the button is not shown as pressed in when you enter the overlay by hitting the System key or Alt+F1, and gets pressed in if you click it to exit the overlay. This can be easily fixed by adding a press() function to button.js, calling it when the 'showing' signal is emitted by the overlay, and calling the already existing release() function when the 'hiding' signal is emitted. While these are not problems introduced by your patch, they can probably be addressed in it. At least the overlayHidden() function needs to be removed.
Created attachment 134221 [details] [review] Reorganize overlay hiding/showing code Ah, that's what overlayHidden() was for. I'd actually noticed it there and removed it from my source tree right after filing this bug... Add this: Main.overlay.connect('hiding', Lang.bind(this.button, this.button.release)); and it works.
committed after further irc discussion