diff options
author | Tarek Soliman | 2011-11-29 14:01:20 -0600 |
---|---|---|
committer | Tarek Soliman | 2011-11-29 14:39:15 -0600 |
commit | fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d (patch) | |
tree | 33e048e96a87abee01a30f9e919f66a0ce091799 /backends/graphics | |
parent | 29c0386f2c5d1a8a03cab0010e7c7c7e27fe2e94 (diff) | |
download | scummvm-rg350-fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d.tar.gz scummvm-rg350-fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d.tar.bz2 scummvm-rg350-fda6e1534bc1dfad7f1f32ccf0bb51f3eb34974d.zip |
MAEMO: Fix zoom key capture on N900 (fixes bug#3443037)
This was semi-intentionally skipped in the intial port revival
because the focus was on N810 at the time.
This is mostly copied from the old 1.2.1 port and then cleaned up.
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/maemosdl/maemosdl-graphics.cpp | 26 | ||||
-rw-r--r-- | backends/graphics/maemosdl/maemosdl-graphics.h | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/backends/graphics/maemosdl/maemosdl-graphics.cpp b/backends/graphics/maemosdl/maemosdl-graphics.cpp index 3309d91228..527ef82b9d 100644 --- a/backends/graphics/maemosdl/maemosdl-graphics.cpp +++ b/backends/graphics/maemosdl/maemosdl-graphics.cpp @@ -21,6 +21,8 @@ */ #if defined(MAEMO) +#include "SDL_syswm.h" + #include "common/scummsys.h" #include "backends/platform/maemo/maemo.h" @@ -31,4 +33,28 @@ MaemoSdlGraphicsManager::MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource) : SurfaceSdlGraphicsManager(sdlEventSource) { } +bool MaemoSdlGraphicsManager::loadGFXMode() { + bool success = SurfaceSdlGraphicsManager::loadGFXMode(); + + // fix the problematic zoom key capture in Maemo5/N900 + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + if (SDL_GetWMInfo(&info)) { + Display *dpy = info.info.x11.display; + Window win; + unsigned long val = 1; + Atom atom_zoom = XInternAtom(dpy, "_HILDON_ZOOM_KEY_ATOM", 0); + info.info.x11.lock_func(); + win = info.info.x11.fswindow; + if (win) + XChangeProperty(dpy, win, atom_zoom, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &val, 1); // grab zoom keys + win = info.info.x11.wmwindow; + if (win) + XChangeProperty(dpy, win, atom_zoom, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &val, 1); // grab zoom keys + info.info.x11.unlock_func(); + } + + return success; +} + #endif diff --git a/backends/graphics/maemosdl/maemosdl-graphics.h b/backends/graphics/maemosdl/maemosdl-graphics.h index 4a675b6159..81064d2d5f 100644 --- a/backends/graphics/maemosdl/maemosdl-graphics.h +++ b/backends/graphics/maemosdl/maemosdl-graphics.h @@ -30,6 +30,9 @@ class MaemoSdlGraphicsManager : public SurfaceSdlGraphicsManager { public: MaemoSdlGraphicsManager(SdlEventSource *sdlEventSource); + +protected: + virtual bool loadGFXMode(); }; #endif |