locales: fr: set a bunch of missing translations (unfinished)
[neverball] / putt / main.c
index 7c80ae3..2b08ba7 100644 (file)
@@ -31,6 +31,7 @@
 #include "game.h"
 #include "gui.h"
 #include "text.h"
+#include "syswm.h"
 
 #include "st_conf.h"
 #include "st_all.h"
@@ -167,10 +168,8 @@ static int loop(void)
 
         case SDL_ACTIVEEVENT:
             if (e.active.state == SDL_APPINPUTFOCUS)
-            {
-                if (e.active.gain == 0)
+                if (e.active.gain == 0 && config_get_grab())
                     goto_pause(&st_over, 0);
-            }
             break;
 
         case SDL_JOYAXISMOTION:
@@ -192,9 +191,6 @@ static int loop(void)
 int main(int argc, char *argv[])
 {
     int camera = 0;
-#ifndef __APPLE__
-    SDL_Surface *icon;
-#endif
     SDL_Joystick *joy = NULL;
 
     srand((int) time(NULL));
@@ -238,14 +234,9 @@ int main(int argc, char *argv[])
                 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,  16);
                 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
 
-#ifndef __APPLE__
-                if ((icon = load_surface("icon/neverputt.png")))
-                {
-                    SDL_WM_SetIcon(icon, NULL);
-                    free(icon->pixels);
-                    SDL_FreeSurface(icon);
-                }
-#endif /* __APPLE__ */
+                /* This has to happen before mode setting... */
+
+                set_SDL_icon("icon/neverputt.png");
 
                 /* Initialize the video. */
 
@@ -255,6 +246,10 @@ int main(int argc, char *argv[])
                 {
                     int t1, t0 = SDL_GetTicks();
 
+                    /* ... and this has to happen after it. */
+
+                    set_EWMH_icon("icon/neverputt.png");
+
                     SDL_WM_SetCaption(TITLE, TITLE);
 
                     /* Run the main game loop. */