don't keep trying pointer grab when failing due to another application's grab b=500081 r=roc

--HG--
extra : transplant_source : %7E%40%C7%DD1%D9%D7%A2%8Dg%5E%8BG%A9J%3DK%0F%8B%FF
This commit is contained in:
Karl Tomlinson 2012-02-02 15:11:44 +13:00
parent 22f1f04c6b
commit 5011a85d42

View File

@ -4913,9 +4913,15 @@ nsWindow::GrabPointer(void)
GDK_POINTER_MOTION_MASK),
(GdkWindow *)NULL, NULL, GDK_CURRENT_TIME);
if (retval != GDK_GRAB_SUCCESS) {
LOG(("GrabPointer: pointer grab failed\n"));
if (retval == GDK_GRAB_NOT_VIEWABLE) {
LOG(("GrabPointer: window not viewable; will retry\n"));
mRetryPointerGrab = true;
} else if (retval != GDK_GRAB_SUCCESS) {
LOG(("GrabPointer: pointer grab failed: %i\n", retval));
// A failed grab indicates that another app has grabbed the pointer.
// Check for rollup now, because, without the grab, we likely won't
// get subsequent button press events.
check_for_rollup(0, 0, false, true);
}
}