mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 03:53:01 -05:00
"Derek" points out that reporting of wheel event coordinates to the host on
Windows was relative to the screen origin, not the window origin. [originally from svn r8375]
This commit is contained in:
parent
0e202b3dcc
commit
8d19864dc9
@ -3046,16 +3046,22 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
|
|
||||||
if (send_raw_mouse &&
|
if (send_raw_mouse &&
|
||||||
!(cfg.mouse_override && shift_pressed)) {
|
!(cfg.mouse_override && shift_pressed)) {
|
||||||
/* send a mouse-down followed by a mouse up */
|
/* Mouse wheel position is in screen coordinates for
|
||||||
term_mouse(term, b, translate_button(b),
|
* some reason */
|
||||||
MA_CLICK,
|
POINT p;
|
||||||
TO_CHR_X(X_POS(lParam)),
|
p.x = X_POS(lParam); p.y = Y_POS(lParam);
|
||||||
TO_CHR_Y(Y_POS(lParam)), shift_pressed,
|
if (ScreenToClient(hwnd, &p)) {
|
||||||
control_pressed, is_alt_pressed());
|
/* send a mouse-down followed by a mouse up */
|
||||||
term_mouse(term, b, translate_button(b),
|
term_mouse(term, b, translate_button(b),
|
||||||
MA_RELEASE, TO_CHR_X(X_POS(lParam)),
|
MA_CLICK,
|
||||||
TO_CHR_Y(Y_POS(lParam)), shift_pressed,
|
TO_CHR_X(p.x),
|
||||||
control_pressed, is_alt_pressed());
|
TO_CHR_Y(p.y), shift_pressed,
|
||||||
|
control_pressed, is_alt_pressed());
|
||||||
|
term_mouse(term, b, translate_button(b),
|
||||||
|
MA_RELEASE, TO_CHR_X(p.x),
|
||||||
|
TO_CHR_Y(p.y), shift_pressed,
|
||||||
|
control_pressed, is_alt_pressed());
|
||||||
|
} /* else: not sure when this can fail */
|
||||||
} else {
|
} else {
|
||||||
/* trigger a scroll */
|
/* trigger a scroll */
|
||||||
term_scroll(term, 0,
|
term_scroll(term, 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user