All pastes #1554361 Raw Edit

Someone

public text v1 · immutable
#1554361 ·published 2009-09-04 22:54 UTC
rendered paste body
Index: WinEventsSDL.cpp
===================================================================
--- WinEventsSDL.cpp	(revision 22723)
+++ WinEventsSDL.cpp	(working copy)
@@ -33,6 +33,7 @@
 bool CWinEventsSDL::MessagePump()
 { 
   SDL_Event event;
+  bool ret = false;
   
   while (SDL_PollEvent(&event))
   {
@@ -49,7 +50,7 @@
     case SDL_JOYBALLMOTION:
     case SDL_JOYHATMOTION:
       g_Joystick.Update(event);
-      return true;
+      ret = true;
       break;
 #endif
       
@@ -73,7 +74,8 @@
 #ifdef __APPLE__      
       if (ProcessOSXShortcuts(event))
       {
-        return true;
+        ret = true;
+        break;
       }
 #endif      
       
@@ -89,7 +91,8 @@
 
       // don't handle any more messages in the queue until we've handled keydown,
       // if a keyup is in the queue it will reset the keypress before it is handled.
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
+      break;
     }
       
     case SDL_KEYUP:
@@ -104,7 +107,8 @@
       newEvent.key.type = event.key.type;
       newEvent.key.which = event.key.which;
       
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
+      break;
     }
     
     case SDL_MOUSEBUTTONDOWN:
@@ -118,7 +122,8 @@
       newEvent.button.x = event.button.x;
       newEvent.button.y = event.button.y;
 
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
+      break;
     }
 
     case SDL_MOUSEBUTTONUP:
@@ -132,7 +137,8 @@
       newEvent.button.x = event.button.x;
       newEvent.button.y = event.button.y;
 
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
+      break;
     }
 
     case SDL_MOUSEMOTION:
@@ -147,7 +153,8 @@
       newEvent.motion.x = event.motion.x;
       newEvent.motion.y = event.motion.y;
 
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
+      break;
     }
     case SDL_VIDEORESIZE:
     {
@@ -156,13 +163,14 @@
       newEvent.resize.w = event.resize.w;
       newEvent.resize.h = event.resize.h;
       newEvent.resize.type = event.resize.type;
-      return g_application.OnEvent(newEvent);
+      ret |= g_application.OnEvent(newEvent);
     }
     
     }
+    memset(&event, 0, sizeof(XBMC_Event));
   }
   
-  return false;
+  return ret;
 }
 
 #ifdef __APPLE__