Commit b2698b3a authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

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.
parent 1e072f62
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
......
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
......
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
......
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
......
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
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment