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 594835 - dialogs become unresponsive when clicking on region not subscribed to button-release
dialogs become unresponsive when clicking on region not subscribed to button-...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
2.17.x
Other All
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-09-11 06:29 UTC by Christian Hergert
Modified: 2009-09-16 06:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix bug where a grab would not be released causing future events to be ignored. (1.07 KB, application/octet-stream)
2009-09-11 06:29 UTC, Christian Hergert
  Details
Handle resize events explicitly (2.21 KB, patch)
2009-09-11 11:18 UTC, Christian Hergert
none Details | Review

Description Christian Hergert 2009-09-11 06:29:45 UTC
Created attachment 142955 [details]
Fix bug where a grab would not be released causing future events to be ignored.

On many dialogs in MonoDevelop, we were seeing an issue where when clicking on
a region of the window that was not subscribed to button-press/release events
(such as a GtkLabel), the window would immediately go unresponsive to future
mouse events.

It seems that the grab would be started, but never released.  Therefore future
button-press events were simply ignored.

The attached patch fixes the issue by removing what I believe is some dead
code.
Comment 1 Christian Hergert 2009-09-11 09:23:48 UTC
Actually this breaks window resizing a bit for what are probably obvious reasons.  So we got to be a bit smarter in how this gets done.
Comment 2 Christian Hergert 2009-09-11 11:18:00 UTC
Created attachment 142972 [details] [review]
Handle resize events explicitly

So the other patch probably is valid.

Currently, resizing works on "accident" it seems (I may be wrong).  With the other patch resizing will no longer work because all events will get swallowed.  That is probably why there was a FIXME for ignoring events that should be passed to cocoa.

This patch goes ahead and does that by ignoring the events in the lower 15x15 area for the resize grip.

I expect this would be somewhat contravercial because applications can potentially place widgets in this area.  At the heart it is an integration issue and I alone do not have the right answer.
Comment 3 Kristian Rietveld 2009-09-15 14:03:34 UTC
(In reply to comment #0)
> Created an attachment (id=142955) [details]
> Fix bug where a grab would not be released causing future events to be ignored.
> 
> On many dialogs in MonoDevelop, we were seeing an issue where when clicking on
> a region of the window that was not subscribed to button-press/release events
> (such as a GtkLabel), the window would immediately go unresponsive to future
> mouse events.
> 
> It seems that the grab would be started, but never released.  Therefore future
> button-press events were simply ignored.
> 
> The attached patch fixes the issue by removing what I believe is some dead
> code.

This is actually the "other issue" I mentioned in bug 594738.  (I am hacking on the Mac backend from a conference here and we do not have proper Internet, so could not look at all the bugs).  What the attached patches removes is not dead code, and has to stay.  It is there for making the pointer grab semantics work correctly.  However, the current if-statement is missing a check for the implicit-state of a grab.

I have committed the following fix that I will push soon.  When pushed I will mark this bug as resolved:

          {
-           if ((grab->event_mask & get_event_mask_from_ns_event (nsevent)) == 0
+            /* Implicit grabs do not go through XGrabPointer and thus the
+             * event mask should not be checked.
+             */
+           if (!grab->implicit
+                && (grab->event_mask & get_event_mask_from_ns_event (nsevent)) 
               return NULL;
Comment 4 Kristian Rietveld 2009-09-16 06:54:40 UTC
Pushed.  Lets discuss resizing in 517394, it has always been a difficult area.  The patch that I have committed does not touch resizing, it was also impossible before the patch (but it works fine on non-activate windows).