Make sure that window is mapped before reading dimensions
This commit is contained in:
parent
60c9d97d27
commit
d0d036c372
@ -665,6 +665,11 @@ void CIrrDeviceLinux::grabPointer(bool grab)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool CIrrDeviceLinux::isWindowMapped(Display* display, XEvent* event, XPointer arg)
|
||||||
|
{
|
||||||
|
return event->type == MapNotify && event->xmap.window == *((Window*)arg);
|
||||||
|
}
|
||||||
|
|
||||||
bool CIrrDeviceLinux::createWindow()
|
bool CIrrDeviceLinux::createWindow()
|
||||||
{
|
{
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
@ -1149,6 +1154,9 @@ bool CIrrDeviceLinux::createWindow()
|
|||||||
IrrPrintXGrabError(grabPointer, "XGrabPointer");
|
IrrPrintXGrabError(grabPointer, "XGrabPointer");
|
||||||
XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
|
XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XEvent event;
|
||||||
|
XPeekIfEvent(display, &event, &isWindowMapped, (XPointer)&window);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -166,6 +166,7 @@ namespace irr
|
|||||||
int getNumlockMask(Display* display);
|
int getNumlockMask(Display* display);
|
||||||
EKEY_CODE getKeyCode(XEvent &event);
|
EKEY_CODE getKeyCode(XEvent &event);
|
||||||
void updateIMELocation();
|
void updateIMELocation();
|
||||||
|
static Bool isWindowMapped(Display* display, XEvent* event, XPointer arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Implementation of the linux cursor control
|
//! Implementation of the linux cursor control
|
||||||
|
Loading…
Reference in New Issue
Block a user