[maemo-developers] [maemo-developers] Workaround to prevent crash when pressing home key in SDL programs (IT2006)?
From: Frantisek Dufka dufkaf at seznam.czDate: Wed Jun 21 12:06:38 EEST 2006
- Previous message: [maemo-developers] Workaround to prevent crash when pressing home key in SDL programs (IT2006)?
 - Next message: [maemo-developers] Information about N770 sound drivers
 - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
 
Tapani Pälli wrote:
> 
> You can access display and window from SDL code without SDL sources ...
> you have to include <SDL/SDL_syswm.h> 
That's great. So the final workaround (works in scummvm port) is like this:
#include <SDL/SDL_syswm.h>
void SDL_X11_SetNetWMWindowTypeNormal(){
     SDL_SysWMinfo wminfo;
     SDL_VERSION(&wminfo.version);
     if (SDL_GetWMInfo(&wminfo)){
         Atom atoms[1] = { None };
         Atom net_wm_window_type;
         net_wm_window_type = XInternAtom (wminfo.info.x11.display,
                                           "_NET_WM_WINDOW_TYPE", False);
         atoms[0] = XInternAtom (wminfo.info.x11.display,
                                 "_NET_WM_WINDOW_TYPE_NORMAL",
                                 False);
         XChangeProperty ( wminfo.info.x11.display,
                           wminfo.info.x11.wmwindow,
                          net_wm_window_type,
                          XA_ATOM, 32, PropModeReplace,
                          (unsigned char *)atoms, 1);
     }
}
And it can be called after SDL_Init(SDL_INIT_VIDEO) but before 
SDL_SetVideoMode. When called later the icon will not show immediatelly 
but after minimizing/rearranging windows.
This is of course needed only if you want it working in current beta. It 
won't be needed for future versions.
Also you need to add -I /usr/X11R6/include to gcc, SDL_syswm.h needs it.
Frantisek
    - Previous message: [maemo-developers] Workaround to prevent crash when pressing home key in SDL programs (IT2006)?
 - Next message: [maemo-developers] Information about N770 sound drivers
 - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
 
