Ubuntu managed to make the menu bar in Unity 2D break with VNC some time between 11.04 and 11.10. When you click a menu entry (or the widgets) it will open on mouse press, but close again on mouse release. The expected behaviour is to remain open after the mouse release.
The package is called unity-2d-panel and the version in 11.04 is 22.214.171.124-0ubuntu1 and the one in 11.10 is 4.12.0-0ubuntu1.1.
Also more here:
Test if it still is a bug in 12.04. File an upstream bug report if it is.
Also check if this occurs with an Ubuntu Xvnc and report it if it does.
See https://bugs.launchpad.net/ubuntu/+source/unity-2d/+bug/866046. FWIW.
The core of this issue seems to be XInput2 vs Core events. What I've determined so far:
- Both working and non-working cases send a ButtonRelease/XI_ButtonRelease to the GTK process. So Xorg and Xvnc both behave as expected.
- A GDK event is only generated with Xvnc (i.e. Core event), not with Xorg (XInput2 event)
It seems like the XInput2 event is lost inside XFilterEvent(). IOW, it seems like a bug in Xlib/xcb.
Scratch that. gdb wasn't tracing properly. It is GDK that is filtering things somewhere in gdk_event_apply_filters().
Lolbuntu's enterprise engineering strikes again!
Because of their quality architecture of having three processes to display a single menu, the proper behaviour is the one we're seeing in VNC (the button is released on the panel, which is technically outside the menu, so the menu should close).
To work around this, they have some horrible kludges implemented as GDK event filters. And last year some buffoon ripped out the X11 Core event code and replaced it with XInput2 code. This with the fantastic commit message "Fix the panel-service".
So either we grow XInput2 support, or Ubuntu fixes their shitty code. I don't see anyway we can work around this.
Aaron gets the privilege to report this in Launchpad since he has an account. The bug is in service/panel-service.c:event_filter(), and the issue is the lack of support for X11 Core events.
We cannot do anything about this right now. Moving the bug to the next release so we can keep track of upstream.
As a side note, besides adding yourself as a subscriber in launchpad, you should click on "Affects me". The latter adds 4 points to the "heat", while subscribing only adds 2 points.
Our new Xvnc has Xinput2 and does indeed solve this problem.
Works for me too.