Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
c37dd06f
Commit
c37dd06f
authored
25 years ago
by
Francis Beaudet
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Delay WM_NCPAINT message until the "painter's algorithm" kicks in.
parent
ba296e38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/win.h
+3
-0
3 additions, 0 deletions
include/win.h
windows/painting.c
+100
-5
100 additions, 5 deletions
windows/painting.c
with
103 additions
and
5 deletions
include/win.h
+
3
−
0
View file @
c37dd06f
...
...
@@ -49,6 +49,7 @@ typedef enum
#define RDW_EX_DELETEHRGN 0x0002
#define RDW_EX_XYWINDOW 0x0004
#define RDW_EX_TOPFRAME 0x0010
#define RDW_EX_DELAY_NCPAINT 0x0020
struct
tagCLASS
;
struct
tagDCE
;
...
...
@@ -163,6 +164,8 @@ typedef struct
#define UNC_ENTIRE 0x0002
#define UNC_REGION 0x0004
#define UNC_UPDATE 0x0008
#define UNC_DELAY_NCPAINT 0x0010
#define UNC_IN_BEGINPAINT 0x0020
/* Window functions */
extern
void
WIN_Init
(
void
);
...
...
This diff is collapsed.
Click to expand it.
windows/painting.c
+
100
−
5
View file @
c37dd06f
...
...
@@ -27,6 +27,84 @@ DECLARE_DEBUG_CHANNEL(win)
#define CTLCOLOR_MAX CTLCOLOR_STATIC
/***********************************************************************
* WIN_HaveToDelayNCPAINT
*
* Currently, in the Wine painting mechanism, the WM_NCPAINT message
* is generated as soon as a region intersecting the non-client area
* of a window is invalidated.
*
* This technique will work fine for all windows whose parents
* have the WS_CLIPCHILDREN style. When the parents have that style,
* they are not going to override the contents of their children.
* However, when the parent doesn't have that style, Windows relies
* on a "painter's algorithm" to display the contents of the windows.
* That is, windows are painted from back to front. This includes the
* non-client area.
*
* This method looks at the current state of a window to determine
* if the sending of the WM_NCPAINT message should be delayed until
* the BeginPaint call.
*
* PARAMS:
* wndPtr - A Locked window pointer to the window we're
* examining.
* uncFlags - This is the flag passed to the WIN_UpdateNCRgn
* function. This is a shortcut for the cases when
* we already know when to avoid scanning all the
* parents of a window. If you already know that this
* window's NCPAINT should be delayed, set the
* UNC_DELAY_NCPAINT flag for this parameter.
*
* This shortcut behavior is implemented in the
* RDW_Paint() method.
*
*/
static
BOOL
WIN_HaveToDelayNCPAINT
(
WND
*
wndPtr
,
UINT
uncFlags
)
{
WND
*
parentWnd
=
NULL
;
/*
* Test the shortcut first. (duh)
*/
if
(
uncFlags
&
UNC_DELAY_NCPAINT
)
return
TRUE
;
/*
* The UNC_IN_BEGINPAINT flag is set in the BeginPaint
* method only. This is another shortcut to avoid going
* up the parent's chain of the window to finally
* figure-out that none of them has an invalid region.
*/
if
(
uncFlags
&
UNC_IN_BEGINPAINT
)
return
FALSE
;
/*
* Scan all the parents of this window to find a window
* that doesn't have the WS_CLIPCHILDREN style and that
* has an invalid region.
*/
parentWnd
=
WIN_LockWndPtr
(
wndPtr
->
parent
);
while
(
parentWnd
!=
NULL
)
{
if
(
((
parentWnd
->
dwStyle
&
WS_CLIPCHILDREN
)
==
0
)
&&
(
parentWnd
->
hrgnUpdate
!=
0
)
)
{
WIN_ReleaseWndPtr
(
parentWnd
);
return
TRUE
;
}
WIN_UpdateWndPtr
(
&
parentWnd
,
parentWnd
->
parent
);
}
WIN_ReleaseWndPtr
(
parentWnd
);
return
FALSE
;
}
/***********************************************************************
* WIN_UpdateNCRgn
*
...
...
@@ -72,7 +150,11 @@ HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT uncFlags )
uncFlags
|=
UNC_ENTIRE
;
}
if
(
wnd
->
flags
&
WIN_NEEDS_NCPAINT
)
/*
* If the window's non-client area needs to be painted,
*/
if
(
(
wnd
->
flags
&
WIN_NEEDS_NCPAINT
)
&&
!
WIN_HaveToDelayNCPAINT
(
wnd
,
uncFlags
)
)
{
RECT
r2
,
r3
;
...
...
@@ -184,7 +266,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
wndPtr
->
flags
&=
~
WIN_NEEDS_BEGINPAINT
;
/* send WM_NCPAINT and make sure hrgnUpdate is a valid rgn handle */
WIN_UpdateNCRgn
(
wndPtr
,
0
,
UNC_UPDATE
);
WIN_UpdateNCRgn
(
wndPtr
,
0
,
UNC_UPDATE
|
UNC_IN_BEGINPAINT
);
/*
* Make sure the window is still a window. All window locks are suspended
...
...
@@ -626,6 +708,13 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex )
TRACE_
(
win
)(
"
\t
hwnd %04x [%04x] -> hrgn [%04x], flags [%04x]
\n
"
,
hWnd
,
wndPtr
->
hrgnUpdate
,
hrgn
,
flags
);
/*
* Check if this window should delay it's processing of WM_NCPAINT.
* See WIN_HaveToDelayNCPAINT for a description of the mechanism
*/
if
((
ex
&
RDW_EX_DELAY_NCPAINT
)
||
WIN_HaveToDelayNCPAINT
(
wndPtr
,
0
)
)
ex
|=
RDW_EX_DELAY_NCPAINT
;
if
(
flags
&
RDW_UPDATENOW
)
{
if
(
wndPtr
->
hrgnUpdate
)
/* wm_painticon wparam is 1 */
...
...
@@ -634,8 +723,14 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex )
else
if
((
flags
&
RDW_ERASENOW
)
||
(
ex
&
RDW_EX_TOPFRAME
))
{
UINT
dcx
=
DCX_INTERSECTRGN
|
DCX_USESTYLE
|
DCX_KEEPCLIPRGN
|
DCX_WINDOWPAINT
|
DCX_CACHE
;
HRGN
hrgnRet
=
WIN_UpdateNCRgn
(
wndPtr
,
hrgn
,
UNC_REGION
|
UNC_CHECK
|
((
ex
&
RDW_EX_TOPFRAME
)
?
UNC_ENTIRE
:
0
)
);
HRGN
hrgnRet
;
hrgnRet
=
WIN_UpdateNCRgn
(
wndPtr
,
hrgn
,
UNC_REGION
|
UNC_CHECK
|
((
ex
&
RDW_EX_TOPFRAME
)
?
UNC_ENTIRE
:
0
)
|
((
ex
&
RDW_EX_DELAY_NCPAINT
)
?
UNC_DELAY_NCPAINT
:
0
)
);
if
(
hrgnRet
)
{
if
(
hrgnRet
>
1
)
hrgn
=
hrgnRet
;
else
hrgnRet
=
0
;
/* entire client */
...
...
@@ -678,7 +773,7 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex )
if
(
!
IsWindow
(
wndPtr
->
hwndSelf
))
continue
;
if
(
(
wndPtr
->
dwStyle
&
WS_VISIBLE
)
&&
(
wndPtr
->
hrgnUpdate
||
(
wndPtr
->
flags
&
WIN_INTERNAL_PAINT
))
)
hrgn
=
RDW_Paint
(
wndPtr
,
hrgn
,
flags
,
ex
);
hrgn
=
RDW_Paint
(
wndPtr
,
hrgn
,
flags
,
ex
);
}
WIN_ReleaseWndPtr
(
wndPtr
);
WIN_ReleaseWinArray
(
list
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment