From fc99fd13d2f7ee1b2e3a5f7416911e9dd1cef520 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 5 Dec 2011 01:09:25 +0000 Subject: [PATCH] [Win32k] - Fix more set active window API tests. The window postion change message with fixed lparam is erroneous. How can the address be the same since it originates from kernel space? svn path=/trunk/; revision=54596 --- reactos/include/reactos/win32k/ntuser.h | 7 +++++++ reactos/subsystems/win32/win32k/ntuser/focus.c | 3 ++- reactos/subsystems/win32/win32k/ntuser/winsta.c | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index ab5d448239f..ea790bdda78 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -815,6 +815,13 @@ typedef struct tagDPISERVERINFO UINT wMaxBtnSize; /* 014 */ } DPISERVERINFO, *PDPISERVERINFO; +// PUSIFlags: +#define PUSIF_PALETTEDISPLAY 0x01 +#define PUSIF_SNAPTO 0x02 +#define PUSIF_COMBOBOXANIMATION 0x04 +#define PUSIF_LISTBOXSMOOTHSCROLLING 0x08 +#define PUSIF_KEYBOARDCUES 0x20 + typedef struct _PERUSERSERVERINFO { INT aiSysMet[SM_CMETRICS]; diff --git a/reactos/subsystems/win32/win32k/ntuser/focus.c b/reactos/subsystems/win32/win32k/ntuser/focus.c index 1ae24a8fd66..d4e26400c62 100644 --- a/reactos/subsystems/win32/win32k/ntuser/focus.c +++ b/reactos/subsystems/win32/win32k/ntuser/focus.c @@ -63,7 +63,8 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) if (WindowPrev) UserRefObjectCo(WindowPrev, &RefPrev); /* Send palette messages */ - if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) + if (gpsi->PUSIFlags & PUSIF_PALETTEDISPLAY && + co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) { UserSendNotifyMessage( HWND_BROADCAST, WM_PALETTEISCHANGING, diff --git a/reactos/subsystems/win32/win32k/ntuser/winsta.c b/reactos/subsystems/win32/win32k/ntuser/winsta.c index d6029f7e1ad..22dbff14b14 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winsta.c +++ b/reactos/subsystems/win32/win32k/ntuser/winsta.c @@ -306,6 +306,12 @@ co_IntInitializeDesktopGraphics(VOID) gpsi->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL); gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel; gpsi->dmLogPixels = NtGdiGetDeviceCaps(ScreenDeviceContext, LOGPIXELSY); + if (NtGdiGetDeviceCaps(ScreenDeviceContext, RASTERCAPS) & RC_PALETTE) + { + gpsi->PUSIFlags |= PUSIF_PALETTEDISPLAY; + } + else + gpsi->PUSIFlags &= ~PUSIF_PALETTEDISPLAY; // Font is realized and this dc was previously set to internal DC_ATTR. gpsi->cxSysFontChar = IntGetCharDimensions(hSystemBM, &tmw, (DWORD*)&gpsi->cySysFontChar); gpsi->tmSysFont = tmw;