]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/evtloop.cpp
TRUE/FALSE -> true/false
[wxWidgets.git] / src / motif / evtloop.cpp
index 217cbfa0abd6e8c0a63693c767482fee6dcdd588..41c575d343da14d0608bed705a54f2c1f64ae877 100644 (file)
@@ -35,6 +35,7 @@
 #include "wx/evtloop.h"
 #include "wx/event.h"
 #include "wx/app.h"
+#include "wx/window.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -233,7 +234,7 @@ void ProcessXEvent(XEvent* event)
          * window is recieved. Prevents flicker as windows are resized.
          */
 
-        Display *disp = XtDisplay((Widget) wxTheApp->GetTopLevelWidget());
+        Display *disp = event->xany.display;
         Window win = event->xany.window;
         XEvent report;
 
@@ -259,7 +260,7 @@ bool CheckForAccelerator(XEvent* event)
     {
         // Find a wxWindow for this window
         // TODO: should get display for the window, not the current display
-        Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
+        Widget widget = XtWindowToWidget(event->xany.display,
                                          event->xany.window);
         wxWindow* win = NULL;
 
@@ -293,8 +294,8 @@ bool CheckForKeyDown(XEvent* event)
 {
     if (event->xany.type == KeyPress)
     {
-        Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
-                     event->xany.window);
+        Widget widget = XtWindowToWidget(event->xany.display,
+                                         event->xany.window);
         wxWindow* win = NULL;
 
         // Find the first wxWindow that corresponds to this event window
@@ -307,7 +308,7 @@ bool CheckForKeyDown(XEvent* event)
         wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
         wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
 
-        return win->ProcessEvent( keyEvent );
+        return win->GetEventHandler()->ProcessEvent( keyEvent );
     }
 
     return false;
@@ -319,8 +320,8 @@ bool CheckForKeyUp(XEvent* event)
 {
     if (event->xany.type == KeyRelease)
     {
-        Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
-                         event->xany.window);
+        Widget widget = XtWindowToWidget(event->xany.display,
+                                         event->xany.window);
         wxWindow* win = NULL;
 
         // Find the first wxWindow that corresponds to this event window
@@ -333,7 +334,7 @@ bool CheckForKeyUp(XEvent* event)
         wxKeyEvent keyEvent(wxEVT_KEY_UP);
         wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
 
-        return win->ProcessEvent( keyEvent );
+        return win->GetEventHandler()->ProcessEvent( keyEvent );
     }
 
     return false;
@@ -443,7 +444,7 @@ static void wxInputCallback( XtPointer, int* fd, XtInputId* )
 
 static void wxBreakDispatch()
 {
-    char dummy;
+    char dummy = 0; // for valgrind
 
     // check if wxWakeUpIdle has already been called
     fd_set in;