WINCE: Force back to Portrait mode when screen rotates
|Reported by:||SF/burkilos||Owned by:||CeRiAl|
Due to this known GAPI issue (http://support.microsoft.com/kb/843485 - Problems may occur when you use a GAPI application in landscape mode) and the fact that GXOpenDisplay forces device in Portrait mode, switching the display to Landscape while ScummVM is running will throw the mouse cursor out of sync with ScummVM. Newer HTC devices with GSensor rotation and sliding the keyboard open while in ScummVM will rotate the device against player's will.
The fix, quite simple really, is that if GAPI is used (and I understand that it is the main GX engine for ScummVM on WinCE), force the orientation back to Portrait with ChangeDisplaySettingsEx if devMode.dmDisplayOrientation != 0.
SDL_sysevents.c - getDisplayMode(void)
r = dynChangeDisplaySettingsEx(NULL, &devMode, NULL, CDS_TEST, NULL);
+ if (devMode.dmDisplayOrientation != 0)
+ devMode.dmDisplayOrientation = 0;
+ dynChangeDisplaySettingsEx(NULL, &devMode, NULL, CDS_RESET, NULL);
+ debugLog("SDL: Forced Portrait orientation");
debugLog("SDL: orientation %d", devMode.dmDisplayOrientation);
This was tested with SVN and HTC Touch Pro 2. Works with GSensor orientation changes and opening Keyboard.
Ticket imported from: #2889140. Ticket imported from: bugs/4692.