GNOME Bugzilla – Bug 706783
No longer possible to exit Message Tray mode programatically.
Last modified: 2015-03-07 05:43:47 UTC
Under previous versions of gnome-shell (i.e. 3.8 and before), when the message tray was active it was possible to return to the normal desktop mode via the command: dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.freedesktop.DBus.Properties.Set string:org.gnome.Shell string:OverviewActive variant:boolean:false Technically, this was likely considered a bug as at some point the "message tray" and the "overview" modes were split. So my question is as follows: 1. Should a new property be added for MessageTrayActive? (or have I missed the property I should be using?) or 2. Should there be some heuristics added to notification-daemon implementation to automatically exit MessageTray mode? To explain the latter suggestion, the reason I want this is that we have some code that displays notifications. These notifications have actions and when the action is clicked, we pop up a new window and "do stuff", however the message tray mode itself remains active. In order to fix this I added this commit a while back in our code: http://gitweb.mageia.org/software/mgaonline/commit/?id=1105de688292179f5e7b890dda9f54381e00c884 So I'm adding specific code downstream to do this which is not ideal (especially as this is cross-desktop code and this is gnome-specific workarounds). However, it's perhaps not crazy to assume that when you click on an action, that you want the message tray mode to exit, so perhaps this principle can be built in to the notification daemon implementation itself and work for all notification actions? Either way, if I have to update our code that's fine, but I'd like some way to be able to get the behaviour back :)
FWIW, I'm pretty sure it worked in 3.8.* (but I could be wrong). Currently using 3.9.90 (apologies for not including this in the report)
Notification actions should always close the tray and raise the app. There's a bug in here somewhere.
In case it has any bearing, in this case the app generating the notifications is basically headless. The windows that pop up are the result of spawning new applications. Not sure if this causes some kind of problem with the code (i.e. it cannot track the window id back to the app or something).
FWIW, programatic exit can be done via: dbus-send --session --dest=org.gnome.Shell --print-reply=literal --type=method_call /org/gnome/Shell org.gnome.Shell.Eval string:"Main.messageTray._trayState==2 && Main.messageTray.toggle();" At least, that worked for me.
The message tray is gone now ...