As the subject line says, this is a small patch that makes Geany to
minimize itself into the system tray. It has been tested on Linux/KDE
and on Windows XP. One downside, it requires at least GTK 2.10. (Tested
on 2.12/2.14). The code has GTK version checks so it should not break
anything for GTK 2.6 (I haven't tested this though).
I've no idea whether this is useful at all to Geany users other than me.
First I thought I keep this to my self but after chatting a bit with
Frank, I decided to post this. So please feel free to tell me how stupid
(or great) this functionality is for Geany :-)
On Linux, I previously used alltray to dock/minimize Geany to tray, but
on Windows, I had nothing which could do it. Then I checked the GTK docs
and realised that I could do it with GTK/GDK. And no platform specific
What the patch does:
- Adds a checkbox to Preferences->General->Miscellaneous, default is OFF
- Adds two callback functions for window/tray handling to main.c (This
is probably a wrong place for these but I didn't know where to put them)
Following files are modified: src/interface.c, src/prefs.c, src/prefs.h,
src/keyfile.c, src/main.c, geany.glade
What user sees: If user has GTK >=2.10, user sees a system tray icon
with a tooltip saying 'Geany'. If the option 'Always minimize to system
tray' is not checked, clicking the icon doesn't do anything.
If the option is checked, then clicking the icon will minimize Geany and
hide it from the window manager. Clicking a second time brings Geany up
and sets the focus on it. When the option is checked, Geany will also
minimize to system tray if the minimize button is pressed from the
I'm sure you'll find some things from the code that are not done 'the
right way', but I'm not very familiar with the inner workings of GTK so
I hope you forgive me :-)
If you don't want to include tray-functionality into Geany, that's okay.
I just wanted to post this so I could get some feedback. I intent to use
it myself, because I find it useful to be able to minimize Geany into
the system tray. And in the future, I think I add a popup menu to the
tray where I can do some useful things. (I have no idea at the moment
what they would be :-)
The patch is made against SVN r2263.