source/Platform/Unix/X11Display.cpp: implement grabCursor()
This commit is contained in:
parent
d601d95d40
commit
085d593b66
1 changed files with 10 additions and 1 deletions
|
|
@ -368,7 +368,16 @@ void X11Display::showCursor(bool value)
|
||||||
|
|
||||||
void X11Display::grabCursor(bool value)
|
void X11Display::grabCursor(bool value)
|
||||||
{
|
{
|
||||||
// TODO (this is abit harder on X11 than windows.)
|
if (value) {
|
||||||
|
int result = ::XGrabPointer(Xlib::getDisplay(), m_win, True, None,
|
||||||
|
GrabModeAsync, GrabModeAsync, m_win, None, CurrentTime);
|
||||||
|
|
||||||
|
if (result != GrabSuccess) {
|
||||||
|
Log::info("X11: Cursor Grab failed");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
::XUngrabPointer(Xlib::getDisplay(), CurrentTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void X11Display::processEvent(const ::XEvent& event)
|
void X11Display::processEvent(const ::XEvent& event)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue