changeset 1622:bf2a986fcb17

[xemacs-hg @ 2003-08-13 11:27:47 by stephent] send mwheel events w/o scrollbars <87k79hbxwo.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 13 Aug 2003 11:27:48 +0000
parents 9cf129cb99b9
children f2a5b4e67a2c
files src/ChangeLog src/event-msw.c
diffstat 2 files changed, 24 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Aug 13 11:22:43 2003 +0000
+++ b/src/ChangeLog	Wed Aug 13 11:27:48 2003 +0000
@@ -1,3 +1,10 @@
+2003-07-31  René Kyllingstad  <listmailxemacs@kyllingstad.com>
+
+	* event-msw.c (mswindows_enqueue_mouse_button_event):
+	* event-msw.c (mswindows_wnd_proc):
+	enqueue button{4,5}up events for scrollwheel event when
+	mswindows_handle_mousewheel_event doesn't handle it.
+
 2003-07-29  Marcus Crestani  <crestani@informatik.uni-tuebingen.de>
 	    Markus Kaltenbach  <makalten@informatik.uni-tuebingen.de>
 
--- a/src/event-msw.c	Wed Aug 13 11:22:43 2003 +0000
+++ b/src/event-msw.c	Wed Aug 13 11:27:48 2003 +0000
@@ -978,6 +978,9 @@
   int downp = (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN ||
 	       msg == WM_RBUTTONDOWN);
 
+  /* Wheel rotation amount: positive is away from user, negative towards user */
+  int delta = (short) HIWORD (mods);
+
   /* We always use last message time, because mouse button
      events may get delayed, and XEmacs double click
      recognition will fail */
@@ -998,8 +1001,10 @@
   XSET_EVENT_CHANNEL (emacs_event, mswindows_find_frame (hwnd));
   XSET_EVENT_TIMESTAMP (emacs_event, when);
   XSET_EVENT_BUTTON_BUTTON (emacs_event, 
-	 (msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 :
-	 ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2));
+    (msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 :
+    (msg==WM_MBUTTONDOWN || msg==WM_MBUTTONUP) ? 2 :
+    (msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 :
+    (msg==WM_MOUSEWHEEL && delta>0) ? 4 : 5);
   XSET_EVENT_BUTTON_X (emacs_event, where.x);
   XSET_EVENT_BUTTON_Y (emacs_event, where.y);
   XSET_EVENT_BUTTON_MODIFIERS (emacs_event,
@@ -3538,13 +3543,18 @@
 	int keys = LOWORD (wParam); /* Modifier key flags */
 	int delta = (short) HIWORD (wParam); /* Wheel rotation amount */
 
-	if (mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd),
+        /* enqueue button4/5 events if mswindows_handle_mousewheel_event
+           doesn't handle the event, such as when the scrollbars are not
+           displayed */
+	if (!mswindows_handle_mousewheel_event (mswindows_find_frame (hwnd),
 					       keys, delta,
 					       MAKEPOINTS (lParam)))
-	  /* We are not in a modal loop so no pumping is necessary. */
-	  break;
-	else
-	  goto defproc;
+          mswindows_enqueue_mouse_button_event (hwnd, message_,
+                                                MAKEPOINTS (lParam),
+                                                wParam,
+                                                GetMessageTime());
+        /* We are not in a modal loop so no pumping is necessary. */
+        break;
       }
 #endif