Bugzilla – Bug 2951
TwoButtonPress Event not emitted
Last modified: 2013-08-29 03:54:25 EDT
What is the version of Gtk# that you installed?
Does this happen with .NET and Gtk# as well, or only in Mono/Gtk#?
I use Gtk# versions which are shipped with the Mono versions respectively:
Mono 2.6.7: Gtk# 2.12.10-win32-2
Mono 2.10.8: Gtk# 2.12.11-win32-1
With .NET and current Gtk# 2.12.10 this is not an issue. Double-click events
are emitted just fine.
One additional comment: ThreeButtonPress events (triple-click) seem to be also
Did I make the original comment private? That was unintended.
What about .NET and Gtk# 2.11.11, which is the runtime that we suspect is
broken, could you try that?
.NET and Gtk# have the same problem: No TwoButtonPress or ThreeButtonPress
The problem seems to be introduced in changes from Gtk# 2.12.10 to 2.12.11.
There is no Gtk# 2.12.11 package for .NET, how did you test it?
I copied the Gtk files from a current Mono installation (2.10.8) into the Gtk#
for .NET installation.
Good point, though. :)
It sounds like you got the GTK+ from Mono, not the GTK#. GTK# would be in the
GAC. SO the bug is likely in the GTK+ version shipped by Mono.
Okay. What does this mean for the bug?
It just helps track down where the problem is.
Can you reproduce the bug with GTK+ 2.24.8?
It was my understanding that Gtk# bases on GTK+ 2.12. What would it help to
know if the bug is still present with GTK+ 2.24?
Is it even possible to use Gtk# with GTK+ 2.24?
GTK# is a binding to the GTK+ 2.12 API, however GTK+ 2.x is backwards
compatible so GTK# can run on top of newer GTK+ versions.
Does this mean, Gtk# 2.12.11 bases on current (or recent) GTK+?
If not, I am missing the point. Why should it matter if the problem occurs with
a version years, and thousands of changes away from the last working one.
GTK+ is the actual GUI toolkit, implemented in native code. It has very
frequent new versions and bugfix releases.
GTK# is a managed wrapper over GTK+, i.e. a set of wrapper classes that call
through via P/Invoke to GTK+ API. The GTK# API was intentionally frozen against
the GTK+ 2.12 API so that developers would have a stable API target. However,
GTK# has received many internal fixes to the wrapper since then - that's what
the 2.12.1, 2.12.2, etc. are.
Since GTK# is a wrapper over GTK+, and GTK+ has a backwards-compatible API, you
can use GTK# with any GTK 2.x where x is >= 12. You will get the bugfixes from
the newer GTK+ version, though obviously you won't be able to access the newer
features because the wrapper has not been extended. I know this versioning is
confusing but there's not much be can do about it at this point.
The GTK# for .NET 2.12.10 installer includes GTK+ 2.16.0. I don't know what
version of GTK+ was included in Mono 2.10.8 on WIndows, but I suspect it was
The situation with GTK+ on Windows is complicated. The GTK+ 2.18 release
included a substantial internal change (client side windows) which
substantially regressed GTK+ on Windows, and for a long time the GTK+
developers recommended using GTK+ 2.16.x on Windows, which is why we shipped
2.16 in GTK# for .NET. Now GTK+ 2.24.8 is supposedly better than 2.16.x at
last, so we're evaluating including it in the next GTK# for .NET installer.
That is very interesting! Does that mean, I could use new functions like
Hyperlinks in Pango-Markups with Gtk# 2.12? (New functionality that does not
break the API.)
However, I tested the example "TwoButtonPress.cs" with Gtk 2.24.8. It seems to
work with .NET as well as with Mono 2.10.8. For this test I integrated the Gtk
2.24.8 files into the "GtkSharp\2.12", and the "Mono-2.10.8" directories
respectively. Both double-click and tripple-click are working again.
It seems, you were right: It looks like a problem in native Gtk.
The problem is still present in Mono 2.11 Alpha.
Mono and Gtk# are two separate components, independent of each other.
So upgrading Mono wont have any effects on Gtk.
Miguel, this is specifically about a bug in the version of GTK+ shipped in
Mono. The GTK+ version in GTK# for .NET does not have this problem.
Exactly. Regarding to Gtk# applications, Mono became virtually unusable on
Windows platform since 2.10.x.
The problem is still present in Mono 2.11.3 Alpha
*** Bug 7545 has been marked as a duplicate of this bug. ***
The problem is still present in Mono 3.0.1 Alpha!
Any follow up on this bug? GTK# still doesn't seem to emit TwoButtonPress event
I just tested this using the version of gtk# that's available for download from
the Mono website right now. Building in Xamarin Studio the sample code
provided above it worked just fine.
I am sorry. It is not that easy. As written in the bug description above, the
problems occur with Mono for Windows and the Gtk# version bundled with it.
This problem is still relevant for all Mono installers available for Windows.
If you don't want to fix it, because Windows is not supported as Mono platform,
please say so. In this case the final bug state should be WONTFIX, not
I guess I was confused because this bug is assigned to the gtk-sharp component,
and it's apparently not a bug in either gtk+ or in gtk#. Or at least it's not
It seems like maybe this is a packaging issue, that Mono for Windows is
shipping a very old gtk+ or gtk# build.
It was my understanding that Mono had a more recent version than Gtk# for .NET
This newer version fixed serveral bugs in Gtk#. However, it also introduced at
least one major problem: No double and tripple click events.
More recent versions of Gtk don't show this problems. I testet Gtk 2.22 as well
as Gtk 2.24., which is the current stable Gtk version for Win32. The latter
shows serious other problems. So my recommendation would be Gtk 2.22. The same
applies probably to Gtk# for .NET which is currently shipped with Gtk 2.16(?)
While we at it: What are the plans regarding Mono for Windows? I mean Gtk# for
.NET does *not* replace it completely. (For example missing Mono.Posix)