After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656288 - enter/leave-notify-event thrown when it should not
enter/leave-notify-event thrown when it should not
Status: RESOLVED INVALID
Product: vala
Classification: Core
Component: Bindings: GTK+ GStreamer WebKitGTK+
0.13.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-10 15:11 UTC by Valentín Barros
Modified: 2012-01-22 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
C sample (1.95 KB, application/x-gzip)
2011-08-10 15:13 UTC, Valentín Barros
Details
Vala sample with Cairo (1.21 KB, application/x-gzip)
2011-08-10 15:13 UTC, Valentín Barros
Details
Vala sample without Cairo (700 bytes, application/x-gzip)
2011-08-10 15:14 UTC, Valentín Barros
Details

Description Valentín Barros 2011-08-10 15:11:27 UTC
Hi!

I've found the bug while developing a new tool for Shotwell. The thing is that in Unity, Vala GTK+ programs throws enter/leave-notify-event when you click in a Gtk.DrawingArea.

Although I've corrected the wrong behavior in Shotwell [1], I've continued investigating the problems with leave_notify_event and Unity and I'm getting weird behavior :S I attach two test cases I've created modifying Cairo-with-GTK+ examples using both Vala and C. Vala original program is at [2] and the C one is in one CVS repository at [3]. I've also prepared a without-Cairo version which has the same behavior.

Let me explain that I found:

[NOTE] By non-Unity I mean a Linux Mint 10 system with Gnome 2.32.0 and no Unity; by Unity I mean an Ubuntu Natty system with Gnome 2.32.1 and Unity, running in a VirtualBox virtual machine. Vala version is 0.12 (but I also tested the non-Unity test case with Vala 0.13.1.107-9b5a with the same behavior).

    * With C sample & Unity system -> If the program has a transient window, you'll get enter_notify_event and leave_notify_event each time you click the DrawingArea. If not, all works fine.
    * With C sample & non-Unity system -> All works fine.
    * With Vala sample & Unity system -> If the program has a transient window, you'll get enter_notify_event and leave_notify event each time you click the DrawingArea. If not, you'll only get enter_notify_event :S
    * With Vala sample & non-Unity system -> You'll get enter_notify_event, no matter if the program has the transient window or not.

So, as you can see, this looks like an error in Unity, but the thing is that I've added a new system to the tests: Ubuntu 11.10 Alpha 3 with Gnome 3.1.4, with Unity but without 3D effects (VirtualBox, I'm not able to get 3D effects work); and in this system I see the problem with enter_notify_event but not the one with leave_notify_event, no matter if the transient window is present or not --so, it acts the same like in non-Unity systems. It seems that they've changed something in Unity that suppressed the leave_notify_event error in Ubuntu Oneiric, and the enter_notify_event is also present in a non-Unity system as I report above, so... it seems to be a Vala bug --I'm discarding Compiz because I have no 3D effects working in my Ubuntu Oneiric virtual machine.

What do you think about this?

[1] http://redmine.yorba.org/issues/3896
[2] http://live.gnome.org/Vala/CairoSample
[3] http://webcvs.cairographics.org/cairo-demo/gtk/
Comment 1 Valentín Barros 2011-08-10 15:13:06 UTC
Created attachment 193562 [details]
C sample
Comment 2 Valentín Barros 2011-08-10 15:13:38 UTC
Created attachment 193563 [details]
Vala sample with Cairo
Comment 3 Valentín Barros 2011-08-10 15:14:07 UTC
Created attachment 193564 [details]
Vala sample without Cairo
Comment 4 Maciej (Matthew) Piechotka 2011-08-10 15:28:39 UTC
1. Please send just files instead of tarballs
2. Please structure code in the same way if possible. It allows to easly compare the generated code with C sample
3. gtk_widget_add_events and drawing_area.add_events have different masks to begin with.
4. Vala produces nearly 1-1 translation to C so it should not 'surpress' events in any way. Compare code generated by Vala and the one from C.
Comment 5 Valentín Barros 2011-08-10 15:29:54 UTC
Reported also to: https://bugs.launchpad.net/unity/+bug/824013
Comment 6 Valentín Barros 2011-08-11 10:13:34 UTC
(In reply to comment #4)
> 1. Please send just files instead of tarballs
> 2. Please structure code in the same way if possible. It allows to easly
> compare the generated code with C sample
> 3. gtk_widget_add_events and drawing_area.add_events have different masks to
> begin with.

You are more than right. I've continued playing with it and simply adding Gdk.EventMask.BUTTON_PRESS_MASK suppresses the wrong behavior in Vala version, and not adding GDK_BUTTON_PRESS_MASK enables the problem in C version. So, bug in GTK+? I've continued searching and I've found an unconfirmed bug with the same thing reported more than two years ago: https://bugzilla.gnome.org/show_bug.cgi?id=556006

I'm going to test it better first and I'll attach my C test case (simplified without Cairo stuff) to there.

> 4. Vala produces nearly 1-1 translation to C so it should not 'surpress' events
> in any way. Compare code generated by Vala and the one from C.
Comment 7 Evan Nemerson 2012-01-22 08:15:38 UTC
I'm closing since it seems like a problem with GTK+ (or possibly Unity), not Vala, but please reopen if this turns out not to be the case.