Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b7a08c92
Commit
b7a08c92
authored
Mar 01, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/button: Do not select old font back after painting.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ab3c0a3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
button.c
dlls/user32/button.c
+2
-3
msg.c
dlls/user32/tests/msg.c
+2
-4
No files found.
dlls/user32/button.c
View file @
b7a08c92
...
@@ -1096,7 +1096,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1096,7 +1096,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
DRAWITEMSTRUCT
dis
;
DRAWITEMSTRUCT
dis
;
LONG_PTR
id
=
GetWindowLongPtrW
(
hwnd
,
GWLP_ID
);
LONG_PTR
id
=
GetWindowLongPtrW
(
hwnd
,
GWLP_ID
);
HWND
parent
;
HWND
parent
;
HFONT
hFont
,
hPrevFont
=
0
;
HFONT
hFont
;
HRGN
hrgn
;
HRGN
hrgn
;
dis
.
CtlType
=
ODT_BUTTON
;
dis
.
CtlType
=
ODT_BUTTON
;
...
@@ -1111,7 +1111,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1111,7 +1111,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
dis
.
itemData
=
0
;
dis
.
itemData
=
0
;
GetClientRect
(
hwnd
,
&
dis
.
rcItem
);
GetClientRect
(
hwnd
,
&
dis
.
rcItem
);
if
((
hFont
=
get_button_font
(
hwnd
)))
hPrevFont
=
SelectObject
(
hDC
,
hFont
);
if
((
hFont
=
get_button_font
(
hwnd
)))
SelectObject
(
hDC
,
hFont
);
parent
=
GetParent
(
hwnd
);
parent
=
GetParent
(
hwnd
);
if
(
!
parent
)
parent
=
hwnd
;
if
(
!
parent
)
parent
=
hwnd
;
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
SendMessageW
(
parent
,
WM_CTLCOLORBTN
,
(
WPARAM
)
hDC
,
(
LPARAM
)
hwnd
);
...
@@ -1119,7 +1119,6 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
...
@@ -1119,7 +1119,6 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
hrgn
=
set_control_clipping
(
hDC
,
&
dis
.
rcItem
);
hrgn
=
set_control_clipping
(
hDC
,
&
dis
.
rcItem
);
SendMessageW
(
GetParent
(
hwnd
),
WM_DRAWITEM
,
id
,
(
LPARAM
)
&
dis
);
SendMessageW
(
GetParent
(
hwnd
),
WM_DRAWITEM
,
id
,
(
LPARAM
)
&
dis
);
if
(
hPrevFont
)
SelectObject
(
hDC
,
hPrevFont
);
SelectClipRgn
(
hDC
,
hrgn
);
SelectClipRgn
(
hDC
,
hrgn
);
if
(
hrgn
)
DeleteObject
(
hrgn
);
if
(
hrgn
)
DeleteObject
(
hrgn
);
}
}
dlls/user32/tests/msg.c
View file @
b7a08c92
...
@@ -6466,15 +6466,13 @@ static void test_button_messages(void)
...
@@ -6466,15 +6466,13 @@ static void test_button_messages(void)
prevfont
=
SelectObject
(
hdc
,
hfont2
);
prevfont
=
SelectObject
(
hdc
,
hfont2
);
ok
(
prevfont
==
GetStockObject
(
SYSTEM_FONT
),
"Unexpected default font
\n
"
);
ok
(
prevfont
==
GetStockObject
(
SYSTEM_FONT
),
"Unexpected default font
\n
"
);
SendMessageA
(
hwnd
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
0
);
SendMessageA
(
hwnd
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
0
);
todo_wine
ok
(
hfont2
!=
GetCurrentObject
(
hdc
,
OBJ_FONT
),
"button[%u]: unexpected font selected after WM_PRINTCLIENT
\n
"
,
i
);
ok
(
GetStockObject
(
SYSTEM_FONT
)
==
GetCurrentObject
(
hdc
,
OBJ_FONT
),
"button[%u]: unexpected font selected after WM_PRINTCLIENT
\n
"
,
i
);
SelectObject
(
hdc
,
prevfont
);
SelectObject
(
hdc
,
prevfont
);
prevfont
=
SelectObject
(
hdc
,
hfont2
);
prevfont
=
SelectObject
(
hdc
,
hfont2
);
ok
(
prevfont
==
GetStockObject
(
SYSTEM_FONT
),
"Unexpected default font
\n
"
);
ok
(
prevfont
==
GetStockObject
(
SYSTEM_FONT
),
"Unexpected default font
\n
"
);
SendMessageA
(
hwnd
,
WM_PAINT
,
(
WPARAM
)
hdc
,
0
);
SendMessageA
(
hwnd
,
WM_PAINT
,
(
WPARAM
)
hdc
,
0
);
todo_wine
ok
(
hfont2
!=
GetCurrentObject
(
hdc
,
OBJ_FONT
),
"button[%u]: unexpected font selected after WM_PAINT
\n
"
,
i
);
ok
(
GetStockObject
(
SYSTEM_FONT
)
==
GetCurrentObject
(
hdc
,
OBJ_FONT
),
"button[%u]: unexpected font selected after WM_PAINT
\n
"
,
i
);
SelectObject
(
hdc
,
prevfont
);
SelectObject
(
hdc
,
prevfont
);
DeleteDC
(
hdc
);
DeleteDC
(
hdc
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment