Fix accidental switch/teleporter behavior changes
[neverball] / share / syswm.c
index 7592380..864deda 100644 (file)
@@ -1,3 +1,17 @@
+/*
+ * Copyright (C) 2003-2010 Neverball authors
+ *
+ * NEVERBALL is  free software; you can redistribute  it and/or modify
+ * it under the  terms of the GNU General  Public License as published
+ * by the Free  Software Foundation; either version 2  of the License,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
+ * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
+ * General Public License for more details.
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -13,7 +27,7 @@
 
 void set_SDL_icon(const char *filename)
 {
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(_WIN32)
     SDL_Surface *icon;
 
     if ((icon = load_surface(filename)))
@@ -22,13 +36,13 @@ void set_SDL_icon(const char *filename)
         free(icon->pixels);
         SDL_FreeSurface(icon);
     }
-#endif /* __APPLE__ */
+#endif
     return;
 }
 
 void set_EWMH_icon(const char *filename)
 {
-#if SDL_VIDEO_DRIVER_X11
+#if SDL_VIDEO_DRIVER_X11 && !SDL_VIDEO_DRIVER_QUARTZ
     SDL_SysWMinfo info;
 
     Display *dpy;
@@ -41,7 +55,7 @@ void set_EWMH_icon(const char *filename)
 
     if (SDL_GetWMInfo(&info) != 1)
     {
-        fprintf(stderr, _("Failed to get WM info: %s\n"), SDL_GetError());
+        fprintf(stderr, L_("Failed to get WM info: %s\n"), SDL_GetError());
         return;
     }
 
@@ -62,7 +76,7 @@ void set_EWMH_icon(const char *filename)
      * [*] http://standards.freedesktop.org/wm-spec/latest/
      */
 
-    if ((p = image_load(config_data(filename), &w, &h, &b)))
+    if ((p = image_load(filename, &w, &h, &b)))
     {
         long *data = NULL;
 
@@ -112,7 +126,7 @@ void set_EWMH_icon(const char *filename)
             free(data);
         }
         else
-            fputs(_("Failed to allocate memory for EWMH icon data.\n"), stderr);
+            fputs(L_("Failed to allocate memory for EWMH icon data.\n"), stderr);
 
         free(p);
     }