This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 2951 - TwoButtonPress Event not emitted
: TwoButtonPress Event not emitted
Status: REOPENED
Product: Gtk#
Classification: Mono
Component: gtk-sharp
: 2.x
: PC Windows
: --- normal
: ---
Assigned To: Duncan Mak
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-01-18 04:17 EST by Thomas Klose
Modified: 2013-08-29 03:54 EDT (History)
8 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments

Comment 1 Miguel de Icaza 2012-01-18 10:54:03 EST
Hello Thomas,

What is the version of Gtk# that you installed?

Does this happen with .NET and Gtk# as well, or only in Mono/Gtk#?
Comment 2 Thomas Klose 2012-01-19 03:52:45 EST
Hola Miguel.

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.
Comment 3 Thomas Klose 2012-01-19 03:54:22 EST
One additional comment: ThreeButtonPress events (triple-click) seem to be also
affected.
Comment 4 Thomas Klose 2012-01-19 03:55:50 EST
Did I make the original comment private? That was unintended.
Comment 5 Miguel de Icaza 2012-01-19 07:57:52 EST
What about .NET and Gtk# 2.11.11, which is the runtime that we suspect is
broken, could you try that?
Comment 6 Thomas Klose 2012-01-19 10:25:04 EST
.NET and Gtk# have the same problem: No TwoButtonPress or ThreeButtonPress
events.

The problem seems to be introduced in changes from Gtk# 2.12.10 to 2.12.11.
Comment 7 Michael Hutchinson 2012-01-20 17:53:53 EST
There is no Gtk# 2.12.11 package for .NET, how did you test it?
Comment 8 Thomas Klose 2012-01-21 06:56:29 EST
I copied the Gtk files from a current Mono installation (2.10.8) into the Gtk#
for .NET installation.
Comment 9 Thomas Klose 2012-01-21 06:57:50 EST
Good point, though. :)
Comment 10 Michael Hutchinson 2012-01-23 10:56:09 EST
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.
Comment 11 Thomas Klose 2012-01-23 11:46:39 EST
Okay. What does this mean for the bug?
Comment 12 Michael Hutchinson 2012-01-23 14:10:29 EST
It just helps track down where the problem is.

Can you reproduce the bug with GTK+ 2.24.8?

http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.8-20111122_win32.zip
Comment 13 Thomas Klose 2012-01-23 14:55:00 EST
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?
Comment 14 Michael Hutchinson 2012-01-23 16:22:42 EST
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.
Comment 15 Thomas Klose 2012-01-23 18:08:37 EST
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.
Comment 16 Michael Hutchinson 2012-01-24 14:45:21 EST
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
somewhat newer.

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.
Comment 17 Thomas Klose 2012-01-25 05:28:51 EST
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.
Comment 18 Thomas Klose 2012-04-03 07:41:51 EDT
The problem is still present in Mono 2.11 Alpha.
Comment 19 Miguel de Icaza 2012-04-03 13:32:13 EDT
Mono and Gtk# are two separate components, independent of each other.

So upgrading Mono wont have any effects on Gtk.
Comment 20 Michael Hutchinson 2012-04-03 13:37:32 EDT
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.
Comment 21 Thomas Klose 2012-04-03 16:43:10 EDT
Exactly. Regarding to Gtk# applications, Mono became virtually unusable on
Windows platform since 2.10.x.
Comment 22 Thomas Klose 2012-08-24 10:49:13 EDT
The problem is still present in Mono 2.11.3 Alpha
Comment 23 Michael Hutchinson 2012-09-29 16:24:41 EDT
*** Bug 7545 has been marked as a duplicate of this bug. ***
Comment 24 Thomas Klose 2012-11-09 06:32:02 EST
The problem is still present in Mono 3.0.1 Alpha!
Comment 25 Adam Czauderna 2013-05-02 15:32:51 EDT
Any follow up on this bug? GTK# still doesn't seem to emit TwoButtonPress event
on Windows.
Comment 26 Cody Russell 2013-08-27 15:16:24 EDT
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.
Comment 27 Thomas Klose 2013-08-28 07:28:42 EDT
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
WORKSFORME.
Comment 28 Cody Russell 2013-08-28 18:12:15 EDT
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
anymore.

It seems like maybe this is a packaging issue, that Mono for Windows is
shipping a very old gtk+ or gtk# build.
Comment 29 Thomas Klose 2013-08-29 03:54:25 EDT
It was my understanding that Mono had a more recent version than Gtk# for .NET
bundled.

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)

Note You need to log in before you can comment on or make changes to this bug.