aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/maemosdl/maemosdl-graphics.cpp26
-rw-r--r--backends/graphics/maemosdl/maemosdl-graphics.h3
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