Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When context menus are shown near the left edge of the screen, they immediately hide again. The region in which is occurs seems to be dependent on the size of the menu.
This happens with the GTK+ shipped with Mono 2.10.6, and also with the current tip of the GTK 2.24 branch.
It happens with MD's menus and also with the GtkEntry built-in context menu:
By left edge, I mean top left corner.
I committed a workaround for the MD text editor and treeviews - trigger the context menu on ButtonRelease instead of ButtonPress. This workaround is controlled by a boolean variable so can easily be disabled dependent on GTK+ version when it's fixed upstream.
I just tried this in various places, a monodevelop built before you opened
this bug, current git testgtk and some places in gimp, and it never happens
to me. Even an artificial case where the entry is right at the top-left
corner of the screen works just fine.
Is this still happening to you? I'm on Lion here btw.
Yes, still reproducible with GtkEntry's menu: http://screencast.com/t/GvTijMVxcII
I can reproduce this with MonoDevelop and the Mono framework from May 7. It is indeed very flaky, because sometimes it does work correctly and sometimes it does not work in the same region. The immediate popdown is triggered by a button release event. gtk_menu_shell_button_release() does a bunch of checks to see whether the menu should NOT be deactivated, my guess is that one of these checks should succeed but not does.
I already verified the ignore_button_release handling in gtkmenu.c does not seem to be affecting the flaky menus.
Interesting, I cannot reproduce this within a gtk+ test program; so I will do a full build of the Mono framework with debugging symbols on my machine to help in debugging this issue. (I need such a build anyway to see if it helps in getting a grip on the resolver crashes of which the cause still has not been found).
I now understand why I could not reproduce this with a standard GTK+ test program: the bug only appears if you use a theme *different* from the default theme. When I run the standard GTK+ test program with a different theme, the bug does show up.
The bug appears because an EnterNotify event is erroneously created. This happens because the quartz backend was under the impression that a window is first placed at the top left corner before it is moved to its actual position. The EnterNotify event is only created when the mouse pointer is detected to be inside the area where a window just popped up.
So this explains why the bug only occurs in the top left corner; the window is thought to appear in this area first.
The real problem is that the EnterNotify event should never be emitted, because the window never appears in the top left corner first. What happened is the following:
1. In gtk_window_realize() a new window is created. This triggered the logic in GdkQuartzView updateTrackingRect: to emit an EnterNotify event.
2. In gtk_window_show(), the correct position is set on the window.
So, in fact, the EnterNotify event is emitted too early, when the real position of the window is not yet known. The EnterNotify logic was introduced in:
Author: Kristian Rietveld <email@example.com>
Date: Sun Jan 3 15:27:53 2010 +0100
Improve enter/motion notify semantics
The proposed solution is to delay the emission of this event to the first time the window size is set. We will rely on the fact that either the windowDidMove: or windowDidResize delegates are called after creating a new window to set the initial size. This seems to be the case.
Patch is forthcoming.
Created attachment 2014 [details]
patch resolving the issue
The patch. After this got some testing we will definitely upstream it.
For completeness sake: the differences between the usage of different themes can likely be explained by the fact that the menu items are sized differently. This changes the deactivate behavior in gtk_menu_shell_button_release().
Landed in bockbuild, thanks!
Upstreamed in gtk-2-24.
Thanks, replaced the patch in bockbuild with the git version and confirmed the fix with our theme.
*** Bug 6055 has been marked as a duplicate of this bug. ***
*** Bug 3259 has been marked as a duplicate of this bug. ***
We have verified this issue with the latest builds:
MD 4.0 - db3ef976e04673c4dc1cdb3b8901753ef462c429
This issue does not exists.