GNOME Bugzilla – Bug 594835
dialogs become unresponsive when clicking on region not subscribed to button-release
Last modified: 2009-09-16 06:54:40 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.
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.
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.
(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;
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).