win32u: Move NtUserExcludeUpdateRgn implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-04-14 14:10:15 +02:00 committed by Alexandre Julliard
parent 7b6a38b072
commit 52ff3a3094
8 changed files with 35 additions and 27 deletions

View File

@ -240,31 +240,6 @@ BOOL WINAPI ValidateRect( HWND hwnd, const RECT *rect )
}
/***********************************************************************
* ExcludeUpdateRgn (USER32.@)
*/
INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
{
HRGN update_rgn = CreateRectRgn( 0, 0, 0, 0 );
INT ret = NtUserGetUpdateRgn( hwnd, update_rgn, FALSE );
if (ret != ERROR)
{
DPI_AWARENESS_CONTEXT context;
POINT pt;
context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd ));
GetDCOrgEx( hdc, &pt );
MapWindowPoints( 0, hwnd, &pt, 1 );
OffsetRgn( update_rgn, -pt.x, -pt.y );
ret = ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF );
SetThreadDpiAwarenessContext( context );
}
DeleteObject( update_rgn );
return ret;
}
static INT scroll_window( HWND hwnd, INT dx, INT dy, const RECT *rect, const RECT *clipRect,
HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags, BOOL is_ex )
{

View File

@ -237,7 +237,7 @@
@ stdcall EnumWindowStationsW(ptr long)
@ stdcall EnumWindows(ptr long)
@ stdcall EqualRect(ptr ptr)
@ stdcall ExcludeUpdateRgn(long long)
@ stdcall ExcludeUpdateRgn(long long) NtUserExcludeUpdateRgn
@ stdcall ExitWindowsEx(long long)
@ stdcall FillRect(long ptr long)
@ stdcall FindWindowA(str str)

View File

@ -1546,3 +1546,27 @@ BOOL WINAPI NtUserGetUpdateRect( HWND hwnd, RECT *rect, BOOL erase )
if (need_erase) flags |= UPDATE_DELAYED_ERASE;
return get_update_flags( hwnd, NULL, &flags ) && (flags & UPDATE_PAINT);
}
/***********************************************************************
* NtUserExcludeUpdateRgn (win32u.@)
*/
INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd )
{
HRGN update_rgn = NtGdiCreateRectRgn( 0, 0, 0, 0 );
INT ret = NtUserGetUpdateRgn( hwnd, update_rgn, FALSE );
if (ret != ERROR)
{
DPI_AWARENESS_CONTEXT context;
POINT pt;
context = set_thread_dpi_awareness_context( get_window_dpi_awareness_context( hwnd ));
NtGdiGetDCPoint( hdc, NtGdiGetDCOrg, &pt );
map_window_points( 0, hwnd, &pt, 1, get_thread_dpi() );
NtGdiOffsetRgn( update_rgn, -pt.x, -pt.y );
ret = NtGdiExtSelectClipRgn( hdc, update_rgn, RGN_DIFF );
set_thread_dpi_awareness_context( context );
}
NtGdiDeleteObjectApp( update_rgn );
return ret;
}

View File

@ -1155,6 +1155,7 @@ static struct unix_funcs unix_funcs =
NtUserEnumDisplayDevices,
NtUserEnumDisplayMonitors,
NtUserEnumDisplaySettings,
NtUserExcludeUpdateRgn,
NtUserFlashWindowEx,
NtUserGetAsyncKeyState,
NtUserGetClassInfoEx,

View File

@ -879,7 +879,7 @@
@ stdcall NtUserEnumDisplayMonitors(long ptr ptr long)
@ stdcall NtUserEnumDisplaySettings(ptr long ptr long)
@ stub NtUserEvent
@ stub NtUserExcludeUpdateRgn
@ stdcall NtUserExcludeUpdateRgn(long long)
@ stub NtUserFillWindow
@ stdcall -syscall NtUserFindExistingCursorIcon(ptr ptr ptr)
@ stub NtUserFindWindowEx

View File

@ -217,6 +217,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode,
DEVMODEW *dev_mode, DWORD flags );
INT (WINAPI *pNtUserExcludeUpdateRgn)( HDC hdc, HWND hwnd );
BOOL (WINAPI *pNtUserFlashWindowEx)( FLASHWINFO *info );
SHORT (WINAPI *pNtUserGetAsyncKeyState)( INT key );
ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,

View File

@ -852,6 +852,12 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
return unix_funcs->pNtUserEnumDisplaySettings( device, mode, dev_mode, flags );
}
INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd )
{
if (!unix_funcs) return ERROR;
return unix_funcs->pNtUserExcludeUpdateRgn( hdc, hwnd );
}
BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info )
{
if (!unix_funcs) return FALSE;

View File

@ -436,6 +436,7 @@ NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index,
BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp );
BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode,
DEVMODEW *dev_mode, DWORD flags );
INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd );
HICON WINAPI NtUserFindExistingCursorIcon( UNICODE_STRING *module, UNICODE_STRING *res_name,
void *desc );
BOOL WINAPI NtUserFlashWindowEx( FLASHWINFO *info );