Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH 0/5] MR232: win32u: user32 conversion
by Jacek Caban (@jacek)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/232
June 13, 2022
Re: [PATCH 2/2] server: Correctly expose composited parent window on SetWindowPos().
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116807
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w7u_adm (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w7u_el (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w10pro64_ar (64 bit report) ===
user32:
msg.c:13148: Test failed: message time not advanced: 15762 15762
msg.c:13149: Test failed: coords not changed: (101 101) (101 101)
msg.c:13166: Test failed: message time not advanced: 15762 15762
msg.c:13167: Test failed: coords not changed: (101 101) (101 101)
June 12, 2022
Re: Having problems (re-)building i686 wine staging rpm's on fedora
by Zebediah Figura
Hello Hin-Tak,
On 6/11/22 18:35, Hin-Tak Leung wrote:
> i686-w64-mingw32-gcc -c -o dlls/windowscodecs/libjpeg.cross.o dlls/windowscodecs/libjpeg.c -Idlls/windowscodecs -Iinclude -Iinclude/msvcrt \
> -I/usr/include -I./libs/png -D__WINESRC__ -D_UCRT -D__WINE_PE_BUILD -Wall -fno-strict-aliasing \
> -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \
> -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \
> -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \
> -fno-omit-frame-pointer -gdwarf-4 -g -O2
> In file included from include/objbase.h:20,
> from dlls/windowscodecs/libjpeg.c:31:
> include/rpcndr.h:73:23: error: conflicting types for 'boolean'; have 'unsigned char'
> 73 | typedef unsigned char boolean;
> | ^~~~~~~
> In file included from /usr/include/jpeglib.h:31,
> from dlls/windowscodecs/libjpeg.c:24:
> /usr/include/jmorecfg.h:207:13: note: previous declaration of 'boolean' with type 'boolean' {aka 'int'}
> 207 | typedef int boolean;
> | ^~~~~~~
> dlls/windowscodecs/libjpeg.c: In function 'jpeg_decoder_initialize':
This should be prevented by HAVE_BOOLEAN, defined in jconfig.h for win32
targets. It seems that the host libjpeg headers are being included instead.
I have some guesses as to how this happened, but I'm not fully sure. Can
you please attach your config.log?
> A few questions/thoughts:
>
> - it seems that the build system is getting confused occasionally about say, native headers vs mingw headers like jpeg-devel; at some point, I got a error saying I was trying to build one of the unixlib.c's with mingw headers, for example. But I see for example that in the generated Makefile for dlls/windowscodecs/ , It is feeding *PE_FLAGS to unixlib.c (plus the PE stub), and I explicitly put -I...mingw32/include to *PE_FLAGS. That seems wrong.
There's no unixlib.c in windowscodecs. Are you referring to a different DLL?
What error did you get?
June 12, 2022
Re: [PATCH 1/2] user32/tests: Test for parent window exposure by SetWindowPos().
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=116806
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w7u_adm (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w7u_el (32 bit report) ===
user32:
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9316: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #2 (ex_style = 0x2000000, style = 0x2000000, region_op = 2): delta = +20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = -20: Update region shall match expected region
msg.c:9257: Test failed: 9317: SetWindowPos redraw #3 (ex_style = 0x2000000, style = 0, region_op = 2): delta = +20: Update region shall match expected region
=== w1064_adm (64 bit report) ===
user32:
msg.c:13148: Test failed: message time not advanced: d34d d34d
msg.c:13149: Test failed: coords not changed: (101 101) (101 101)
msg.c:13166: Test failed: message time not advanced: d34d d34d
msg.c:13167: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_en_AE_u8 (64 bit report) ===
user32:
msg.c:13148: Test failed: message time not advanced: 15743 15743
msg.c:13149: Test failed: coords not changed: (101 101) (101 101)
msg.c:13166: Test failed: message time not advanced: 15743 15743
msg.c:13167: Test failed: coords not changed: (101 101) (101 101)
June 12, 2022
[PATCH 2/2] server: Correctly expose composited parent window on SetWindowPos().
by Jinoh Kang
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
dlls/user32/tests/msg.c | 4 ++--
server/class.c | 5 +++++
server/user.h | 1 +
server/window.c | 28 +++++++++++++++++++++++++---
4 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 6574318845e..8f1b62ff6ae 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -9303,8 +9303,8 @@ static void test_swp_paint_regions(void)
static const struct exposure_test composited[] = {
{ 0, WS_CLIPCHILDREN, RGN_DIFF, FALSE },
{ 0, 0, RGN_DIFF, TRUE },
- { WS_EX_COMPOSITED, WS_CLIPCHILDREN, RGN_OR , TRUE },
- { WS_EX_COMPOSITED, 0, RGN_OR , TRUE },
+ { WS_EX_COMPOSITED, WS_CLIPCHILDREN, RGN_OR , FALSE },
+ { WS_EX_COMPOSITED, 0, RGN_OR , FALSE },
{ 0 }
};
subtest_swp_paint_regions( 1, "SimpleWindowClass", "SimpleWindowClass", composited );
diff --git a/server/class.c b/server/class.c
index e1e180bd97c..3231f366b26 100644
--- a/server/class.c
+++ b/server/class.c
@@ -141,6 +141,11 @@ int is_hwnd_message_class( struct window_class *class )
return (!class->local && class->atom == find_global_atom( NULL, &name ));
}
+int get_class_style( struct window_class *class )
+{
+ return class->style;
+}
+
atom_t get_class_atom( struct window_class *class )
{
return class->base_atom;
diff --git a/server/user.h b/server/user.h
index 55a0d35feff..0356fe0c5cd 100644
--- a/server/user.h
+++ b/server/user.h
@@ -175,6 +175,7 @@ extern struct window_class *grab_class( struct process *process, atom_t atom,
extern void release_class( struct window_class *class );
extern int is_desktop_class( struct window_class *class );
extern int is_hwnd_message_class( struct window_class *class );
+extern int get_class_style( struct window_class *class );
extern atom_t get_class_atom( struct window_class *class );
extern client_ptr_t get_class_client_ptr( struct window_class *class );
diff --git a/server/window.c b/server/window.c
index 7675cd1103d..02ff02f4805 100644
--- a/server/window.c
+++ b/server/window.c
@@ -1706,6 +1706,13 @@ static unsigned int get_window_update_flags( struct window *win, struct window *
}
+static int is_composited( struct window *win )
+{
+ if ((win->style & (WS_POPUP|WS_CHILD)) == WS_CHILD && (get_class_style( win->class ) & CS_PARENTDC))
+ return 0;
+ return (win->ex_style & WS_EX_COMPOSITED) != 0;
+}
+
/* expose the areas revealed by a vis region change on the window parent */
/* returns the region exposed on the window itself (in client coordinates) */
static struct region *expose_window( struct window *win, const rectangle_t *old_window_rect,
@@ -1732,13 +1739,28 @@ static struct region *expose_window( struct window *win, const rectangle_t *old_
if (win->parent && !is_desktop_window( win->parent ))
{
+ struct region *parent_expose_rgn;
+
/* make it relative to the old window pos for subtracting */
offset_region( new_vis_rgn, win->window_rect.left - old_window_rect->left,
win->window_rect.top - old_window_rect->top );
- if ((win->parent->style & WS_CLIPCHILDREN) ?
- subtract_region( new_vis_rgn, old_vis_rgn, new_vis_rgn ) :
- xor_region( new_vis_rgn, old_vis_rgn, new_vis_rgn ))
+ if (is_composited( win->parent ))
+ {
+ parent_expose_rgn = xor_region( new_vis_rgn, old_vis_rgn, new_vis_rgn );
+ if (parent_expose_rgn && !is_region_empty( parent_expose_rgn ))
+ {
+ parent_expose_rgn = union_region( new_vis_rgn, old_vis_rgn, new_vis_rgn );
+ }
+ }
+ else
+ {
+ parent_expose_rgn = (win->parent->style & WS_CLIPCHILDREN) ?
+ subtract_region( new_vis_rgn, old_vis_rgn, new_vis_rgn ) :
+ xor_region( new_vis_rgn, old_vis_rgn, new_vis_rgn );
+ }
+
+ if (parent_expose_rgn)
{
if (!is_region_empty( new_vis_rgn ))
{
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/231
June 12, 2022
[PATCH 1/2] user32/tests: Test for parent window exposure by SetWindowPos().
by Jinoh Kang
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
dlls/user32/tests/msg.c | 288 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 288 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 2705914d5e5..6574318845e 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -9035,6 +9035,288 @@ static void test_paint_messages(void)
DeleteObject( hrgn2 );
}
+static LRESULT WINAPI vis_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ HDC hdc, hdcsrc;
+ PAINTSTRUCT ps;
+ RECT rc;
+
+ switch (message)
+ {
+ case WM_ERASEBKGND:
+ return 0;
+ case WM_PAINT:
+ hdc = BeginPaint( hwnd, &ps );
+ hdcsrc = (HDC)GetWindowLongPtrA( hwnd, GWLP_USERDATA );
+ GetClientRect( hwnd, &rc );
+ BitBlt( hdc, 0, 0, rc.right, rc.bottom, hdcsrc, 0, 0, SRCCOPY );
+ EndPaint( hwnd, &ps );
+ return 0;
+ }
+
+ return DefWindowProcW(hwnd, message, wParam, lParam);
+}
+
+static void visualize_region_differences( HWND hwnd, HWND hother, HRGN hrgn_expect, HRGN hrgn_actual )
+{
+ HBRUSH b_expectonly, b_actualonly, b_intersect;
+ HRGN hrgn_intersect;
+ HWND hchild, hshow, hhide;
+ HDC hdc, hdctmp;
+ HBITMAP hbitmap;
+ MSG msg;
+ RECT rect;
+ DWORD start_time, elapsed, timeout = 60000;
+ BOOL wait = TRUE, toggle = TRUE;
+
+ GetClientRect( hwnd, &rect );
+
+ b_expectonly = CreateSolidBrush( RGB( 64, 64, 255 ));
+ b_actualonly = CreateSolidBrush( RGB( 255, 64, 64 ));
+ b_intersect = CreateSolidBrush( RGB( 159, 64, 159 ));
+
+ hrgn_intersect = CreateRectRgn( 0, 0, 0, 0 );
+ CombineRgn( hrgn_intersect, hrgn_expect, hrgn_actual, RGN_AND );
+
+ hdc = GetDC( hwnd );
+ hbitmap = CreateCompatibleBitmap( hdc, rect.right, rect.bottom );
+ hdctmp = CreateCompatibleDC( hdc );
+ SelectObject( hdctmp, hbitmap );
+
+ FillRgn( hdctmp, hrgn_expect, b_expectonly );
+ FillRgn( hdctmp, hrgn_actual, b_actualonly );
+ FillRgn( hdctmp, hrgn_intersect, b_intersect );
+
+ DeleteObject( hrgn_intersect );
+ DeleteObject( b_intersect );
+ DeleteObject( b_actualonly );
+ DeleteObject( b_expectonly );
+
+ hchild = CreateWindowExA( 0, "SimpleWindowClass", "Test child", WS_CHILD,
+ 0, 0, rect.right, rect.bottom, hwnd, 0, 0, NULL );
+ SetWindowLongPtrA( hchild, GWLP_WNDPROC, (LONG_PTR)vis_child_wnd_proc );
+ SetWindowLongPtrA( hchild, GWLP_USERDATA, (LONG_PTR)hdctmp );
+
+ hshow = hchild;
+ hhide = hother;
+
+ start_time = GetTickCount();
+ while ((elapsed = GetTickCount() - start_time) < timeout)
+ {
+ if (toggle)
+ {
+ HWND htmp;
+ if (hhide)
+ {
+ ShowWindow( hhide, SW_HIDE );
+ }
+ if (hshow)
+ {
+ SetWindowPos( hshow, HWND_TOP, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW );
+ }
+ htmp = hshow;
+ hshow = hhide;
+ hhide = htmp;
+ toggle = FALSE;
+ }
+ if (wait)
+ {
+ MsgWaitForMultipleObjects( 0, NULL, FALSE, timeout - elapsed, QS_ALLINPUT );
+ wait = FALSE;
+ continue;
+ }
+ if (!PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
+ {
+ wait = TRUE;
+ continue;
+ }
+ TranslateMessage( &msg );
+ DispatchMessageA( &msg );
+ if (msg.message == WM_MOUSEMOVE)
+ {
+ start_time = GetTickCount();
+ }
+ else if (msg.message == WM_LBUTTONUP)
+ {
+ toggle = TRUE;
+ }
+ else if (msg.message == WM_RBUTTONUP)
+ {
+ break;
+ }
+ }
+
+ DestroyWindow( hchild );
+
+ DeleteObject( hdctmp );
+ DeleteObject( hbitmap );
+}
+
+struct exposure_test {
+ int ex_style;
+ int style;
+ int region_op;
+ BOOL todo;
+};
+
+#define subtest_swp_paint_regions(w,p,c,t) subtest_swp_paint_regions_(__LINE__,w,p,c,t)
+
+static void subtest_swp_paint_regions_( int line, int wrap_toplevel, LPCSTR parent_class, LPCSTR child_class, const struct exposure_test *exposure_tests )
+{
+ const struct exposure_test *extest;
+ HWND htoplevel = NULL, hparent, hchild;
+ RECT rect_old = { 10, 10, 100, 100 }, rect_cli;
+ HRGN hrgn_clip;
+ HRGN hrgn_old = CreateRectRgnIndirect( &rect_old );
+ HRGN hrgn_new = CreateRectRgn( 0, 0, 0, 0 );
+ HRGN hrgn_expect = CreateRectRgn( 0, 0, 0, 0 );
+ HRGN hrgn_actual = CreateRectRgn( 0, 0, 0, 0 );
+ int base_style;
+
+ if (wrap_toplevel)
+ {
+ htoplevel = CreateWindowExA( 0, "SimpleWindowClass", "Test toplevel", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+ 100, 100, 400, 400, 0, 0, 0, NULL );
+ ok( htoplevel != 0, "Failed to create top-level window: %lu\n", GetLastError() );
+ base_style = WS_CHILD | WS_VISIBLE;
+ }
+ else
+ {
+ base_style = WS_OVERLAPPEDWINDOW | WS_VISIBLE;
+ }
+
+ hparent = CreateWindowExA( 0, parent_class, "Test parent", base_style,
+ 80, 80, 200, 200, htoplevel, 0, 0, NULL );
+ ok( hparent != 0, "Failed to create parent window (%s): %lu\n",
+ debugstr_a( parent_class ), GetLastError() );
+
+ hchild = CreateWindowExA( 0, child_class, "Test child", WS_CHILD | WS_VISIBLE | WS_BORDER,
+ rect_old.left, rect_old.top,
+ rect_old.right - rect_old.left, rect_old.bottom - rect_old.top,
+ hparent, 0, 0, NULL );
+ ok( hchild != 0, "Failed to create child window (%s): %lu\n",
+ debugstr_a( child_class ), GetLastError() );
+
+ GetClientRect( hparent, &rect_cli );
+ hrgn_clip = CreateRectRgnIndirect( &rect_cli );
+
+ for (extest = exposure_tests; extest->region_op; extest++)
+ {
+ int delta;
+
+ winetest_push_context( "%d: SetWindowPos redraw #%Id (ex_style = %#x, style = %#x, region_op = %d)",
+ line, extest - exposure_tests, extest->ex_style, extest->style, extest->region_op );
+
+ SetWindowLongA( hparent, GWL_EXSTYLE, extest->ex_style );
+ SetWindowLongA( hparent, GWL_STYLE, base_style | extest->style );
+
+ for (delta = -20; delta <= 20; delta += 20)
+ {
+ RECT rect_new = rect_old;
+ int update_region_type;
+ int rgn_equal;
+
+ winetest_push_context( "delta = %+d", delta );
+
+ OffsetRect( &rect_new, delta, delta );
+ SetRectRgn( hrgn_new, rect_new.left, rect_new.top, rect_new.right, rect_new.bottom );
+ if (EqualRect( &rect_old, &rect_new ))
+ {
+ SetRectRgn( hrgn_expect, 0, 0, 0, 0 );
+ }
+ else
+ {
+ CombineRgn( hrgn_expect, hrgn_old, hrgn_new, extest->region_op );
+ CombineRgn( hrgn_expect, hrgn_expect, hrgn_clip, RGN_AND );
+ }
+
+ SetWindowPos( hchild, 0,
+ rect_old.left,
+ rect_old.top,
+ rect_old.right - rect_old.left,
+ rect_old.bottom - rect_old.top,
+ SWP_NOACTIVATE | SWP_NOZORDER );
+
+ UpdateWindow( hparent );
+ flush_events();
+
+ SetWindowPos( hchild, 0,
+ rect_new.left,
+ rect_new.top,
+ rect_new.right - rect_new.left,
+ rect_new.bottom - rect_new.top,
+ SWP_NOACTIVATE | SWP_NOZORDER );
+
+ SetRectRgn( hrgn_actual, 0, 0, 0, 0 );
+ update_region_type = GetUpdateRgn( hparent, hrgn_actual, FALSE );
+ ok( update_region_type != ERROR, "GetUpdateRgn failed\n" );
+
+ rgn_equal = EqualRgn( hrgn_expect, hrgn_actual );
+ todo_wine_if( extest->todo && !EqualRect( &rect_old, &rect_new ) )
+ ok( !!rgn_equal, "Update region shall match expected region\n" );
+
+ flush_events();
+
+ if (!rgn_equal && winetest_debug > 0)
+ {
+ printf( "Expected update region: " );
+ dump_region( hrgn_expect );
+ printf( "Actual update region: " );
+ dump_region( hrgn_actual );
+ printf( "Old window position: " );
+ dump_region( hrgn_old );
+ printf( "New window position: " );
+ dump_region( hrgn_new );
+
+ if (winetest_interactive)
+ {
+ visualize_region_differences( hparent, hchild, hrgn_expect, hrgn_actual );
+ }
+ }
+
+ winetest_pop_context();
+ }
+
+ winetest_pop_context();
+ }
+
+ DestroyWindow( hchild );
+ DestroyWindow( hparent );
+ if (htoplevel) DestroyWindow( htoplevel );
+
+ DeleteObject( hrgn_actual );
+ DeleteObject( hrgn_expect );
+ DeleteObject( hrgn_new );
+ DeleteObject( hrgn_old );
+}
+
+static void test_swp_paint_regions(void)
+{
+ static const struct exposure_test nocomposited[] = {
+ { 0, WS_CLIPCHILDREN, RGN_DIFF, FALSE },
+ { 0, 0, RGN_DIFF, TRUE },
+ { WS_EX_COMPOSITED, WS_CLIPCHILDREN, RGN_DIFF, FALSE },
+ { WS_EX_COMPOSITED, 0, RGN_DIFF, TRUE },
+ { 0 }
+ };
+ static const struct exposure_test composited[] = {
+ { 0, WS_CLIPCHILDREN, RGN_DIFF, FALSE },
+ { 0, 0, RGN_DIFF, TRUE },
+ { WS_EX_COMPOSITED, WS_CLIPCHILDREN, RGN_OR , TRUE },
+ { WS_EX_COMPOSITED, 0, RGN_OR , TRUE },
+ { 0 }
+ };
+ subtest_swp_paint_regions( 1, "SimpleWindowClass", "SimpleWindowClass", composited );
+ subtest_swp_paint_regions( 1, "SimpleWindowClass", "SimpleWindowClassWithParentDC", composited );
+ subtest_swp_paint_regions( 1, "SimpleWindowClassWithParentDC", "SimpleWindowClass", nocomposited );
+ subtest_swp_paint_regions( 1, "SimpleWindowClassWithParentDC", "SimpleWindowClassWithParentDC", nocomposited );
+ subtest_swp_paint_regions( 0, "SimpleWindowClass", "SimpleWindowClass", composited );
+ subtest_swp_paint_regions( 0, "SimpleWindowClass", "SimpleWindowClassWithParentDC", composited );
+ subtest_swp_paint_regions( 0, "SimpleWindowClassWithParentDC", "SimpleWindowClass", composited );
+ subtest_swp_paint_regions( 0, "SimpleWindowClassWithParentDC", "SimpleWindowClassWithParentDC", composited );
+}
+
struct wnd_event
{
HWND hwnd;
@@ -10387,6 +10669,11 @@ static BOOL RegisterWindowClasses(void)
cls.lpszClassName = "TestDialogClass";
if(!RegisterClassA(&cls)) return FALSE;
+ cls.lpfnWndProc = DefWindowProcA;
+ cls.style = CS_PARENTDC;
+ cls.lpszClassName = "SimpleWindowClassWithParentDC";
+ if(!RegisterClassA(&cls)) return FALSE;
+
clsW.style = 0;
clsW.lpfnWndProc = MsgCheckProcW;
clsW.cbClsExtra = 0;
@@ -18870,6 +19157,7 @@ START_TEST(msg)
test_combobox_messages();
test_wmime_keydown_message();
test_paint_messages();
+ test_swp_paint_regions();
test_interthread_messages();
test_message_conversion();
test_accelerators();
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/231
June 12, 2022
[PATCH 0/2] MR231: user32/tests: Test for parent window exposure by SetWindowPos().
by Jinoh Kang (@iamahuman)
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/231
June 12, 2022
Re: [PATCH v2 4/5] d2d1: Implement RegisterEffectFromString().
by Nikolay Sivov
On 6/12/22 08:31, Ziqing Hui wrote:
> + if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, &stream)))
> + return hr;
> +
> + size = sizeof(*property_xml) * (wcslen(property_xml) + 1);
> + if (FAILED(hr = IStream_Write(stream, property_xml, size, NULL)))
> + goto done;
> + if (FAILED(hr = IStream_Seek(stream, zero, SEEK_SET, NULL)))
> + goto done;
> +
> + hr = ID2D1Factory3_RegisterEffectFromStream(iface, effect_id, stream, bindings, binding_count, effect_factory);
> +
> +done:
> + IStream_Release(stream);
> + return hr;
> }
This is short enough, it doesn't have to use gotos.
June 12, 2022
Re: [PATCH v2 3/5] d2d1: Implement property parsing for RegisterEffectFromStream().
by Nikolay Sivov
On 6/12/22 08:31, Ziqing Hui wrote:
> + if (!wcscmp(name, L"DisplayName")
> + || !wcscmp(name, L"Author")
> + || !wcscmp(name, L"Category")
> + || !wcscmp(name, L"Description"))
> + {
> + if (type != D2D1_PROPERTY_TYPE_STRING)
> + return E_INVALIDARG;
> + ++reg->system_property_count;
> + }
That's not going to work for nested properties, that likely can have
same names as system ones.
> + if (j > entry->property_count)
> + {
> + hr = D2DERR_INVALID_PROPERTY;
> + goto done;
> + }
Should it be j == entry->property_count ?
June 12, 2022
Re: [PATCH v2 2/5] d2d1: Partially implement RegisterEffectFromStream().
by Nikolay Sivov
On 6/12/22 08:31, Ziqing Hui wrote:
> + /* Loop inside effect node */
> + end_node_found = FALSE;
> + while ((hr = next_xml_node(xml_reader, &node_type, &node_name)) == S_OK)
> + {
> + if (node_type == XmlNodeType_Element)
> + {
> + if (!wcscmp(node_name, L"Property"))
> + hr = parse_property(xml_reader, reg);
> + else if (!wcscmp(node_name, L"Inputs"))
> + hr = parse_inputs(xml_reader, reg);
> + else
> + hr = HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
> +
> + if (FAILED(hr))
> + goto done;
> + }
> + else if (node_type == XmlNodeType_EndElement && !wcscmp(node_name, L"Effect"))
> + {
> + end_node_found = TRUE;
> + break;
> + }
> + }
> + hr = (SUCCEEDED(hr) && end_node_found) ? S_OK : E_INVALIDARG;
I don't think it's necessary to check EndElement name. The structure is
always N elements, followed by EndElement. Each element helper should do
the same - skip EndElement on return, and skip elements you're not
interested in entirely.
Error handling could be better, without SUCCEEDED -> S_OK fixups, or goto's.
June 12, 2022