Skip to content

Commit

Permalink
Grab cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Jan 27, 2022
1 parent 7d96910 commit 8c32ad4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions xlib/Drawables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ XWindow::set_protocols(Atom* protocols, int count)
void
XWindow::grab_pointer(long mask)
{
if (sPointerGrabWindow != NULL)
debugger("pointer already grabbed");

sPointerGrabWindow = this;

LockLooper();
Expand All @@ -498,13 +501,14 @@ XWindow::grab_event_mask(long mask)
void
XWindow::ungrab_pointer()
{
if (sPointerGrabWindow != this)
return;

LockLooper();
SetEventMask(0, B_NO_POINTER_HISTORY);

_event_mask = _prior_event_mask;

if (sPointerGrabWindow == this)
sPointerGrabWindow = NULL;
sPointerGrabWindow = NULL;

BPoint location;
GetMouse(&location, NULL, false);
Expand Down

0 comments on commit 8c32ad4

Please sign in to comment.