Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
deskflow#4768 Workaround locking issue in X11 getCurrentTime()
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Nelless committed Aug 8, 2016
1 parent 354a8f1 commit fe5fb0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/platform/XWindowsUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,7 @@ XWindowsUtil::getCurrentTime(Display* display, Window window)
// select property events on window
XWindowAttributes attr;
XGetWindowAttributes(display, window, &attr);
XLockDisplay(display);
XSelectInput(display, window, attr.your_event_mask | PropertyChangeMask);

// make a property name to receive dummy change
Expand Down Expand Up @@ -1459,6 +1460,7 @@ XWindowsUtil::getCurrentTime(Display* display, Window window)

// restore event mask
XSelectInput(display, window, attr.your_event_mask);
XUnlockDisplay(display);

return xevent.xproperty.time;
}
Expand Down

0 comments on commit fe5fb0a

Please sign in to comment.