Simplify setting window title
authorPatrice Mandin <patmandin@gmail.com>
Fri, 13 Jul 2007 16:11:58 +0000
changeset 2186 6fe43f7efd94
parent 2185 2032348afed1
child 2187 0b24732b1134
Simplify setting window title
src/video/gem/SDL_gemevents.c
--- a/src/video/gem/SDL_gemevents.c	Thu Jul 12 20:00:50 2007 +0000
+++ b/src/video/gem/SDL_gemevents.c	Fri Jul 13 16:11:58 2007 +0000
@@ -156,24 +156,12 @@
 
     /* Refresh window name ? */
     if (GEM_refresh_name) {
-        if (SDL_GetAppState() & SDL_APPACTIVE) {
-            /* Fullscreen/windowed */
-            if (GEM_title_name) {
-                wind_set(GEM_handle, WF_NAME,
-                         (short) (((unsigned long) GEM_title_name) >>
-                                  16),
-                         (short) (((unsigned long) GEM_title_name) &
-                                  0xffff), 0, 0);
-            }
-        } else {
-            /* Iconified */
-            if (GEM_icon_name) {
-                wind_set(GEM_handle, WF_NAME,
-                         (short) (((unsigned long) GEM_icon_name) >>
-                                  16),
-                         (short) (((unsigned long) GEM_icon_name) &
-                                  0xffff), 0, 0);
-            }
+        const char *window_name = (SDL_GetAppState() & SDL_APPACTIVE) ?
+            GEM_title_name : GEM_icon_name;
+        if (window_name) {
+            wind_set(GEM_handle, WF_NAME,
+                     (short) (((unsigned long) window_name) >> 16),
+                     (short) (((unsigned long) window_name) & 0xffff), 0, 0);
         }
         GEM_refresh_name = SDL_FALSE;
     }