mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Monitor DeviceId setting.
The SDL_WINDOWEVENT_DISPLAY_CHANGED event reports an incorrect DeviceId when changed via command. The resolution sanity check that is applied when changing monitors is moved to the SDL_WINDOWEVENT_MOVED event where DeviceId is properly detected.
This commit is contained in:
parent
582751ae42
commit
640af98807
1 changed files with 4 additions and 5 deletions
|
|
@ -646,7 +646,11 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_MOVED:
|
case SDL_WINDOWEVENT_MOVED:
|
||||||
{
|
{
|
||||||
|
S32 oldDisplay = Con::getIntVariable("pref::Video::deviceId", 0);
|
||||||
_updateMonitorFromMove(evt);
|
_updateMonitorFromMove(evt);
|
||||||
|
// If display device has changed, make sure window params are compatible with the new device.
|
||||||
|
if (oldDisplay != Con::getIntVariable("pref::Video::deviceId", 0))
|
||||||
|
Con::evaluate("configureCanvas();");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SDL_WINDOWEVENT_RESIZED:
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
|
|
@ -672,11 +676,6 @@ void PlatformWindowSDL::_processSDLEvent(SDL_Event &evt)
|
||||||
case SDL_WINDOWEVENT_RESTORED:
|
case SDL_WINDOWEVENT_RESTORED:
|
||||||
Con::setBoolVariable("pref::Video::isMaximized", false);
|
Con::setBoolVariable("pref::Video::isMaximized", false);
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_DISPLAY_CHANGED:
|
|
||||||
Con::printf("Window moved to display #%d", evt.window.data1);
|
|
||||||
Con::setIntVariable("pref::Video::deviceId", evt.window.data1);
|
|
||||||
Con::evaluate("configureCanvas();");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue