Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geany-plugin-addons systray icon feature request: alternate collapse window to icon options #1293

Open
kevjonesin opened this issue Nov 18, 2023 · 5 comments

Comments

@kevjonesin
Copy link

kevjonesin commented Nov 18, 2023

At present I'm able to collapse the Geany window to the systray icon via a left mouse click upon the systray icon itself.
Which on my system is located at the bottom of the screen in a tint2 panel running within MX Linux 23 FluxBox edition, a Debian based system.

I'd like to be able to collapse the window to the systray with a keyboard shortcut from within the active window. And/or from an icon or menu entry somewhere in the window. And/or, as I've seen implemented in other apps (most recently DeadBeef audio player), to have a toggle in preferences to allow closing the window to collapse it to the systray icon—instead of exiting the program. One then typically exits or "quits" the running instance via a menu entry upon right clicking the systray icon.

In the mean time, I'd welcome any presently applicable workaround suggestions folks might have.

The icon location within the tray is variable so using a click recorder app to invoke a replay of a click at its location via a shortcut triggered script or whatever would likely produce inconsistent results.

Might there be some way to fool the icon into thinking it's received a left click? Like to send a signal to trigger its function regardless of its precise location on screen?

p.s. – Perhaps this link to GTK info might help inspire someone more versed than I: https://www.geany.org/manual/gtk/gtk/GtkStatusIcon.html

@elextr
Copy link
Member

elextr commented Nov 18, 2023

  1. the gtk status icon is a notification, it doesn't control anything, and it was deprecated back in 3.14 and Geany needs 3.24
  2. the panel/systray icons are part of the window manager functionality, not under the control of the application, and controls like "iconify" are usually added to the window border by that.
  3. the most a GTK application can do is ask that the window be iconified, its up to the window manager to do it

Whilst anything can be coded if the WM supports it, there are lots of Linux WMs and Windows and Macos and Geany is not likely to include anything that needs specific code for each of those.

@kevjonesin
Copy link
Author

kevjonesin commented Nov 19, 2023

image

I'm referring to the Geany icon to the lower right beside the volume icon in the systray/notification area. The one enabled in the pictured Geany plugin settings. Not to the other Geany icon further left along the bottom panel amongst other running window icons. The Geany icon to the lower right—that has the mouse pointer over it prompting a tooltip that says "Geany"—is Geany specific and provided via the "addons" plugin. A right click on it brings up a small menu of Geany specific functions and a left click toggles the Geany window in a manner that prevents it from showing in taskbar amongst other running windows when collapsed. And then allows it, the still running Geany session, to show on whatever workspace one's on when the icon is clicked again.
https://plugins.geany.org/addons.html
https://plugins.geany.org/addons.html#systray

@elextr
Copy link
Member

elextr commented Nov 19, 2023

I'm referring to the Geany icon to the lower right beside the volume icon in the systray/notification area. The one enabled in the pictured Geany plugin settings. Not to the other Geany icon further left along the bottom panel amongst other running window icons.

Ok, thats clearer.

Lets go back to your OP.

collapse the Geany window to the systray icon via a left mouse click upon the systray icon

Depends what you mean by "collapse", the usual meaning is what the - on the title bar does, called iconifying. And the window icon (the left ones in your image) can usually be clicked to cycle iconify/deiconify, exactly the same effect as the status icon. But iconifying leaves the Geany window in the control of the window manager (WM). Technically what the plugin does is "hide" the Geany window, which removes it from the WM control, removes its window icon, won't show in window lists, is totally lost to all the normal system controls (not sure what happens on Wayland based systems). Personally I don't see what the point of replicating the WM functions in the status icon is, but anyway "somebody" could add a keybinding for that function.

And/or, as I've seen implemented in other apps (most recently DeadBeef audio player), to have a toggle in preferences to allow closing the window to collapse it to the systray icon—instead of exiting the program. One then typically exits or "quits" the running instance via a menu entry upon right clicking the systray icon.

The X in the title bar is usually handled by the WM, Geany does not generate those controls, the WM sends Geany a signal to quit. Many WMs then wait a while, and if the application hasn't quit it pops up a "Application not responding, do you want me to kill it?" type dialog. Clearly that is not compatible with iconifying but continuing the application. For systems where the X in the toolbar can be used as iconify the WM may require client side controls giving the application the ability to intercept and change the signal. But there are many different WMs and they work in many different ways, so its unlikely that a suitable implementation that will suit them all can be found, but of course if "somebody" found a way that worked on all WMs they could make a PR.

@kevjonesin
Copy link
Author

kevjonesin commented Nov 20, 2023

Yes, I think "hide" is the more proper/specific term. Thank you.

A "close to tray" option has been implemented in numerous existing apps that offer a systray/notification area status indicator icon. It's apparently done in a window manager agnostic fashion. I.e. I get the same toggle-able option with such apps regardless of whether I'm displaying them via xfce, fluxbox, enlightenment, &c. This isn't some new idea I've come up with, I've been coming across implementations of it for years in other apps.

As mentioned, I just recently saw (and used) such in the DeadBeef audio player. Here's a screenshot, taken just moments ago, of the same option being offered in the Audacious audio player as well:
image
(next to the mouse pointer)

This allows one to hide the Audacious window (while leaving it still running with the systray icon still in place and interactive) by simply using whatever "close window" keyboard shortcut has been enabled in whatever desktop environment one happens to be using. Or, with such enabled, one can click on the running app's close icon in its open window's title bar and get the same result.

So, getting back to Geany …
I'm proposing, in some future release, adding the (well established elsewhere) "close to tray" sub-option to the existing status icon option already included in the Addons plugin's preferences which are accessed via Geany's Plugins Manager.

And I'm also proposing, for some future release, a slightly new spin on such by speculating about allowing the same signal that left mouse clicking on the present implementation of the Geany systray icon sends to also be triggered by a user configurable keybinding offered alongside the existing Geany keybinding options. So that one could then use the keyboard to unhide as well as hide the window.

For the present, I'm wondering if anyone knows specifics about what signal is sent when left clicking on the current implementation of the Geany systray icon? And how one might emulate such via a script or something. Which I could then somehow set up to run via a keyboard shortcut. Using keybinding options native to my distro, rather than those configured within Geany.

@elextr
Copy link
Member

elextr commented Nov 20, 2023

Then "somebody" can copy the portable code from there, and make a PR also being sure its also handled/removed on Windows/macos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants