* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: focus.c,v 1.9 2004/01/12 20:51:05 gvg Exp $
+ * $Id: focus.c,v 1.10 2004/01/15 21:00:49 gvg Exp $
*/
#include <win32k/win32k.h>
(WPARAM)hWnd, 0);
}
- WinPosSetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ if (NtUserGetWindow(hWnd, GW_HWNDPREV) != NULL)
+ WinPosSetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
/* FIXME: IntIsWindow */
hWndPrev = PrevForegroundQueue->ActiveWindow;
}
-/*
- if (IntIsDesktopWindow(Window))
- {
- IntSendDeactivateMessages(hWndPrev, hWnd);
- IntSetFocusMessageQueue(NULL);
- }
-*/
-
if (hWndPrev == hWnd)
{
DPRINT("Failed - Same\n");
/* FIXME: Call hooks. */
IntSetFocusMessageQueue(Window->MessageQueue);
-/* ExAcquireFastMutex(&Window->MessageQueue->Lock);*/
+ ExAcquireFastMutex(&Window->MessageQueue->Lock);
if (Window->MessageQueue)
{
Window->MessageQueue->ActiveWindow = hWnd;
}
-/* ExReleaseFastMutex(&Window->MessageQueue->Lock);*/
-/* ExAcquireFastMutex(&FocusWindow->MessageQueue->Lock);*/
+ ExReleaseFastMutex(&Window->MessageQueue->Lock);
+ ExAcquireFastMutex(&FocusWindow->MessageQueue->Lock);
if (FocusWindow->MessageQueue)
{
FocusWindow->MessageQueue->FocusWindow = hWndFocus;
}
-/* ExReleaseFastMutex(&Window->MessageQueue->Lock);*/
+ ExReleaseFastMutex(&Window->MessageQueue->Lock);
IntSendDeactivateMessages(hWndPrev, hWnd);
IntSendKillFocusMessages(hWndFocusPrev, hWndFocus);
HWND Top;
PWINDOW_OBJECT TopWindow;
- Top = NtUserGetAncestor(Window->Self, GA_ROOT);
+ Top = NtUserGetAncestor(Window->Self, GA_ROOTOWNER);
if (Top != Window->Self)
{
TopWindow = IntGetWindowObject(Top);
/* FIXME: Call hooks. */
-/* ExAcquireFastMutex(&ThreadQueue->Lock);*/
+ ExAcquireFastMutex(&ThreadQueue->Lock);
ThreadQueue->ActiveWindow = hWnd;
-/* ExReleaseFastMutex(&ThreadQueue->Lock);*/
+ ExReleaseFastMutex(&ThreadQueue->Lock);
IntSendDeactivateMessages(hWndPrev, hWnd);
IntSendActivateMessages(hWndPrev, hWnd, FALSE);
return hWndPrev;
}
-/* ExAcquireFastMutex(&ThreadQueue->Lock);*/
+ ExAcquireFastMutex(&ThreadQueue->Lock);
ThreadQueue->FocusWindow = hWnd;
-/* ExReleaseFastMutex(&ThreadQueue->Lock);*/
+ ExReleaseFastMutex(&ThreadQueue->Lock);
IntSendKillFocusMessages(hWndPrev, hWnd);
IntSendSetFocusMessages(hWndPrev, hWnd);
}
hWndPrev = ThreadQueue->CaptureWindow;
IntSendMessage(hWndPrev, WM_CAPTURECHANGED, 0, (LPARAM)hWnd);
-/* ExAcquireFastMutex(&ThreadQueue->Lock);*/
+ ExAcquireFastMutex(&ThreadQueue->Lock);
ThreadQueue->CaptureWindow = hWnd;
-/* ExReleaseFastMutex(&ThreadQueue->Lock);*/
+ ExReleaseFastMutex(&ThreadQueue->Lock);
return hWndPrev;
}