Author: jimtabor
Date: Tue Sep 1 01:48:37 2015
New Revision: 68889
URL:
http://svn.reactos.org/svn/reactos?rev=68889&view=rev
Log:
[Win32k]
- Fix more ATI issues, pass more related tests. See CORE-6551.
Modified:
trunk/reactos/win32ss/user/ntuser/input.c
trunk/reactos/win32ss/user/ntuser/msgqueue.c
Modified: trunk/reactos/win32ss/user/ntuser/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/input.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/input.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/input.c [iso-8859-1] Tue Sep 1 01:48:37 2015
@@ -492,16 +492,6 @@
ptiTo->MessageQueue->iCursorLevel -= ptiFrom->iCursorLevel;
- // FIXME: conditions?
- if (ptiTo->MessageQueue == gpqForeground)
- {
- ERR("ptiTo is Foreground\n");
- }
- else
- {
- ERR("ptiTo NOT Foreground\n");
- }
-
if (ptiFrom->MessageQueue == gpqForeground)
{
ERR("ptiFrom is Foreground\n");
@@ -517,6 +507,10 @@
else
{
ERR("ptiFrom NOT Foreground\n");
+ if ( ptiTo->MessageQueue->spwndActive == 0 )
+ ptiTo->MessageQueue->spwndActive =
ptiFrom->MessageQueue->spwndActive;
+ if ( ptiTo->MessageQueue->spwndFocus == 0 )
+ ptiTo->MessageQueue->spwndFocus =
ptiFrom->MessageQueue->spwndFocus;
}
CurIcon = ptiFrom->MessageQueue->CursorObject;
@@ -584,6 +578,9 @@
if (ptiTo->MessageQueue == ptiFrom->MessageQueue)
{
+ PWND spwndActive = ptiTo->MessageQueue->spwndActive;
+ PWND spwndFocus = ptiTo->MessageQueue->spwndFocus;
+
if (gptiForeground == ptiFrom)
{
ERR("ptiTo is now pti FG.\n");
@@ -598,6 +595,22 @@
ptiFrom->MessageQueue = MsqCreateMessageQueue(ptiFrom);
+ if (spwndActive)
+ {
+ if (spwndActive->head.pti == ptiFrom)
+ {
+ ptiFrom->MessageQueue->spwndActive = spwndActive;
+ ptiTo->MessageQueue->spwndActive = 0;
+ }
+ }
+ if (spwndFocus)
+ {
+ if (spwndFocus->head.pti == ptiFrom)
+ {
+ ptiFrom->MessageQueue->spwndFocus = spwndFocus;
+ ptiTo->MessageQueue->spwndFocus = 0;
+ }
+ }
ptiTo->MessageQueue->iCursorLevel -= ptiFrom->iCursorLevel;
}
else
@@ -610,6 +623,8 @@
ATM which one?
*/
RtlCopyMemory(ptiTo->MessageQueue->afKeyState, gafAsyncKeyState,
sizeof(gafAsyncKeyState));
+
+ ptiTo->MessageQueue->msgDblClk.message = 0;
/* Generate mouse move message */
msg.message = WM_MOUSEMOVE;
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Tue Sep 1 01:48:37 2015
@@ -639,7 +639,13 @@
return;
}
- MessageQueue->ptiMouse = pti;
+ // Check to see if this is attached.
+ if ( pti != MessageQueue->ptiMouse &&
+ MessageQueue->cThreads > 1 )
+ {
+ // Set the send pti to the message queue mouse pti.
+ pti = MessageQueue->ptiMouse;
+ }
if (Msg->message == WM_MOUSEMOVE)
{
@@ -1252,6 +1258,7 @@
}
Entry = Entry->Flink;
}
+ break;
}
if (WaitStatus == STATUS_USER_APC) break;
@@ -1413,7 +1420,7 @@
}
}
-BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT last)
+BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, BOOL* NotForUs, UINT
first, UINT last)
{
MSG clk_msg;
POINT pt;
@@ -1454,11 +1461,21 @@
TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest);
// Null window or not the same "Hardware" message queue.
- if (pwndMsg == NULL || pwndMsg->head.pti->MessageQueue !=
pti->MessageQueue)
+ if (pwndMsg == NULL || pwndMsg->head.pti->MessageQueue != MessageQueue)
{
// Crossing a boundary, so set cursor. See default message queue cursor.
UserSetCursor(SYSTEMCUR(ARROW), FALSE);
/* Remove and ignore the message */
+ *RemoveMessages = TRUE;
+ return FALSE;
+ }
+
+ // Check to see if this is attached,
+ if ( pwndMsg->head.pti != pti && // window thread is not current,
+ MessageQueue->cThreads > 1 ) // and is attached...
+ {
+ // This is not for us and we should leave so the other thread can check for
messages!!!
+ *NotForUs = TRUE;
*RemoveMessages = TRUE;
return FALSE;
}
@@ -1795,11 +1812,11 @@
return Ret;
}
-BOOL co_IntProcessHardwareMessage(MSG* Msg, BOOL* RemoveMessages, UINT first, UINT last)
+BOOL co_IntProcessHardwareMessage(MSG* Msg, BOOL* RemoveMessages, BOOL* NotForUs, UINT
first, UINT last)
{
if ( IS_MOUSE_MESSAGE(Msg->message))
{
- return co_IntProcessMouseMessage(Msg, RemoveMessages, first, last);
+ return co_IntProcessMouseMessage(Msg, RemoveMessages, NotForUs, first, last);
}
else if ( IS_KBD_MESSAGE(Msg->message))
{
@@ -1835,7 +1852,7 @@
IN UINT QSflags,
OUT MSG* pMsg)
{
- BOOL AcceptMessage;
+ BOOL AcceptMessage, NotForUs;
PUSER_MESSAGE CurrentMessage;
PLIST_ENTRY ListHead;
MSG msg;
@@ -1858,7 +1875,7 @@
if (MessageQueue->ptiSysLock != pti)
{
- ERR("MsqPeekHardwareMessage: Thread Q is locked to another pti!\n");
+ ERR("Thread Q is locked to ptiSysLock 0x%p pti
0x%p\n",MessageQueue->ptiSysLock,pti);
return FALSE;
}
@@ -1891,8 +1908,10 @@
msg = CurrentMessage->Msg;
QS_Flags = CurrentMessage->QS_Flags;
+ NotForUs = FALSE;
+
UpdateKeyStateFromMsg(MessageQueue, &msg);
- AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove,
MsgFilterLow, MsgFilterHigh);
+ AcceptMessage = co_IntProcessHardwareMessage(&msg, &Remove,
&NotForUs, MsgFilterLow, MsgFilterHigh);
if (Remove)
{
@@ -1905,6 +1924,12 @@
}
MessageQueue->idSysPeek = idSave;
+
+ if (NotForUs)
+ {
+ Ret = FALSE;
+ break;
+ }
if (AcceptMessage)
{