Opened 14 years ago

Closed 12 years ago

Last modified 5 years ago

#4692 closed defect (fixed)

WINCE: Force back to Portrait mode when screen rotates

Reported by: SF/burkilos Owned by: CeRiAl
Priority: normal Component: Port: WinCE
Version: Keywords:
Cc: Game:


Due to this known GAPI issue ( - 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); return 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.

Change History (9)

comment:1 by fingolfin, 14 years ago

Owner: set to SF/knakos

comment:2 by fingolfin, 13 years ago

Owner: changed from SF/knakos to CeRiAl

comment:3 by fingolfin, 13 years ago

Re-assigning to cerial

comment:4 by CeRiAl, 12 years ago

Burkilos, thanks alot for your patch, I've applied it locally and it fixes the problem perfectly (tested on HTC Touch Pro). As the fix is located in the SDL library, it won't be available in the builds generated from buildbot until the library is updated there. I will leave this bug opened until the SDL library is updated on buildbot.

comment:5 by digitall, 12 years ago

The SDL library for WinCE has now been updated on buildbot. If you can check with the daily builds, then this bug can be closed:

comment:6 by CeRiAl, 12 years ago

I just wanted to add that the 1.3.1 release also includes this fix, so no need to try a daily build any more.

Additionally I'm changing the status to "pending" and will close this bug after 14 days as the bug seems to be fixed in all tests and there's no complaint that states otherwise.

comment:7 by CeRiAl, 12 years ago

Status: newpending

comment:8 by CeRiAl, 12 years ago

Resolution: fixed
Status: pendingclosed

comment:9 by digitall, 5 years ago

Component: Port: WinCE
Note: See TracTickets for help on using tickets.