Module: wine
Branch: master
Commit: 64ecb3648ec5f900989829cef9d9cf2381800dd0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=64ecb3648ec5f900989829ce…
Author: Nikolay Sivov <nsivov(a)codeweavers.com>
Date: Mon Apr 2 16:37:32 2018 +0300
comctl32/static: Remove some misleading comments.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/comctl32/static.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
index d9e2fe3..5cc02ce 100644
--- a/dlls/comctl32/static.c
+++ b/dlls/comctl32/static.c
@@ -18,11 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Notes:
- * - Windows XP introduced new behavior: The background of centered
- * icons and bitmaps is painted differently. This is only done if
- * a manifest is present.
- * Because it has not yet been decided how to implement the two
- * different modes in Wine, only the Windows XP mode is implemented.
* - Controls with SS_SIMPLE but without SS_NOPREFIX:
* The text should not be changed. Windows doesn't clear the
* client rectangle, so the new text must be larger than the old one.
@@ -701,7 +696,6 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
HBITMAP hBitmap, oldbitmap;
HBRUSH hbrush;
- /* message is still sent, even if the returned brush is not used */
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
if ((hBitmap = (HBITMAP)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))
Module: wine
Branch: master
Commit: 927956db67544d84da6dc27922bb64ebd31f64aa
URL: https://source.winehq.org/git/wine.git/?a=commit;h=927956db67544d84da6dc279…
Author: Nikolay Sivov <nsivov(a)codeweavers.com>
Date: Mon Apr 2 16:35:44 2018 +0300
user32/static: Use correct brush color for centered image background.
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/user32/static.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/static.c b/dlls/user32/static.c
index 11b04fc..1f7c031 100644
--- a/dlls/user32/static.c
+++ b/dlls/user32/static.c
@@ -18,11 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Notes:
- * - Windows XP introduced new behavior: The background of centered
- * icons and bitmaps is painted differently. This is only done if
- * a manifest is present.
- * Because it has not yet been decided how to implement the two
- * different modes in Wine, only the Windows XP mode is implemented.
* - Controls with SS_SIMPLE but without SS_NOPREFIX:
* The text should not be changed. Windows doesn't clear the
* client rectangle, so the new text must be larger than the old one.
@@ -737,10 +732,9 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
{
HDC hMemDC;
HBITMAP hBitmap, oldbitmap;
- HBRUSH hbrush;
/* message is still sent, even if the returned brush is not used */
- hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
+ STATIC_SendWmCtlColorStatic(hwnd, hdc);
if ((hBitmap = (HBITMAP)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))
&& (GetObjectType(hBitmap) == OBJ_BITMAP)
@@ -748,26 +742,23 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
{
BITMAP bm;
RECT rcClient;
- LOGBRUSH brush;
GetObjectW(hBitmap, sizeof(bm), &bm);
oldbitmap = SelectObject(hMemDC, hBitmap);
- /* Set the background color for monochrome bitmaps
- to the color of the background brush */
- if (GetObjectW( hbrush, sizeof(brush), &brush ))
- {
- if (brush.lbStyle == BS_SOLID)
- SetBkColor(hdc, brush.lbColor);
- }
GetClientRect(hwnd, &rcClient);
if (style & SS_CENTERIMAGE)
{
- FillRect( hdc, &rcClient, hbrush );
+ HBRUSH hbrush = CreateSolidBrush(GetPixel(hMemDC, 0, 0));
+
+ FillRect(hdc, &rcClient, hbrush);
+
rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
rcClient.right = rcClient.left + bm.bmWidth;
rcClient.bottom = rcClient.top + bm.bmHeight;
+
+ DeleteObject(hbrush);
}
StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
rcClient.bottom - rcClient.top, hMemDC,