cannot close indicators with a click unless the cursor is moved

Bug #591660 reported by Omer Akram
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Unity
In Progress
Medium
Jay Taoko
unity (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Unity: 0.2.7

Click on the messaging menu (or any other indicator) now again click on it without moving the cursor. the menu wont close with the click. Now if the cursor is moved a very little bit and then clicking the indicator will close the menu.

Neil J. Patel (njpatel)
Changed in unity:
assignee: nobody → Jay Taoko (jaytaoko)
importance: Undecided → Medium
milestone: none → 0.2.10
Jay Taoko (jaytaoko)
Changed in unity:
status: New → In Progress
Neil J. Patel (njpatel)
Changed in unity:
milestone: 2010-06-17 → 2010-06-24
Revision history for this message
Jay Taoko (jaytaoko) wrote :

I noticed that version 1.2.8 of Clutter seems to break the way the
indicators behave. With that version of Clutter, indicators cannot be
close after they are open, unless the mouse is clicked outside of the
panel area... Scrubbing of indicators also don't work.

Also, compiling version 1.2.4 of Clutter an using it on my system, I
cannot reproduce the bug... However, Clutter 1.2.4
seems to be the official version in the Lucid repository. So this
reminds me of another bug we had. The bug would not couldn't be
reproduced if Clutter was compiled manually on the system. But the
official version was exhibiting the bug...

Revision history for this message
Jay Taoko (jaytaoko) wrote :

There may not be a problem after all... Some mixup of libraries were confusing the problem...

Revision history for this message
Jay Taoko (jaytaoko) wrote :

We have a fix in clutter 1.2.4 for this bug. What we do is intercept the Leave event that is received when the Menu shows up. Then we check an environment variable to decide if we are going to going to apply the workaround or not. If the environment variable is set, then we check if the mouse is still inside the Clutter window. If yes, we ignore the leave event...

Revision history for this message
Jay Taoko (jaytaoko) wrote :

The patch:

--- clutter/x11/clutter-event-x11.c 2010-03-18 13:18:06.000000000 -0400
+++ clutter/x11/clutter-event-x11.c 2010-06-18 13:05:09.243912688 -0400
@@ -816,6 +816,22 @@
               goto out;
             }

+ if (g_getenv ("CLUTTER_CHECK_LEAVE_EVENTS"))
+ {
+ Window root_return;
+ gint x, y;
+ guint width, height, border, depth;
+
+ XGetGeometry (backend_x11->xdpy, xwindow, &root_return, &x, &y, &width, &height, &border, &depth);
+
+ if ((xevent->xcrossing.x >= x) && (xevent->xcrossing.x < x+width) && (xevent->xcrossing.y >= y) && (xevent->xcrossing.y < y+height))
+ {
+ CLUTTER_NOTE(EVENT, "Discarding Leave Event");
+ res = FALSE;
+ goto out;
+ }
+ }
+
           /* we know that we are leaving the stage here */
           _clutter_input_device_set_stage (device, NULL);
           CLUTTER_NOTE (EVENT, "Leaving the stage (time:%u)",

Revision history for this message
Jay Taoko (jaytaoko) wrote :

A better patch has been produced. It has been submitted to clutter upstream. If the patch is accepted, it should be fixed for Maverick.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2148

--- clutter/x11/clutter-event-x11.c 2010-03-18 13:18:06.000000000 -0400
+++ clutter/x11/clutter-event-x11.c 2010-06-21 16:11:10.468517306 -0400
@@ -816,6 +816,28 @@
               goto out;
             }

+ Window child_return, root_return;
+ int root_x_return, root_y_return;
+ int win_x_return, win_y_return;
+ unsigned int mask_return;
+
+ gboolean ret = XQueryPointer(backend_x11->xdpy, xwindow, &root_return, &child_return, &root_x_return, &root_y_return, &win_x_return, &win_y_return, &mask_return);
+ if (ret && (child_return==None))
+ {
+ /* The mouse is directly over the stage (no obstructing window) */
+ gint x, y;
+ guint width, height, border, depth;
+ XGetGeometry (backend_x11->xdpy, xwindow, &root_return, &x, &y, &width, &height, &border, &depth);
+
+ if ((xevent->xcrossing.x >= x) && (xevent->xcrossing.x < x+width) && (xevent->xcrossing.y >= y) && (xevent->xcrossing.y < y+height))
+ {
+ /* The mouse is still inside the stage. Discard the Leave event. */
+ CLUTTER_NOTE(EVENT, "Discarding Leave Event");
+ res = FALSE;
+ goto out;
+ }
+ }
+
           /* we know that we are leaving the stage here */
           _clutter_input_device_set_stage (device, NULL);
           CLUTTER_NOTE (EVENT, "Leaving the stage (time:%u)",

Changed in unity:
status: In Progress → Fix Committed
Neil J. Patel (njpatel)
Changed in unity:
status: Fix Committed → Fix Released
Jay Taoko (jaytaoko)
Changed in unity:
status: Fix Released → In Progress
Changed in unity:
milestone: 2010-06-24 → 2010-07-01
Changed in unity (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
Mirco Müller (macslow)
Changed in unity:
milestone: 2010-07-01 → 2010-07-08
Omer Akram (om26er)
Changed in unity (Ubuntu):
status: In Progress → Triaged
Neil J. Patel (njpatel)
Changed in unity:
milestone: 2010-07-08 → 2010-07-15
Revision history for this message
Omer Akram (om26er) wrote :

I build clutter with this patch and the menu closes as soon as the click is released. in other words menu cannot be opened with a single click. you have to hold it down

Revision history for this message
Hernando Torque (htorque) wrote :

Yes, I've seen the same when trying the patch in bug 598288 (the "opposite" of this one).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.