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.