Author: hbelusca Date: Fri Apr 17 00:01:37 2015 New Revision: 67218
URL: http://svn.reactos.org/svn/reactos?rev=67218&view=rev Log: [CONSRV]: Addendum to r63792: use a separate flag to filter the next-mouse-move event that MUST NOT appear before a button-up event (this appears to be somewhat VM-dependent). See code and CORE-8394 for more details.
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c [iso-8859-1] Fri Apr 17 00:01:37 2015 @@ -1498,6 +1498,21 @@ BOOL Err = FALSE; PCONSRV_CONSOLE Console = GuiData->Console;
+ /* + * HACK FOR CORE-8394 (Part 2): + * + * Check whether we should ignore the next mouse move event. + * In either case we reset the HACK flag. + * + * See Part 1 of this hack below. + */ + if (GuiData->HackCORE8394IgnoreNextMove && msg == WM_MOUSEMOVE) + { + GuiData->HackCORE8394IgnoreNextMove = FALSE; + goto Quit; + } + GuiData->HackCORE8394IgnoreNextMove = FALSE; + // FIXME: It's here that we need to check whether we have focus or not // and whether we are or not in edit mode, in order to know if we need // to deal with the mouse. @@ -1784,8 +1799,17 @@ }
/* - * HACK FOR CORE-8394: Ignore the next mouse move signal - * just after mouse down click actions. + * HACK FOR CORE-8394 (Part 1): + * + * It appears that depending on which VM ReactOS runs, the next mouse + * signal coming after a button-down action can be a mouse-move (e.g. + * on VBox, whereas on QEMU it is not the case). However it is NOT a + * rule, so that we cannot use the IgnoreNextMouseSignal flag to just + * "ignore" the next mouse event, thinking it would always be a mouse- + * move signal. + * + * 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. */ switch (msg) { @@ -1793,7 +1817,7 @@ case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: case WM_XBUTTONDOWN: - GuiData->IgnoreNextMouseSignal = TRUE; + GuiData->HackCORE8394IgnoreNextMove = TRUE; default: break; }
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h [iso-8859-1] Fri Apr 17 00:01:37 2015 @@ -65,7 +65,9 @@ /*** The following may be put per-screen-buffer !! ***/ HCURSOR hCursor; /* Handle to the mouse cursor */ INT MouseCursorRefCount; /* The reference counter associated with the mouse cursor. >= 0 and the cursor is shown; < 0 and the cursor is hidden. */ - BOOL IgnoreNextMouseSignal; /* Used in cases where we don't want to treat a mouse signal */ + BOOL IgnoreNextMouseSignal; /* Used when we need to not process a mouse signal */ + + BOOL HackCORE8394IgnoreNextMove; /* HACK FOR CORE-8394. See conwnd.c!OnMouse for more details. */
BOOL IsCloseButtonEnabled; /* TRUE if the Close button and the corresponding system menu item are enabled (default), FALSE otherwise */ UINT CmdIdLow ; /* Lowest menu id of the user-reserved menu id range */
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv/... ============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Fri Apr 17 00:01:37 2015 @@ -564,6 +564,8 @@
/* A priori don't ignore mouse signals */ GuiData->IgnoreNextMouseSignal = FALSE; + /* Initialize HACK FOR CORE-8394. See conwnd.c!OnMouse for more details. */ + GuiData->HackCORE8394IgnoreNextMove = FALSE;
/* Close button and the corresponding system menu item are enabled by default */ GuiData->IsCloseButtonEnabled = TRUE;