From 53823ab9c1100230c774fb178a3a61a42b5a64ad Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 13 Jan 2002 12:16:05 +0000 Subject: [PATCH] (parse_button): New parameter xbutton. Callers changed. (w32_read_socket): Handle new "XBUTTON" messages. --- src/w32term.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index a906c96f7f9..9fe40866edc 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -6037,9 +6037,13 @@ glyph_to_pixel_coords (w, hpos, vpos, frame_x, frame_y) return success_p; } +/* Parse a button MESSAGE. The button index is returned in PBUTTON, and + the state in PUP. XBUTTON provides extra information for extended mouse + button messages. Returns FALSE if unable to parse the message. */ BOOL -parse_button (message, pbutton, pup) +parse_button (message, xbutton, pbutton, pup) int message; + int xbutton; int * pbutton; int * pup; { @@ -6084,6 +6088,14 @@ parse_button (message, pbutton, pup) button = 1; up = 1; break; + case WM_XBUTTONDOWN: + button = xbutton + 2; + up = 0; + break; + case WM_XBUTTONUP: + button = xbutton + 2; + up = 1; + break; default: return (FALSE); } @@ -6109,7 +6121,8 @@ construct_mouse_click (result, msg, f) int button; int up; - parse_button (msg->msg.message, &button, &up); + parse_button (msg->msg.message, HIWORD (msg->msg.wParam), + &button, &up); /* Make the event type no_event; we'll change that when we decide otherwise. */ @@ -8661,6 +8674,8 @@ w32_read_socket (sd, bufp, numchars, expected) case WM_MBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: + case WM_XBUTTONDOWN: + case WM_XBUTTONUP: { /* If we decide we want to generate an event to be seen by the rest of Emacs, we put it here. */ @@ -8712,8 +8727,9 @@ w32_read_socket (sd, bufp, numchars, expected) } } - parse_button (msg.msg.message, &button, &up); - + parse_button (msg.msg.message, HIWORD (msg.msg.wParam), + &button, &up); + if (up) { dpyinfo->grabbed &= ~ (1 << button); -- 2.39.5