summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2003-03-13 01:44:27 +0000
committerTor Lillqvist <tml@src.gnome.org>2003-03-13 01:44:27 +0000
commitb2698b3a58e9e070085475c2bc862b085ae8facd (patch)
tree2b3ba69559e007c75ae9212f2a5b127042f478c2
parent1e072f625cf0519b2f82a55bb201d0d65ac683a8 (diff)
downloadgdk-pixbuf-b2698b3a58e9e070085475c2bc862b085ae8facd.tar.gz
On WM_MOUSEMOVE, the test whether we have actually moved (and thus
2003-03-13 Tor Lillqvist <tml@iki.fi> * gdk/win32/gdkevents-win32.c (gdk_event_translate): On WM_MOUSEMOVE, the test whether we have actually moved (and thus shouldn't generate an GDK event) moved after the call to propagate() and translate_mouse_coords(). Otherwise we were testing wrong values. (#108115, Allin Cottrell) (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--ChangeLog.pre-2-48
-rw-r--r--ChangeLog.pre-2-68
-rw-r--r--ChangeLog.pre-2-88
-rw-r--r--gdk/win32/gdkevents-win32.c27
6 files changed, 55 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 747bdf75e..bedf1f826 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2003-03-13 Tor Lillqvist <tml@iki.fi>
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): On
+ WM_MOUSEMOVE, the test whether we have actually moved (and thus
+ shouldn't generate an GDK event) moved after the call to
+ propagate() and translate_mouse_coords(). Otherwise we were
+ testing wrong values. (#108115, Allin Cottrell)
+ (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same
+ way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
+
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): if a grab cursor
is used, must copy the HCURSOR with CopyCursor(), as it is OK to
destroy the GdkCursor after calling gdk_pointer_grab(). Set the
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 747bdf75e..bedf1f826 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,13 @@
2003-03-13 Tor Lillqvist <tml@iki.fi>
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): On
+ WM_MOUSEMOVE, the test whether we have actually moved (and thus
+ shouldn't generate an GDK event) moved after the call to
+ propagate() and translate_mouse_coords(). Otherwise we were
+ testing wrong values. (#108115, Allin Cottrell)
+ (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same
+ way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
+
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): if a grab cursor
is used, must copy the HCURSOR with CopyCursor(), as it is OK to
destroy the GdkCursor after calling gdk_pointer_grab(). Set the
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 747bdf75e..bedf1f826 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,5 +1,13 @@
2003-03-13 Tor Lillqvist <tml@iki.fi>
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): On
+ WM_MOUSEMOVE, the test whether we have actually moved (and thus
+ shouldn't generate an GDK event) moved after the call to
+ propagate() and translate_mouse_coords(). Otherwise we were
+ testing wrong values. (#108115, Allin Cottrell)
+ (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same
+ way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
+
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): if a grab cursor
is used, must copy the HCURSOR with CopyCursor(), as it is OK to
destroy the GdkCursor after calling gdk_pointer_grab(). Set the
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 747bdf75e..bedf1f826 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,5 +1,13 @@
2003-03-13 Tor Lillqvist <tml@iki.fi>
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): On
+ WM_MOUSEMOVE, the test whether we have actually moved (and thus
+ shouldn't generate an GDK event) moved after the call to
+ propagate() and translate_mouse_coords(). Otherwise we were
+ testing wrong values. (#108115, Allin Cottrell)
+ (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same
+ way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
+
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): if a grab cursor
is used, must copy the HCURSOR with CopyCursor(), as it is OK to
destroy the GdkCursor after calling gdk_pointer_grab(). Set the
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 747bdf75e..bedf1f826 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,5 +1,13 @@
2003-03-13 Tor Lillqvist <tml@iki.fi>
+ * gdk/win32/gdkevents-win32.c (gdk_event_translate): On
+ WM_MOUSEMOVE, the test whether we have actually moved (and thus
+ shouldn't generate an GDK event) moved after the call to
+ propagate() and translate_mouse_coords(). Otherwise we were
+ testing wrong values. (#108115, Allin Cottrell)
+ (gdk_event_translate): On WM_?BUTTONUP, set current_{x,y} the same
+ way as in WM_?BUTTONDOWN and WM_MOUSEMOVE.
+
* gdk/win32/gdkevents-win32.c (gdk_pointer_grab): if a grab cursor
is used, must copy the HCURSOR with CopyCursor(), as it is OK to
destroy the GdkCursor after calling gdk_pointer_grab(). Set the
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index eded08349..a07dc1b2b 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2551,7 +2551,7 @@ gdk_event_translate (GdkDisplay *display,
event->button.x = current_x = (gint16) LOWORD (msg->lParam);
event->button.y = current_y = (gint16) HIWORD (msg->lParam);
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
- event->button.x += xoffset; /* XXX translate current_x, y too? */
+ event->button.x += xoffset;
event->button.y += yoffset;
event->button.x_root = current_x_root = msg->pt.x;
event->button.y_root = current_y_root = msg->pt.y;
@@ -2605,9 +2605,11 @@ gdk_event_translate (GdkDisplay *display,
event->button.time = _gdk_win32_get_next_tick (msg->time);
if (window != orig_window)
translate_mouse_coords (orig_window, window, msg);
+ event->button.x = current_x = (gint16) LOWORD (msg->lParam);
+ event->button.y = current_y = (gint16) HIWORD (msg->lParam);
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);
- event->button.x = (gint16) LOWORD (msg->lParam) + xoffset;
- event->button.y = (gint16) HIWORD (msg->lParam) + yoffset;
+ event->button.x += xoffset;
+ event->button.y += yoffset;
event->button.x_root = current_x_root = msg->pt.x;
event->button.y_root = current_y_root = msg->pt.y;
event->button.axes = NULL;
@@ -2632,15 +2634,6 @@ gdk_event_translate (GdkDisplay *display,
ASSIGN_WINDOW (find_window_for_pointer_event (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
- && LOWORD (msg->lParam) == current_x
- && HIWORD (msg->lParam) == current_y)
- break;
-
/* HB: only process mouse move messages if we own the active window. */
GetWindowThreadProcessId (GetActiveWindow (), &pidActWin);
GetWindowThreadProcessId (msg->hwnd, &pidThis);
@@ -2668,6 +2661,16 @@ gdk_event_translate (GdkDisplay *display,
event->motion.time = _gdk_win32_get_next_tick (msg->time);
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
+ && LOWORD (msg->lParam) == current_x
+ && HIWORD (msg->lParam) == current_y)
+ break;
+
event->motion.x = current_x = (gint16) LOWORD (msg->lParam);
event->motion.y = current_y = (gint16) HIWORD (msg->lParam);
_gdk_windowing_window_get_offsets (window, &xoffset, &yoffset);