GNOME Bugzilla – Bug 570156
Options to show the tray icon and to minimise to tray on close
Last modified: 2020-03-17 08:35:08 UTC
I do not want my music player running in the background on my computer. I want banshee to close completely when I close the Banshee application window. The default option could be that Banshee behaves as it does now. However, if an option were added to the preferences somewhere that allowed this kind of behavior, that would be great.
You have 2 ways to work around this for now : - Exit banshee using the Media>Quit menu, but I guess you already know that. - Disable the Notification Area extension. Of course, you lose all the features it brings. A preference could be added and used in NotificationAreaService.
I was about to file the exact same request. I really like the notification area and don't want to lose that functionality, but it bothers me that Banshee is the only GNOME application that I use that doesn't quit when I click the X. Maybe there could be the option to minimize to the notification area rather than close to the notification area...?
+1 from me as well. Indeed, maybe this should be handled at a more general level in Gnome (I reported an enhancement[1] in other Gtk+ program, similar to this one). [1] https://bugzilla.novell.com/show_bug.cgi?id=378750
*** Bug 582685 has been marked as a duplicate of this bug. ***
We also need an option to show/hide the tray icon (as asked in bug 582685). In most apps that use tray icons these two come together and I think we should do the same: [x] Show system tray icon [x] Minimise to tray on close I edited the summary to reflect this.
Alexander's suggestion seems good. It would be especially optimal if it was easy to change the default at the distro level so a distro could easily include Banshee but diverge here if it thought exiting on alt+f4 was more consistent.
Created attachment 138636 [details] [review] quit on close toggle button here is a patch to togle n notification area the behaviour of closing.
Thanks for the patch Olivier ! If we want this option, I don't think it should be in the tray icon context menu : the option is not related to notifications, it's about what happens when you close the main window. With the patch applied and the "quit on close" option enabled, when I close the main window by clicking on the X (not through the menu), I get the following exception : [Debug 17:11:58.375] Service disposed (PlayerEngine) [Debug 17:11:58.383] Service disposed (SourceManager) [Debug 17:11:58.385] Service disposed (DbConnection) Stacktrace: at (wrapper managed-to-native) Gtk.Widget.gtksharp_widget_base_delete_event (intptr,intptr) <0x00004> at (wrapper managed-to-native) Gtk.Widget.gtksharp_widget_base_delete_event (intptr,intptr) <0xffffffff> at Gtk.Widget.OnDeleteEvent (Gdk.Event) <0x00030> at Banshee.Gui.BaseClientWindow.OnDeleteEvent (Gdk.Event) [0x0002c] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs:145 at Gtk.Widget.deleteevent_cb (intptr,intptr) <0x0004f> at (wrapper native-to-managed) Gtk.Widget.deleteevent_cb (intptr,intptr) <0xffffffff> at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004> at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff> at Gtk.Application.Run () <0x00007> at Banshee.Gui.GtkBaseClient.Run () [0x00013] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:149 at Banshee.Gui.GtkBaseClient.Startup () [0x00000] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:74 at Hyena.Gui.CleanRoomStartup.Startup (Hyena.Gui.CleanRoomStartup/StartupInvocationHandler) [0x00048] in /home/lorentz/Projets/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54 at Banshee.Gui.GtkBaseClient.Startup () [0x00024] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:69 at Banshee.Gui.GtkBaseClient.Startup (string[]) [0x0004d] in /home/lorentz/Projets/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:59 at Nereid.Client.Main (string[]) [0x00000] in /home/lorentz/Projets/banshee/src/Clients/Nereid/Nereid/Client.cs:54 at (wrapper runtime-invoke) Nereid.Client.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff> followed by native stacktraces. Other minor nitpicks : - Space before ( in private void ToggleQuitOnClose( - Indent with spaces in NotificationAreaMenu.xml
Created attachment 138739 [details] [review] Fix exception and add option in main menu OK, I have put it in main menu just before Quit part. I fix the bug, it is because this part was never called before and we must not return base.onDeleteEvent(Evnt) but return false; to say that the windows can be destroyed.
Comment on attachment 138739 [details] [review] Fix exception and add option in main menu I'd prefer this be not in the main menus, but in Preferences, General tab, under Misc. It should also be tied to a SchemaEntry so it's saved in GConf.
Created attachment 173896 [details] [review] Add option to quit on close new patch with preference as requested
Review of attachment 173896 [details] [review]: ::: src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs @@ +380,3 @@ + + quit_on_close_preference = service["general"]["misc"].Add (new SchemaPreference<bool> (QuitOnCloseSchema, + Catalog.GetString ("_Quit On Close"), Checkboxes should use sentence capitalization; see http://library.gnome.org/devel/hig-book/stable/controls-check-boxes.html.en @@ +381,3 @@ + quit_on_close_preference = service["general"]["misc"].Add (new SchemaPreference<bool> (QuitOnCloseSchema, + Catalog.GetString ("_Quit On Close"), + Catalog.GetString ("Do not minimise in tray icon when quit"), default strings are en_US; change to 'minimize' @@ +383,3 @@ + Catalog.GetString ("Do not minimise in tray icon when quit"), + delegate { + if (QuitOnCloseSchema.Get ()) put curly braces around these if/else blocks
Created attachment 173931 [details] [review] Add a preference for quit on close
This is exactly the kind of thing where 'option' is the wrong choice, and we should make an opinionated choice. Frankly the hide in tray paradigm is broken, but a lot of people have gotten used to it none the less. The way I see this working best is X closes the Window, Minimize goes to the tray, just like normal window manager functions act. Hide in tray could be activated by clicking the notification area icon. Let's avoid adding more options, please.
Review of attachment 173931 [details] [review]: This patch itself is fine, but I think Alex's point is a good one and warrants more discussion before this would be committed.
When I said, "Minimize goes to the tray, just like normal window manager functions act", I meant goes to the window list be it Docky, Unity's Launcher, Gnome Panel, or whatever else.
After giving it some thought, I agree with Alex: it's WM's job, not Banshee's, to manage minimising, closing and hiding.
Banshee is not under active development anymore and had its last code changes more than three years ago. Its codebase has been archived. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is being shut down) if anyone takes the responsibility for active development again. See https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/264 for more info.