Skip to content

Commit e6302cc

Browse files
authored
[REGEDIT] Reduce flickering and fix rendering (reactos#7747)
JIRA issue: CORE-19970 - Fix status bar toggling. - Improve behaviour of splitter. - Add (WS_CLIPCHILDREN | WS_CLIPSIBLINGS) style to ChildWnd.
1 parent 656a5dc commit e6302cc

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

base/applications/regedit/childwnd.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <shlguid.h>
1212

1313
ChildWnd* g_pChildWnd;
14-
static int last_split;
14+
static int last_split = -1;
1515
HBITMAP SizingPattern;
1616
HBRUSH SizingBrush;
1717
WCHAR Suggestions[256];
@@ -99,16 +99,20 @@ extern void ResizeWnd(int cx, int cy)
9999
const int nButtonWidth = 44;
100100
const int nButtonHeight = 22;
101101
int cyEdge = GetSystemMetrics(SM_CYEDGE);
102-
const UINT uFlags = SWP_NOZORDER | SWP_NOACTIVATE;
103-
SetRect(&rt, 0, 0, cx, cy);
102+
const UINT uFlags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS;
103+
104104
cy = 0;
105-
if (hStatusBar != NULL)
105+
if (IsWindowVisible(hStatusBar))
106106
{
107107
GetWindowRect(hStatusBar, &rs);
108108
cy = rs.bottom - rs.top;
109109
}
110+
110111
GetWindowRect(g_pChildWnd->hAddressBtnWnd, &rb);
111112

113+
GetClientRect(g_pChildWnd->hWnd, &rt);
114+
RedrawWindow(g_pChildWnd->hWnd, &rt, NULL, RDW_INVALIDATE | RDW_NOCHILDREN);
115+
112116
g_pChildWnd->nSplitPos = ClampSplitBarX(g_pChildWnd->hWnd, g_pChildWnd->nSplitPos);
113117

114118
cx = g_pChildWnd->nSplitPos + SPLIT_WIDTH / 2;
@@ -148,7 +152,7 @@ static void draw_splitbar(HWND hWnd, int x)
148152
{
149153
RECT rt;
150154
HGDIOBJ OldObj;
151-
HDC hdc = GetDC(hWnd);
155+
HDC hdc = GetDCEx(hWnd, NULL, DCX_CACHE);
152156

153157
if(!SizingPattern)
154158
{
@@ -159,7 +163,10 @@ static void draw_splitbar(HWND hWnd, int x)
159163
{
160164
SizingBrush = CreatePatternBrush(SizingPattern);
161165
}
162-
GetClientRect(hWnd, &rt);
166+
167+
GetWindowRect(g_pChildWnd->hTreeWnd, &rt);
168+
MapWindowPoints(NULL, hWnd, (POINT *)&rt, sizeof(rt) / sizeof(POINT));
169+
163170
rt.left = x - SPLIT_WIDTH/2;
164171
rt.right = x + SPLIT_WIDTH/2+1;
165172
OldObj = SelectObject(hdc, SizingBrush);

base/applications/regedit/framewnd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,8 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
14461446
// For now, the Help dialog item is disabled because of lacking of HTML Help support
14471447
EnableMenuItem(GetMenu(hWnd), ID_HELP_HELPTOPICS, MF_BYCOMMAND | MF_GRAYED);
14481448
GetClientRect(hWnd, &rc);
1449-
CreateWindowExW(0, szChildClass, NULL, WS_CHILD | WS_VISIBLE,
1449+
CreateWindowExW(0, szChildClass, NULL,
1450+
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
14501451
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
14511452
hWnd, (HMENU)0, hInst, 0);
14521453
break;

0 commit comments

Comments
 (0)