diff --git a/ChangeLog b/ChangeLog index 25ecffe752..21f8bc2cd6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-09-02 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of + cursor position also in root window coordinates. Prune out + superfluous WM_MOUSEMOVE events even earlier, based on root window + coordinates. Windows sends WM_MOUSEMOVE messages after a new + window has ben mapped below the cursor even if the mouse doesn't + move. We used to generate GDK_MOTION_NOTIFY in these cases. This + confused at least gtk_menu_motion_notify(). (#314995) + + * gtk/gtkintl.h: No need to include config.h here. It caused + warnings about GTK_LOCALEDIR being redefined on Win32 when + compiling files where gtkintl.h is included after gtkprivate.h + (which #undefines and re-#defines GTK_LOCALEDIR on Win32). + 2005-09-01 Matthias Clasen * gtk/gtkaction.c (gtk_action_get_accel_closure): Fix doc diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 25ecffe752..21f8bc2cd6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +2005-09-02 Tor Lillqvist + + * gdk/win32/gdkevents-win32.c (gdk_event_translate): Keep track of + cursor position also in root window coordinates. Prune out + superfluous WM_MOUSEMOVE events even earlier, based on root window + coordinates. Windows sends WM_MOUSEMOVE messages after a new + window has ben mapped below the cursor even if the mouse doesn't + move. We used to generate GDK_MOTION_NOTIFY in these cases. This + confused at least gtk_menu_motion_notify(). (#314995) + + * gtk/gtkintl.h: No need to include config.h here. It caused + warnings about GTK_LOCALEDIR being redefined on Win32 when + compiling files where gtkintl.h is included after gtkprivate.h + (which #undefines and re-#defines GTK_LOCALEDIR on Win32). + 2005-09-01 Matthias Clasen * gtk/gtkaction.c (gtk_action_get_accel_closure): Fix doc diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index e73fdc508c..89dc4c8576 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -140,6 +140,7 @@ GPollFD event_poll_fd; static GdkWindow *current_window = NULL; static gint current_x, current_y; +static gint current_root_x, current_root_y; static UINT msh_mousewheel; static UINT client_message; @@ -2731,6 +2732,17 @@ gdk_event_translate (MSG *msg, msg->wParam, GET_X_LPARAM (msg->lParam), GET_Y_LPARAM (msg->lParam))); + /* If we haven't moved, don't create any GDK event. Windows + * sends WM_MOUSEMOVE messages after a new window is shows under + * the mouse, even if the mouse hasn't moved. This disturbs gtk. + */ + if (msg->pt.x + _gdk_offset_x == current_root_x && + msg->pt.y + _gdk_offset_y == current_root_y) + break; + + current_root_x = msg->pt.x + _gdk_offset_x; + current_root_y = msg->pt.y + _gdk_offset_y; + assign_object (&window, find_window_for_mouse_event (window, msg)); if (p_grab_window != NULL) @@ -2757,15 +2769,6 @@ gdk_event_translate (MSG *msg, if (window != orig_window) translate_mouse_coords (orig_window, window, msg); - /* If we haven't moved, don't create any event. - * Windows sends WM_MOUSEMOVE messages after button presses - * even if the mouse doesn't move. This disturbs gtk. - */ - if (window == current_window && - GET_X_LPARAM (msg->lParam) == current_x && - GET_Y_LPARAM (msg->lParam) == current_y) - break; - event = gdk_event_new (GDK_MOTION_NOTIFY); event->motion.window = window; event->motion.time = _gdk_win32_get_next_tick (msg->time); @@ -2774,8 +2777,8 @@ gdk_event_translate (MSG *msg, _gdk_windowing_window_get_offsets (window, &xoffset, &yoffset); event->motion.x += xoffset; event->motion.y += yoffset; - event->motion.x_root = msg->pt.x + _gdk_offset_x; - event->motion.y_root = msg->pt.y + _gdk_offset_y; + event->motion.x_root = current_root_x; + event->motion.y_root = current_root_y; event->motion.axes = NULL; event->motion.state = build_pointer_event_state (msg); event->motion.is_hint = FALSE; diff --git a/gtk/gtkintl.h b/gtk/gtkintl.h index d29723bb92..99979315d7 100644 --- a/gtk/gtkintl.h +++ b/gtk/gtkintl.h @@ -1,7 +1,6 @@ #ifndef __GTKINTL_H__ #define __GTKINTL_H__ -#include "config.h" #include #ifdef ENABLE_NLS