Till Harbaum / Lists wrote:
Any idea why this still delivers some key events to the volume control?

Maybe sometimes there is another window active which doesn't have the _HILDON_ZOOM_KEY_ATOM set? Something specific to GLES and/or double buffering? Does it work with simple SDL app without GLES?



  SDL_SysWMinfo info;
SDL_VERSION(&info.version); if ( SDL_GetWMInfo(&info) ) {
    /* We use the SDL GFX display (we're using the GFX window too after all) */
    Display *dpy = info.info.x11.display;
    unsigned long val = 1;
    Atom atom_zoom = XInternAtom(dpy, "_HILDON_ZOOM_KEY_ATOM", 0);
    info.info.x11.lock_func();
    Window win = info.info.x11.window;
    XUnmapWindow(dpy,win);
    XChangeProperty (dpy,win,atom_zoom,XA_INTEGER,32,PropModeReplace,(unsigned char 
*) &val,1);
    XMapWindow(dpy,win);
    info.info.x11.unlock_func();
  }

Does it work for you otherwise? Works better for me without XUnmapWindow(dpy,win)/XMapWindow(dpy,win) pair, just XChangeProperty. But maybe that's because I am messing with info.info.x11.fswindow and info.info.x11.wmwindow and SDL doesn't like (un)mapping those directly.

I am not sure why there are three X windows in info.info.x11 structure (fswindow, wmwindow and window). From brief look into SDL sources it seems to me like the 'window' is used when SDL is initialized with not owned pre-created window passed to SDL via SDL_WINDOWID variable, otherwise wmwindow and fswindow are used depending of full screen state. In case you are not using SDL_WINDOWID maybe setting wmwindow and fswindow would help you with volume keys?

Frantisek

_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to