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;
Author: hbelusca
Date: Thu Apr 16 23:08:19 2015
New Revision: 67217
URL: http://svn.reactos.org/svn/reactos?rev=67217&view=rev
Log:
[CONSRV]: GUI frontend: support the 3rd and 4th mouse button.
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.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] Thu Apr 16 23:08:19 2015
@@ -1498,19 +1498,20 @@
BOOL Err = FALSE;
PCONSRV_CONSOLE Console = GuiData->Console;
- // FIXME: It's here that we need to check whether we has focus or not
- // and whether we are in edit mode or not, to know if we need to deal
- // with the mouse, or not.
+ // 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.
if (GuiData->IgnoreNextMouseSignal)
{
if (msg != WM_LBUTTONDOWN &&
msg != WM_MBUTTONDOWN &&
- msg != WM_RBUTTONDOWN)
+ msg != WM_RBUTTONDOWN &&
+ msg != WM_XBUTTONDOWN)
{
/*
* If this mouse signal is not a button-down action
- * then it is the last signal being ignored.
+ * then this is the last one being ignored.
*/
GuiData->IgnoreNextMouseSignal = FALSE;
}
@@ -1672,6 +1673,26 @@
dwEventFlags = 0;
break;
+ case WM_XBUTTONDOWN:
+ {
+ /* Get which X-button was pressed */
+ WORD wButton = GET_XBUTTON_WPARAM(wParam);
+
+ /* Check for X-button validity */
+ if (wButton & ~(XBUTTON1 | XBUTTON2))
+ {
+ DPRINT1("X-button 0x%04x invalid\n", wButton);
+ Err = TRUE;
+ break;
+ }
+
+ SetCapture(GuiData->hWindow);
+ dwButtonState = (wButton == XBUTTON1 ? FROM_LEFT_3RD_BUTTON_PRESSED
+ : FROM_LEFT_4TH_BUTTON_PRESSED);
+ dwEventFlags = 0;
+ break;
+ }
+
case WM_LBUTTONUP:
ReleaseCapture();
dwButtonState = 0;
@@ -1690,6 +1711,24 @@
dwEventFlags = 0;
break;
+ case WM_XBUTTONUP:
+ {
+ /* Get which X-button was released */
+ WORD wButton = GET_XBUTTON_WPARAM(wParam);
+
+ /* Check for X-button validity */
+ if (wButton & ~(XBUTTON1 | XBUTTON2))
+ {
+ DPRINT1("X-button 0x%04x invalid\n", wButton);
+ /* Ok, just release the button anyway... */
+ }
+
+ ReleaseCapture();
+ dwButtonState = 0;
+ dwEventFlags = 0;
+ break;
+ }
+
case WM_LBUTTONDBLCLK:
dwButtonState = FROM_LEFT_1ST_BUTTON_PRESSED;
dwEventFlags = DOUBLE_CLICK;
@@ -1704,6 +1743,25 @@
dwButtonState = RIGHTMOST_BUTTON_PRESSED;
dwEventFlags = DOUBLE_CLICK;
break;
+
+ case WM_XBUTTONDBLCLK:
+ {
+ /* Get which X-button was double-clicked */
+ WORD wButton = GET_XBUTTON_WPARAM(wParam);
+
+ /* Check for X-button validity */
+ if (wButton & ~(XBUTTON1 | XBUTTON2))
+ {
+ DPRINT1("X-button 0x%04x invalid\n", wButton);
+ Err = TRUE;
+ break;
+ }
+
+ dwButtonState = (wButton == XBUTTON1 ? FROM_LEFT_3RD_BUTTON_PRESSED
+ : FROM_LEFT_4TH_BUTTON_PRESSED);
+ dwEventFlags = DOUBLE_CLICK;
+ break;
+ }
case WM_MOUSEMOVE:
dwButtonState = 0;
@@ -1734,6 +1792,7 @@
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
+ case WM_XBUTTONDOWN:
GuiData->IgnoreNextMouseSignal = TRUE;
default:
break;
@@ -1747,6 +1806,10 @@
dwButtonState |= FROM_LEFT_2ND_BUTTON_PRESSED;
if (wKeyState & MK_RBUTTON)
dwButtonState |= RIGHTMOST_BUTTON_PRESSED;
+ if (wKeyState & MK_XBUTTON1)
+ dwButtonState |= FROM_LEFT_3RD_BUTTON_PRESSED;
+ if (wKeyState & MK_XBUTTON2)
+ dwButtonState |= FROM_LEFT_4TH_BUTTON_PRESSED;
if (GetKeyState(VK_RMENU) & 0x8000)
dwControlKeyState |= RIGHT_ALT_PRESSED;
@@ -2263,12 +2326,15 @@
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
+ case WM_XBUTTONDOWN:
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP:
+ case WM_XBUTTONUP:
case WM_LBUTTONDBLCLK:
case WM_MBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
+ case WM_XBUTTONDBLCLK:
case WM_MOUSEMOVE:
case WM_MOUSEWHEEL:
case WM_MOUSEHWHEEL: