]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed problem with mouse events getting sent to wrong
authorRobert Roebling <robert@roebling.de>
Wed, 20 Oct 1999 20:38:47 +0000 (20:38 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 20 Oct 1999 20:38:47 +0000 (20:38 +0000)
    children when these were scrolled.
  wxCheckBox and wxRadioButton now have cursors and
    will do other things more sanely.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
include/wx/gtk/checkbox.h
include/wx/gtk/radiobut.h
include/wx/gtk1/checkbox.h
include/wx/gtk1/radiobut.h
samples/checklst/checklst.cpp
src/generic/splitter.cpp
src/gtk/checkbox.cpp
src/gtk/radiobut.cpp
src/gtk/window.cpp
src/gtk1/checkbox.cpp
src/gtk1/radiobut.cpp
src/gtk1/window.cpp

index 1a0c0ca3993f26ad6c9029b18ad3ae0486e52a49..412b3663b2e0626137086c96f95ad885b9d608b4 100644 (file)
@@ -67,6 +67,8 @@ public:
 
     // implementation
     void ApplyWidgetStyle();
+    bool IsOwnGtkWindow( GdkWindow *window );
+    void OnInternalIdle();
 
     GtkWidget *m_widgetCheckbox;
     GtkWidget *m_widgetLabel;
index 16aa5fa3285b8a27171b50453753551de502c542..c6717e8a6e1ef1c8d0afde344f48a47e52422a3d 100644 (file)
@@ -41,34 +41,37 @@ extern const char* wxRadioButtonNameStr;
 
 class wxRadioButton: public wxControl
 {
-DECLARE_DYNAMIC_CLASS(wxRadioButton)
-  
 public:
-  inline wxRadioButton() {}
-  inline wxRadioButton( wxWindow *parent, wxWindowID id,
+    inline wxRadioButton() {}
+    inline wxRadioButton( wxWindow *parent, wxWindowID id,
            const wxString& label,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxRadioButtonNameStr )
-  {
-      Create( parent, id, label, pos, size, style, validator, name );
-  }
-  bool Create(wxWindow *parent, wxWindowID id,
+    {
+        Create( parent, id, label, pos, size, style, validator, name );
+    }
+    bool Create(wxWindow *parent, wxWindowID id,
            const wxString& label,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxRadioButtonNameStr );
-  virtual void SetLabel(const wxString& label);
-  virtual void SetValue(bool val);
-  virtual bool GetValue() const;
-  bool Enable( bool enable );
+    virtual void SetLabel(const wxString& label);
+    virtual void SetValue(bool val);
+    virtual bool GetValue() const;
+    bool Enable( bool enable );
     
   // implementation
     
-  GSList *m_radioButtonGroup;
-  void ApplyWidgetStyle();
+    GSList *m_radioButtonGroup;
+    void ApplyWidgetStyle();
+    bool IsOwnGtkWindow( GdkWindow *window );
+    void OnInternalIdle();
+    
+private:
+    DECLARE_DYNAMIC_CLASS(wxRadioButton)
 };
 
 #endif
index 1a0c0ca3993f26ad6c9029b18ad3ae0486e52a49..412b3663b2e0626137086c96f95ad885b9d608b4 100644 (file)
@@ -67,6 +67,8 @@ public:
 
     // implementation
     void ApplyWidgetStyle();
+    bool IsOwnGtkWindow( GdkWindow *window );
+    void OnInternalIdle();
 
     GtkWidget *m_widgetCheckbox;
     GtkWidget *m_widgetLabel;
index 16aa5fa3285b8a27171b50453753551de502c542..c6717e8a6e1ef1c8d0afde344f48a47e52422a3d 100644 (file)
@@ -41,34 +41,37 @@ extern const char* wxRadioButtonNameStr;
 
 class wxRadioButton: public wxControl
 {
-DECLARE_DYNAMIC_CLASS(wxRadioButton)
-  
 public:
-  inline wxRadioButton() {}
-  inline wxRadioButton( wxWindow *parent, wxWindowID id,
+    inline wxRadioButton() {}
+    inline wxRadioButton( wxWindow *parent, wxWindowID id,
            const wxString& label,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxRadioButtonNameStr )
-  {
-      Create( parent, id, label, pos, size, style, validator, name );
-  }
-  bool Create(wxWindow *parent, wxWindowID id,
+    {
+        Create( parent, id, label, pos, size, style, validator, name );
+    }
+    bool Create(wxWindow *parent, wxWindowID id,
            const wxString& label,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator,
            const wxString& name = wxRadioButtonNameStr );
-  virtual void SetLabel(const wxString& label);
-  virtual void SetValue(bool val);
-  virtual bool GetValue() const;
-  bool Enable( bool enable );
+    virtual void SetLabel(const wxString& label);
+    virtual void SetValue(bool val);
+    virtual bool GetValue() const;
+    bool Enable( bool enable );
     
   // implementation
     
-  GSList *m_radioButtonGroup;
-  void ApplyWidgetStyle();
+    GSList *m_radioButtonGroup;
+    void ApplyWidgetStyle();
+    bool IsOwnGtkWindow( GdkWindow *window );
+    void OnInternalIdle();
+    
+private:
+    DECLARE_DYNAMIC_CLASS(wxRadioButton)
 };
 
 #endif
index 7018e0dd53fccb04e42c437bd4b6bd73df1eaae0..fdefc46f6ce38985fbe7126d06aea805f04ec6ad 100644 (file)
@@ -126,7 +126,7 @@ CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame,
     SetMenuBar(menu_bar);
 
     // make a panel with some controls
-    wxPanel *panel = new wxScrolledWindow(this, -1, wxPoint(0, 0),
+    wxPanel *panel = new wxPanel(this, -1, wxPoint(0, 0),
                                  wxSize(400, 200), wxTAB_TRAVERSAL);
 
     // check list box
index 793fe9f91465334d358368203dee95d6fa06d904..70ac816c857e5874c8f2f7c431eccb6ccf5774b9 100644 (file)
@@ -21,7 +21,9 @@
 #endif
 
 #ifndef WX_PRECOMP
-    #include "wx/wx.h"
+    #include "wx/window.h"
+    #include "wx/dialog.h"
+    #include "wx/frame.h"
 #endif
 
 #include <stdlib.h>
index 1426171b56697f48facd6b72b8dfdf23ac22d84c..060c3a127c38e2296953138510c54f51ed8b7f93 100644 (file)
@@ -30,7 +30,8 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool   g_blockEventsOnDrag;
+extern bool       g_blockEventsOnDrag;
+extern wxCursor   g_globalCursor;
 
 //-----------------------------------------------------------------------------
 // "clicked"
@@ -186,4 +187,27 @@ void wxCheckBox::ApplyWidgetStyle()
     gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
 }
 
+bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
+{
+    return (window == GTK_TOGGLE_BUTTON(m_widget)->event_window);
+}
+
+void wxCheckBox::OnInternalIdle()
+{
+    wxCursor cursor = m_cursor;
+    if (g_globalCursor.Ok()) cursor = g_globalCursor;
+
+    if (GTK_TOGGLE_BUTTON(m_widget)->event_window && cursor.Ok())
+    {
+        /* I now set the cursor the anew in every OnInternalIdle call
+          as setting the cursor in a parent window also effects the
+          windows above so that checking for the current cursor is
+          not possible. */
+          
+       gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widget)->event_window, cursor.GetCursor() );
+    }
+
+    UpdateWindowUI();
+}
+
 #endif
index 909c1ebf6d5df2007f94a17e6c38d5b2d636ca36..026b777890e270ed96dd9bcc343a7723020088c0 100644 (file)
@@ -30,7 +30,8 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool g_blockEventsOnDrag;
+extern bool       g_blockEventsOnDrag;
+extern wxCursor   g_globalCursor;
 
 //-----------------------------------------------------------------------------
 // "clicked"
@@ -186,4 +187,27 @@ void wxRadioButton::ApplyWidgetStyle()
     gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
 }
 
+bool wxRadioButton::IsOwnGtkWindow( GdkWindow *window )
+{
+    return (window == GTK_TOGGLE_BUTTON(m_widget)->event_window);
+}
+
+void wxRadioButton::OnInternalIdle()
+{
+    wxCursor cursor = m_cursor;
+    if (g_globalCursor.Ok()) cursor = g_globalCursor;
+
+    if (GTK_TOGGLE_BUTTON(m_widget)->event_window && cursor.Ok())
+    {
+        /* I now set the cursor the anew in every OnInternalIdle call
+          as setting the cursor in a parent window also effects the
+          windows above so that checking for the current cursor is
+          not possible. */
+          
+       gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widget)->event_window, cursor.GetCursor() );
+    }
+
+    UpdateWindowUI();
+}
+
 #endif
index c9001096b0565291e4b4197a00bc0b23b64a9acc..bc543f7d514f1cca6f656aa7a926297caef2118d 100644 (file)
@@ -1061,13 +1061,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
         }
     }
 
-/*
-    wxPrintf( wxT("2) OnButtonPress from ") );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        wxPrintf( win->GetClassInfo()->GetClassName() );
-    wxPrintf( wxT(".\n") );
-*/
-
     wxEventType event_type = wxEVT_LEFT_DOWN;
 
     if (gdk_event->button == 1)
@@ -1116,6 +1109,15 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1124,8 +1126,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1150,10 +1150,10 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;
@@ -1169,6 +1169,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     gs_timeLastClick = gdk_event->time;
 
+/*
+    wxPrintf( wxT("2) OnButtonPress from ") );
+    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+        wxPrintf( win->GetClassInfo()->GetClassName() );
+    wxPrintf( wxT(".\n") );
+*/
+
     if (win->GetEventHandler()->ProcessEvent( event ))
     {
         gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
@@ -1226,6 +1233,15 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1234,8 +1250,6 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1260,10 +1274,10 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;
@@ -1336,6 +1350,15 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1344,8 +1367,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1370,10 +1391,10 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;
index 1426171b56697f48facd6b72b8dfdf23ac22d84c..060c3a127c38e2296953138510c54f51ed8b7f93 100644 (file)
@@ -30,7 +30,8 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool   g_blockEventsOnDrag;
+extern bool       g_blockEventsOnDrag;
+extern wxCursor   g_globalCursor;
 
 //-----------------------------------------------------------------------------
 // "clicked"
@@ -186,4 +187,27 @@ void wxCheckBox::ApplyWidgetStyle()
     gtk_widget_set_style( m_widgetLabel, m_widgetStyle );
 }
 
+bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
+{
+    return (window == GTK_TOGGLE_BUTTON(m_widget)->event_window);
+}
+
+void wxCheckBox::OnInternalIdle()
+{
+    wxCursor cursor = m_cursor;
+    if (g_globalCursor.Ok()) cursor = g_globalCursor;
+
+    if (GTK_TOGGLE_BUTTON(m_widget)->event_window && cursor.Ok())
+    {
+        /* I now set the cursor the anew in every OnInternalIdle call
+          as setting the cursor in a parent window also effects the
+          windows above so that checking for the current cursor is
+          not possible. */
+          
+       gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widget)->event_window, cursor.GetCursor() );
+    }
+
+    UpdateWindowUI();
+}
+
 #endif
index 909c1ebf6d5df2007f94a17e6c38d5b2d636ca36..026b777890e270ed96dd9bcc343a7723020088c0 100644 (file)
@@ -30,7 +30,8 @@ extern bool g_isIdle;
 // data
 //-----------------------------------------------------------------------------
 
-extern bool g_blockEventsOnDrag;
+extern bool       g_blockEventsOnDrag;
+extern wxCursor   g_globalCursor;
 
 //-----------------------------------------------------------------------------
 // "clicked"
@@ -186,4 +187,27 @@ void wxRadioButton::ApplyWidgetStyle()
     gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
 }
 
+bool wxRadioButton::IsOwnGtkWindow( GdkWindow *window )
+{
+    return (window == GTK_TOGGLE_BUTTON(m_widget)->event_window);
+}
+
+void wxRadioButton::OnInternalIdle()
+{
+    wxCursor cursor = m_cursor;
+    if (g_globalCursor.Ok()) cursor = g_globalCursor;
+
+    if (GTK_TOGGLE_BUTTON(m_widget)->event_window && cursor.Ok())
+    {
+        /* I now set the cursor the anew in every OnInternalIdle call
+          as setting the cursor in a parent window also effects the
+          windows above so that checking for the current cursor is
+          not possible. */
+          
+       gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widget)->event_window, cursor.GetCursor() );
+    }
+
+    UpdateWindowUI();
+}
+
 #endif
index c9001096b0565291e4b4197a00bc0b23b64a9acc..bc543f7d514f1cca6f656aa7a926297caef2118d 100644 (file)
@@ -1061,13 +1061,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
         }
     }
 
-/*
-    wxPrintf( wxT("2) OnButtonPress from ") );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        wxPrintf( win->GetClassInfo()->GetClassName() );
-    wxPrintf( wxT(".\n") );
-*/
-
     wxEventType event_type = wxEVT_LEFT_DOWN;
 
     if (gdk_event->button == 1)
@@ -1116,6 +1109,15 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1124,8 +1126,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1150,10 +1150,10 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;
@@ -1169,6 +1169,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     gs_timeLastClick = gdk_event->time;
 
+/*
+    wxPrintf( wxT("2) OnButtonPress from ") );
+    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+        wxPrintf( win->GetClassInfo()->GetClassName() );
+    wxPrintf( wxT(".\n") );
+*/
+
     if (win->GetEventHandler()->ProcessEvent( event ))
     {
         gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
@@ -1226,6 +1233,15 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1234,8 +1250,6 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1260,10 +1274,10 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;
@@ -1336,6 +1350,15 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
 
     if (!g_captureWindow)
     {
+        int x = event.m_x;
+        int y = event.m_y;
+        if (win->m_wxwindow)
+        {
+            GtkMyFixed *myfixed = GTK_MYFIXED(win->m_wxwindow);
+           x += myfixed->xoffset;
+           y += myfixed->yoffset;
+        }
+
         wxNode *node = win->GetChildren().First();
         while (node)
         {
@@ -1344,8 +1367,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
             if (child->m_isStaticBox)
             {
                 // wxStaticBox is transparent in the box itself
-                int x = event.m_x;
-                int y = event.m_y;
                 int xx1 = child->m_x;
                 int yy1 = child->m_y;
                 int xx2 = child->m_x + child->m_width;
@@ -1370,10 +1391,10 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
             else
             {
                 if ((child->m_wxwindow == (GtkWidget*) NULL) &&
-                    (child->m_x <= event.m_x) &&
-                    (child->m_y <= event.m_y) &&
-                    (child->m_x+child->m_width  >= event.m_x) &&
-                    (child->m_y+child->m_height >= event.m_y))
+                    (child->m_x <= x) &&
+                    (child->m_y <= y) &&
+                    (child->m_x+child->m_width  >= x) &&
+                    (child->m_y+child->m_height >= y))
                 {
                     win = child;
                     event.m_x -= child->m_x;