When porting an SDL game or application to Maemo, if you wonder why the app doesn’t show up in the Task Navigator (at the bottom left-hand corner of the screen), you need to do two things. Example with Biloba:
Match the SDL window’s WM_CLASS and the .desktop StartupWMClass, the easiest being:
- biloba.desktop:
Exec=/usr/bin/biloba.sh
StartupWMClass=biloba
- /usr/bin/biloba.sh:
#!/bin/sh
export SDL_VIDEO_X11_WMCLASS=biloba
/usr/bin/biloba
Then, the window will probably appear as unnamed in the task list if the application is full-screen, in which case forcing the WM_NAME helps.
Hi, can you show me how I make this simple sdl-application visible in Task Navigator?
#include « SDL.h »
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define SCREEN_DEPTH 8
int main(int argc, char *argv[]) {
SDL_Surface *screen;
Uint8 *p;
int x = 10, y = 20;
/* Initialize SDL */
SDL_Init(SDL_INIT_VIDEO);
/* Initialize the screen / window */
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH, SDL_SWSURFACE);
/* Make p point to the place we want to draw the pixel */
p = (Uint8 *)screen->pixels + y * screen->pitch + x * screen->format->BytesPerPixel;
/* Draw the pixel! */
*p=0xff;
/* update the screen (aka double buffering) */
SDL_Flip(screen);
while(1);
}