Added checks against windows being realized before doing warp pointer

This commit is contained in:
Robert Osfield 2010-06-18 14:53:58 +00:00
parent 208b2fc3d0
commit b8d4533fa3
3 changed files with 14 additions and 2 deletions

View File

@ -1028,9 +1028,15 @@ void GraphicsWindowCarbon::setWindowName (const std::string& name)
void GraphicsWindowCarbon::requestWarpPointer(float x,float y) 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()); DarwinWindowingSystemInterface* wsi = dynamic_cast<DarwinWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
if (wsi == NULL) { if (wsi == NULL)
{
OSG_WARN << "GraphicsWindowCarbon::useCursor: could not get OSXCarbonWindowingSystemInterface" << std::endl; OSG_WARN << "GraphicsWindowCarbon::useCursor: could not get OSXCarbonWindowingSystemInterface" << std::endl;
return; return;
} }

View File

@ -1981,7 +1981,7 @@ void GraphicsWindowWin32::requestWarpPointer( float x, float y )
{ {
if (!_realized) 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; return;
} }

View File

@ -1640,6 +1640,12 @@ int GraphicsWindowX11::getModifierMask() const
void GraphicsWindowX11::requestWarpPointer(float x,float y) 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(); Display* display = _eventDisplay; // getDisplayToUse();
XWarpPointer( display, XWarpPointer( display,