From d05cabeedc22f811febf9c79373729a8b310048c Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 5 May 2003 08:35:36 +0000 Subject: [PATCH] Removed surplus enter/leave events after mouse capture/release. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 8 +++++++- src/gtk1/window.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 7304180584..2daf9a7a41 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2062,6 +2062,9 @@ gint gtk_window_enter_callback( GtkWidget *widget, if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; + // Event was emitted after a grab + if (gdk_event->mode != GDK_CROSSING_NORMAL) return FALSE; + if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE; int x = 0; @@ -2069,7 +2072,7 @@ gint gtk_window_enter_callback( GtkWidget *widget, GdkModifierType state = (GdkModifierType)0; gdk_window_get_pointer( widget->window, &x, &y, &state ); - + wxMouseEvent event( wxEVT_ENTER_WINDOW ); InitMouseEvent(win, event, gdk_event); wxPoint pt = win->GetClientAreaOrigin(); @@ -2099,6 +2102,9 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_ if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; + // Event was emitted after an ungrab + if (gdk_event->mode != GDK_CROSSING_NORMAL) return FALSE; + if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE; wxMouseEvent event( wxEVT_LEAVE_WINDOW ); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 7304180584..2daf9a7a41 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2062,6 +2062,9 @@ gint gtk_window_enter_callback( GtkWidget *widget, if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; + // Event was emitted after a grab + if (gdk_event->mode != GDK_CROSSING_NORMAL) return FALSE; + if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE; int x = 0; @@ -2069,7 +2072,7 @@ gint gtk_window_enter_callback( GtkWidget *widget, GdkModifierType state = (GdkModifierType)0; gdk_window_get_pointer( widget->window, &x, &y, &state ); - + wxMouseEvent event( wxEVT_ENTER_WINDOW ); InitMouseEvent(win, event, gdk_event); wxPoint pt = win->GetClientAreaOrigin(); @@ -2099,6 +2102,9 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_ if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return FALSE; + // Event was emitted after an ungrab + if (gdk_event->mode != GDK_CROSSING_NORMAL) return FALSE; + if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE; wxMouseEvent event( wxEVT_LEAVE_WINDOW );