button = (grabbed_buttons & ~buttons);
grabbed_buttons = buttons;
- if (!grabbed_buttons && wait_for_release_message)
+ if (wait_for_release_message)
{
- wait_for_release_message->SendReply (wait_for_release_message);
- delete wait_for_release_message;
- wait_for_release_message = NULL;
+ if (!grabbed_buttons)
+ {
+ wait_for_release_message->SendReply (wait_for_release_message);
+ delete wait_for_release_message;
+ wait_for_release_message = NULL;
+ }
return;
}
return true;
}
+
+/* Clear the grab view. This has to be called manually from some
+ places, since we don't get B_MOUSE_UP messages after a popup menu
+ is run. */
+
+void
+be_clear_grab_view (void)
+{
+ if (grab_view_locker.Lock ())
+ {
+ grab_view = NULL;
+ grab_view_locker.Unlock ();
+ }
+}
extern void be_lock_window (void *);
extern void be_unlock_window (void *);
extern bool be_get_explicit_workarea (int *, int *, int *, int *);
+extern void be_clear_grab_view (void);
#ifdef __cplusplus
}
FRAME_DISPLAY_INFO (f)->grabbed = 0;
+ /* Clear the grab view manually. There is a race condition here if
+ the window thread receives a button press between here and the
+ end of BMenu_run. */
+ be_clear_grab_view ();
+
if (menu_item_selection)
{
prefix = entry = Qnil;