Added checks against windows being realized before doing warp pointer
This commit is contained in:
parent
208b2fc3d0
commit
b8d4533fa3
@ -1028,9 +1028,15 @@ void GraphicsWindowCarbon::setWindowName (const std::string& name)
|
||||
|
||||
void GraphicsWindowCarbon::requestWarpPointer(float x,float y)
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
OSG_INFO<<"GraphicsWindowCarbon::requestWarpPointer() - Window not realized; cannot warp pointer, screenNum="<< _traits->screenNum<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
DarwinWindowingSystemInterface* wsi = dynamic_cast<DarwinWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
|
||||
if (wsi == NULL) {
|
||||
if (wsi == NULL)
|
||||
{
|
||||
OSG_WARN << "GraphicsWindowCarbon::useCursor: could not get OSXCarbonWindowingSystemInterface" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
@ -1981,7 +1981,7 @@ void GraphicsWindowWin32::requestWarpPointer( float x, float y )
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
reportErrorForScreen("GraphicsWindowWin32::requestWarpPointer() - Window not realized; cannot warp pointer", _traits->screenNum, 0);
|
||||
OSG_INFO<<"GraphicsWindowWin32::requestWarpPointer() - Window not realized; cannot warp pointer, screenNum="<< _traits->screenNum<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1640,6 +1640,12 @@ int GraphicsWindowX11::getModifierMask() const
|
||||
|
||||
void GraphicsWindowX11::requestWarpPointer(float x,float y)
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
OSG_INFO<<"GraphicsWindowX11::requestWarpPointer() - Window not realized; cannot warp pointer, screenNum="<< _traits->screenNum<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
Display* display = _eventDisplay; // getDisplayToUse();
|
||||
|
||||
XWarpPointer( display,
|
||||
|
Loading…
Reference in New Issue
Block a user