Bug 2951 - TwoButtonPress Event not emitted
Summary: TwoButtonPress Event not emitted
Status: REOPENED
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp (show other bugs)
Version: 2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Duncan Mak
URL:
: 7545 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-18 04:17 UTC by Thomas Klose
Modified: 2013-08-29 03:54 UTC (History)
8 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 for Bug 2951 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
REOPENED

Comment 1 Miguel de Icaza [MSFT] 2012-01-18 10:54:03 UTC
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 UTC
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 UTC
One additional comment: ThreeButtonPress events (triple-click) seem to be also affected.
Comment 4 Thomas Klose 2012-01-19 03:55:50 UTC
Did I make the original comment private? That was unintended.
Comment 5 Miguel de Icaza [MSFT] 2012-01-19 07:57:52 UTC
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 UTC
.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 Mikayla Hutchinson [MSFT] 2012-01-20 17:53:53 UTC
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 UTC
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 UTC
Good point, though. :)
Comment 10 Mikayla Hutchinson [MSFT] 2012-01-23 10:56:09 UTC
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 UTC
Okay. What does this mean for the bug?
Comment 12 Mikayla Hutchinson [MSFT] 2012-01-23 14:10:29 UTC
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 UTC
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 Mikayla Hutchinson [MSFT] 2012-01-23 16:22:42 UTC
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 UTC
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 Mikayla Hutchinson [MSFT] 2012-01-24 14:45:21 UTC
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 UTC
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 UTC
The problem is still present in Mono 2.11 Alpha.
Comment 19 Miguel de Icaza [MSFT] 2012-04-03 13:32:13 UTC
Mono and Gtk# are two separate components, independent of each other.

So upgrading Mono wont have any effects on Gtk.
Comment 20 Mikayla Hutchinson [MSFT] 2012-04-03 13:37:32 UTC
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 UTC
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 UTC
The problem is still present in Mono 2.11.3 Alpha
Comment 23 Mikayla Hutchinson [MSFT] 2012-09-29 16:24:41 UTC
*** Bug 7545 has been marked as a duplicate of this bug. ***
Comment 24 Thomas Klose 2012-11-09 06:32:02 UTC
The problem is still present in Mono 3.0.1 Alpha!
Comment 25 Adam Czauderna 2013-05-02 15:32:51 UTC
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 UTC
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 UTC
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 UTC
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 UTC
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)