[CONSRV] Work-around buggy WM_MOUSEMOVE events received when VBox Mouse Integration is enabled. (#5441)

CORE-8394

These caused the "Ignore-next-mouse-event" mechanism of the console
(used e.g. in QuickEdit mode for not triggering the appearance of the
context menu, etc.) to not work.

Please note that these buggy events, that arise when testing ReactOS
in VirtualBox with Mouse Integration is enabled, do not show up when
running instead Windows (2003, ...) in the same configured VM.

Addendum to commits ac51557 (r63792) and 33d8a4b (r67218).

Improved fix for the one reported in PR #5406 by contributor 'whindsaks',
as it keeps the separation between the flag that manages the working-around
of the bug, and the other flag that is used for ignoring the genuine next
mouse event that follows mouse-button-down events.
This commit is contained in:
Hermès Bélusca-Maïto 2023-07-13 23:00:05 +02:00
parent 8dd3af6d31
commit 97277b4deb
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -1778,6 +1778,29 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
DoDefault = TRUE; // FALSE; DoDefault = TRUE; // FALSE;
break; break;
} }
/*
* HACK FOR CORE-8394 (Part 1):
*
* It appears that when running ReactOS on VBox with Mouse Integration
* enabled, the next mouse event coming after a button-down action is
* a mouse-move. However it is NOT always a rule, so that we cannot use
* the IgnoreNextMouseEvent flag to just "ignore" the next mouse event,
* thinking it would always be a mouse-move event.
*
* To work around this problem (that should really be fixed in Win32k),
* we use a second flag to ignore this possible next mouse move event.
*/
switch (msg)
{
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_XBUTTONDOWN:
GuiData->HackCORE8394IgnoreNextMove = TRUE;
default:
break;
}
} }
else if (GetConsoleInputBufferMode(Console) & ENABLE_MOUSE_INPUT) else if (GetConsoleInputBufferMode(Console) & ENABLE_MOUSE_INPUT)
{ {
@ -1920,15 +1943,14 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
/* /*
* HACK FOR CORE-8394 (Part 1): * HACK FOR CORE-8394 (Part 1):
* *
* It appears that depending on which VM ReactOS runs, the next mouse * It appears that when running ReactOS on VBox with Mouse Integration
* signal coming after a button-down action can be a mouse-move (e.g. * enabled, the next mouse event coming after a button-down action is
* on VBox, whereas on QEMU it is not the case). However it is NOT a * a mouse-move. However it is NOT always a rule, so that we cannot use
* rule, so that we cannot use the IgnoreNextMouseSignal flag to just * the IgnoreNextMouseEvent flag to just "ignore" the next mouse event,
* "ignore" the next mouse event, thinking it would always be a mouse- * thinking it would always be a mouse-move event.
* move signal.
* *
* To work around this problem (that should really be fixed in Win32k), * To work around this problem (that should really be fixed in Win32k),
* we use a second flag to ignore this possible next mouse move signal. * we use a second flag to ignore this possible next mouse move event.
*/ */
switch (msg) switch (msg)
{ {