https://git.reactos.org/?p=reactos.git;a=commitdiff;h=acf135d16d2aede3c12ed…
commit acf135d16d2aede3c12edc4ef47033baf5540751
Author: James Tabor <james.tabor(a)reactos.org>
AuthorDate: Sun Apr 5 21:11:44 2020 -0500
Commit: James Tabor <james.tabor(a)reactos.org>
CommitDate: Sun Apr 5 21:11:44 2020 -0500
[Win32SS] Fix Mask for Draw Frame States
Fixes drawing of caption bar buttons.
See CORE-8808.
---
win32ss/user/ntuser/draw.c | 25 +++++++++++++------------
win32ss/user/user32/windows/draw.c | 24 ++++++++++++------------
2 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/win32ss/user/ntuser/draw.c b/win32ss/user/ntuser/draw.c
index eb97e1e1f16..dd4a0ff4a62 100644
--- a/win32ss/user/ntuser/draw.c
+++ b/win32ss/user/ntuser/draw.c
@@ -12,6 +12,7 @@
//
#include <win32k.h>
+DBG_DEFAULT_CHANNEL(UserDefwnd);
/* These tables are used in:
* UITOOLS_DrawDiagEdge()
@@ -757,7 +758,7 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT
uFlags, BOOL
/* Ported from WINE20020904 */
BOOL FASTCALL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT uState)
{
- switch(uState & 0xff)
+ switch(uState & 0x1f)
{
case DFCS_BUTTONPUSH:
return UITOOLS95_DFC_ButtonPush(hdc, rc, uState);
@@ -771,10 +772,10 @@ BOOL FASTCALL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT
uState)
case DFCS_BUTTONRADIO:
return UITOOLS95_DFC_ButtonCheckRadio(hdc, rc, uState, TRUE);
-/*
+
default:
- DbgPrint("Invalid button state=0x%04x\n", uState);
-*/
+ ERR("Invalid button state=0x%04x\n", uState);
+
}
return FALSE;
}
@@ -787,7 +788,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT
uFlags)
RECT myr;
INT bkmode;
WCHAR Symbol;
- switch(uFlags & 0xff)
+ switch(uFlags & 0xf)
{
case DFCS_CAPTIONCLOSE:
Symbol = 'r';
@@ -805,6 +806,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT
uFlags)
Symbol = '2';
break;
default:
+ ERR("Invalid caption; flags=0x%04x\n", uFlags);
return FALSE;
}
IntDrawRectEdge(dc,r,(uFlags&DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT |
BF_MIDDLE | BF_SOFT);
@@ -854,7 +856,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT
uFlags)
RECT myr;
INT bkmode;
WCHAR Symbol;
- switch(uFlags & 0xff)
+ switch(uFlags & 0x1f)
{
case DFCS_SCROLLCOMBOBOX:
case DFCS_SCROLLDOWN:
@@ -908,6 +910,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT
uFlags)
GreDeleteObject(hFont);
return TRUE;
default:
+ ERR("Invalid scroll; flags=0x%04x\n", uFlags);
return FALSE;
}
IntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED,
(uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT);
@@ -957,7 +960,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
RECT myr;
INT cxy;
cxy = UITOOLS_MakeSquareRect(r, &myr);
- switch(uFlags & 0xff)
+ switch(uFlags & 0x1f)
{
case DFCS_MENUARROWUP:
Symbol = '5';
@@ -984,9 +987,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
break;
default:
-/*
- DbgPrint("Invalid menu; flags=0x%04x\n", uFlags);
-*/
+ ERR("Invalid menu; flags=0x%04x\n", uFlags);
return FALSE;
}
/* acquire ressources only if valid menu */
@@ -1000,8 +1001,8 @@ BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT
uFlags)
/* save font */
hOldFont = NtGdiSelectFont(dc, hFont);
- if ((uFlags & 0xff) == DFCS_MENUARROWUP ||
- (uFlags & 0xff) == DFCS_MENUARROWDOWN )
+ if ((uFlags & 0x1f) == DFCS_MENUARROWUP ||
+ (uFlags & 0x1f) == DFCS_MENUARROWDOWN )
{
#if 0
if (uFlags & DFCS_INACTIVE)
diff --git a/win32ss/user/user32/windows/draw.c b/win32ss/user/user32/windows/draw.c
index 62798c89b26..ff0fb72bff4 100644
--- a/win32ss/user/user32/windows/draw.c
+++ b/win32ss/user/user32/windows/draw.c
@@ -777,7 +777,7 @@ static BOOL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT
uFlags, BOOL R
/* Ported from WINE20020904 */
static BOOL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT uState)
{
- switch(uState & 0xff)
+ switch(uState & 0x1f)
{
case DFCS_BUTTONPUSH:
return UITOOLS95_DFC_ButtonPush(hdc, rc, uState);
@@ -791,10 +791,10 @@ static BOOL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT
uState)
case DFCS_BUTTONRADIO:
return UITOOLS95_DFC_ButtonCheckRadio(hdc, rc, uState, TRUE);
-/*
+
default:
- DbgPrint("Invalid button state=0x%04x\n", uState);
-*/
+ ERR("Invalid button state=0x%04x\n", uState);
+
}
return FALSE;
@@ -808,7 +808,7 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
RECT myr;
INT bkmode;
TCHAR Symbol;
- switch(uFlags & 0xff)
+ switch(uFlags & 0xf)
{
case DFCS_CAPTIONCLOSE:
Symbol = 'r';
@@ -826,7 +826,7 @@ static BOOL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
Symbol = '2';
break;
default:
- WARN("Invalid caption; flags=0x%04x\n", uFlags);
+ ERR("Invalid caption; flags=0x%04x\n", uFlags);
return FALSE;
}
IntDrawRectEdge(dc,r,(uFlags&DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT |
BF_MIDDLE | BF_SOFT, 1);
@@ -875,7 +875,7 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
RECT myr;
INT bkmode;
TCHAR Symbol;
- switch(uFlags & 0xff)
+ switch(uFlags & 0x1f)
{
case DFCS_SCROLLCOMBOBOX:
case DFCS_SCROLLDOWN:
@@ -929,7 +929,7 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
DeleteObject(hFont);
return TRUE;
default:
- WARN("Invalid scroll; flags=0x%04x\n", uFlags);
+ ERR("Invalid scroll; flags=0x%04x\n", uFlags);
return FALSE;
}
IntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED,
(uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, 1);
@@ -979,7 +979,7 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
RECT myr;
INT cxy;
cxy = UITOOLS_MakeSquareRect(r, &myr);
- switch(uFlags & 0xff)
+ switch(uFlags & 0x1f)
{
case DFCS_MENUARROWUP:
Symbol = '5';
@@ -1006,7 +1006,7 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
break;
default:
- WARN("Invalid menu; flags=0x%04x\n", uFlags);
+ ERR("Invalid menu; flags=0x%04x\n", uFlags);
return FALSE;
}
/* acquire ressources only if valid menu */
@@ -1020,8 +1020,8 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
/* save font */
hOldFont = SelectObject(dc, hFont);
- if ((uFlags & 0xff) == DFCS_MENUARROWUP ||
- (uFlags & 0xff) == DFCS_MENUARROWDOWN )
+ if ((uFlags & 0x1f) == DFCS_MENUARROWUP ||
+ (uFlags & 0x1f) == DFCS_MENUARROWDOWN )
{
#if 0
if (uFlags & DFCS_INACTIVE)