Moving some out of winex11 and better matching native.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/sysparams.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 832b56eb380..99042c85923 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2698,6 +2698,7 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod if (!adapter_get_current_settings( adapter, ¤t_mode )) WARN( "Failed to get primary adapter current display settings.\n" ); adapter_release( adapter );
+ NtUserClipCursor( NULL ); send_notify_message( NtUserGetDesktopWindow(), WM_DISPLAYCHANGE, current_mode.dmBitsPerPel, MAKELPARAM( current_mode.dmPelsWidth, current_mode.dmPelsHeight ), FALSE ); send_message_timeout( HWND_BROADCAST, WM_DISPLAYCHANGE, current_mode.dmBitsPerPel,
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/desktop.c | 1 - dlls/winex11.drv/mouse.c | 2 +- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 168029367d3..b58dc050bd3 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -446,7 +446,6 @@ void X11DRV_resize_desktop(void) NtUserSetWindowPos( hwnd, 0, virtual_rect.left, virtual_rect.top, virtual_rect.right - virtual_rect.left, virtual_rect.bottom - virtual_rect.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE ); - ungrab_clipping_window();
if (old_virtual_rect.left != virtual_rect.left || old_virtual_rect.top != virtual_rect.top) send_message_timeout( HWND_BROADCAST, WM_X11DRV_DESKTOP_RESIZED, old_virtual_rect.left, diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index c34f5fde77e..b17e8b12d25 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -455,7 +455,7 @@ static BOOL grab_clipping_window( const RECT *clip ) * * Release the pointer grab on the clip window. */ -void ungrab_clipping_window(void) +static void ungrab_clipping_window(void) { Display *display = thread_init_display(); Window clip_window = init_clip_window(); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 3fe072c901e..22b61e1b5b0 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -686,7 +686,6 @@ extern void set_window_cursor( Window window, HCURSOR handle ) DECLSPEC_HIDDEN; extern void sync_window_cursor( Window window ) DECLSPEC_HIDDEN; extern LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd ) DECLSPEC_HIDDEN; extern LRESULT clip_cursor_request( HWND hwnd, BOOL fullscreen, BOOL reset ) DECLSPEC_HIDDEN; -extern void ungrab_clipping_window(void) DECLSPEC_HIDDEN; extern void reset_clipping_window(void) DECLSPEC_HIDDEN; extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN; extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/event.c | 4 ++-- dlls/winex11.drv/mouse.c | 11 ----------- dlls/winex11.drv/window.c | 2 +- dlls/winex11.drv/x11drv.h | 1 - 4 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 701d0c1faf6..edb7a1bf983 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -814,7 +814,7 @@ static void focus_out( Display *display , HWND hwnd )
if (is_virtual_desktop()) { - if (hwnd == NtUserGetDesktopWindow()) reset_clipping_window(); + if (hwnd == NtUserGetDesktopWindow()) NtUserClipCursor( NULL ); return; } if (hwnd != NtUserGetForegroundWindow()) return; @@ -858,7 +858,7 @@ static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *xev )
if (event->detail == NotifyPointer) { - if (!hwnd && event->window == x11drv_thread_data()->clip_window) reset_clipping_window(); + if (!hwnd && event->window == x11drv_thread_data()->clip_window) NtUserClipCursor( NULL ); return TRUE; } if (!hwnd) return FALSE; diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index b17e8b12d25..fc35081652c 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -469,17 +469,6 @@ static void ungrab_clipping_window(void) send_notify_message( NtUserGetDesktopWindow(), WM_X11DRV_CLIP_CURSOR_NOTIFY, 0, 0 ); }
-/*********************************************************************** - * reset_clipping_window - * - * Forcibly reset the window clipping on external events. - */ -void reset_clipping_window(void) -{ - ungrab_clipping_window(); - NtUserClipCursor( NULL ); /* make sure the clip rectangle is reset too */ -} - /*********************************************************************** * retry_grab_clipping_window * diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 4fa4fb59c90..2e290295860 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2687,7 +2687,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, { release_win_data( data ); unmap_window( hwnd ); - if (NtUserIsWindowRectFullScreen( &old_window_rect )) reset_clipping_window(); + if (NtUserIsWindowRectFullScreen( &old_window_rect )) NtUserClipCursor( NULL ); if (!(data = get_win_data( hwnd ))) return; } } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 22b61e1b5b0..9f6ba45d175 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -686,7 +686,6 @@ extern void set_window_cursor( Window window, HCURSOR handle ) DECLSPEC_HIDDEN; extern void sync_window_cursor( Window window ) DECLSPEC_HIDDEN; extern LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd ) DECLSPEC_HIDDEN; extern LRESULT clip_cursor_request( HWND hwnd, BOOL fullscreen, BOOL reset ) DECLSPEC_HIDDEN; -extern void reset_clipping_window(void) DECLSPEC_HIDDEN; extern void retry_grab_clipping_window(void) DECLSPEC_HIDDEN; extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) DECLSPEC_HIDDEN; extern void move_resize_window( HWND hwnd, int dir ) DECLSPEC_HIDDEN;
From: Rémi Bernon rbernon@codeweavers.com
It will be reset on foreground input changes, when it happens. --- dlls/user32/tests/input.c | 2 -- server/queue.c | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 197a82db251..2ce129dae45 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -5282,7 +5282,6 @@ static void test_ClipCursor_process(void) InflateRect( &clip_rect, +1, +1 ); ok_ret( 1, DestroyWindow( hwnd ) ); ok_ret( 1, GetClipCursor( &rect ) ); - todo_wine ok_rect( clip_rect, rect );
/* intentionally leaking clipping rect */ @@ -5339,7 +5338,6 @@ static void test_ClipCursor_desktop( char **argv ) /* as foreground window is now transient, cursor clipping isn't reset */ InflateRect( &clip_rect, +1, +1 ); ok_ret( 1, GetClipCursor( &rect ) ); - todo_wine ok_rect( clip_rect, rect );
/* intentionally leaking clipping rect */ diff --git a/server/queue.c b/server/queue.c index e27727a3173..0c7d2c50a49 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1093,12 +1093,13 @@ static void thread_input_dump( struct object *obj, int verbose ) static void thread_input_destroy( struct object *obj ) { struct thread_input *input = (struct thread_input *)obj; + struct desktop *desktop;
empty_msg_list( &input->msg_list ); - if (input->desktop) + if ((desktop = input->desktop)) { - if (input->desktop->foreground_input == input) set_foreground_input( input->desktop, NULL ); - release_object( input->desktop ); + if (desktop->foreground_input == input) desktop->foreground_input = NULL; + release_object( desktop ); } }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=133323
Your paranoid android.
=== debian11 (32 bit report) ===
user32: monitor.c:1613: Test failed: SetThreadDesktop failed, error 0xaa. monitor.c:1614: Test failed: Expected 00000014, got 00000348.