After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 377416 - gtk menu that is popped up using StatusIcon API should popdown when user clicks somewhere outside of menu
gtk menu that is popped up using StatusIcon API should popdown when user clic...
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
2.10.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
: 578070 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-20 15:18 UTC by Nikos Kouremenos
Modified: 2014-08-30 05:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
demo so you can reproduce. (464 bytes, text/x-python)
2006-11-20 15:18 UTC, Nikos Kouremenos
Details

Description Nikos Kouremenos 2006-11-20 15:18:26 UTC
In your tray area, right click one application you have. You see a menu, then click on the desktop. You see that menu gets hidden (popped down).

Now run the sample, notice how Hi remains on the top right no matter what (you have to click the menuitem to get it to disappear!)
Comment 1 Nikos Kouremenos 2006-11-20 15:18:57 UTC
Created attachment 76916 [details]
demo so you can reproduce.
Comment 2 Peter Zelezny 2006-12-15 06:28:19 UTC
I guess we need to intercept clicks to non-GTK windows (i.e the Desktop).
Maybe a focus-out event is enough?
Comment 3 Tor Lillqvist 2007-01-07 03:42:39 UTC
I am not sure that any such the process will receive any such messages corresponding to focus-out. I would be loved to be proved wrong, though. As always, patches welcome.
Comment 4 Nikos Kouremenos 2007-01-07 11:13:16 UTC
I'm not a Windows API expert, but I could imagine something like this: "register to catching any click. get X, Y and see if those coordinates belong outside the menu". Since all other libraries do it, maybe it is somehow easy to find.
Comment 5 Tor Lillqvist 2007-02-17 09:02:24 UTC
Which other libraries do what?
Comment 6 Nikos Kouremenos 2007-02-17 10:12:39 UTC
qt (open source for windows) provides an API that does all the trayicon functionality correctly.
Comment 7 Tor Lillqvist 2008-11-05 12:43:42 UTC
Anybody, feel free to have a look at the Qt sources then and work on a patch to make it work in GTK+ too.
Comment 8 Mike Baker 2008-11-07 12:41:09 UTC
gtkmm-2.14
win32
visual studio 2008 (c++)

I ran into this exact bug the other day trying to do a quick demo with c++/gtkmm on win32, similar code path to the python example already posted; nothing short of clicking on a menu item makes the menu popdown. The menu also doesn't respond to the arrow keys, making me wonder if there's an underlying focus issue -- the same code under linux handles the arrow keys and does a popdown automatically when the menu loses focus.
Comment 9 Tor Lillqvist 2008-11-24 17:34:34 UTC
The X11 and Win32 implementations of the status icon API are very different, so it isn't any wonder that they work differently.
Comment 10 Sandy Armstrong 2009-04-06 03:37:01 UTC
*** Bug 578070 has been marked as a duplicate of this bug. ***
Comment 11 Sandy Armstrong 2009-04-06 03:39:44 UTC
Is there any reason to leave this UNCONFIRMED still, with so many confirmations of the problem?  I'm tempted to change it to NEW but am not familiar with the GTK+ team's bug practices.
Comment 12 Christian Dywan 2009-04-06 08:34:13 UTC
UNCONFIRMED and NEW have pretty much the same meaning for GTK+ bugs.
Comment 13 LRN 2009-12-03 22:43:33 UTC
Changing popup menus from WS_POPUP to WS_OVERLAPPED (and undecorating it, of course) completely solved the focusing problem (overlapped popup receives keyboard focus as intended) and partially solved the problem of the popup staying opened (overlapped popup DOES react when user clicks outside of it, but at the moment i am unable to harness this reaction and turn it into the window being popped down; also somewhere something keeps sending it SW_SHOWWINDOW with wParam=0, effectively closing the window, to circumvent that i had to stop propagation of the grab-broken-event).
Comment 14 Jim Duchek 2010-01-12 07:22:29 UTC
It's definitely some sort of focusing/activation issue, things work correctly on x11.  I have also noticed that if you click on the menu somewhere that won't cause the menu to close (say, a seperator), you can then click on the desktop and the menu will correctly go away.  Keyboard shortcuts are still non-functional though.
Comment 15 Matthias Clasen 2014-08-30 05:20:18 UTC
GtkStatusIcon has been deprecated