From: Jacek Caban jacek@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53004 Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/win32u/defwnd.c | 2 ++ dlls/win32u/sysparams.c | 2 +- dlls/win32u/win32u_private.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 67472246960..27120a96d98 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -35,6 +35,8 @@ void fill_rect( HDC dc, const RECT *rect, HBRUSH hbrush ) { HBRUSH prev_brush;
+ if (hbrush <= (HBRUSH)(COLOR_MENUBAR + 1)) hbrush = get_sys_color_brush( HandleToULong(hbrush) - 1 ); + prev_brush = NtGdiSelectBrush( dc, hbrush ); NtGdiPatBlt( dc, rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top, PATCOPY ); if (prev_brush) NtGdiSelectBrush( dc, prev_brush ); diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 114016954aa..5fec4ade0f8 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4506,7 +4506,7 @@ static HBRUSH get_55aa_brush(void) return brush_55aa; }
-static HBRUSH get_sys_color_brush( unsigned int index ) +HBRUSH get_sys_color_brush( unsigned int index ) { if (index == COLOR_55AA_BRUSH) return get_55aa_brush(); if (index >= ARRAY_SIZE( system_colors )) return 0; diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index e459e6df6bd..d02871a6ad1 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -404,6 +404,7 @@ extern UINT get_monitor_dpi( HMONITOR monitor ) DECLSPEC_HIDDEN; extern BOOL get_monitor_info( HMONITOR handle, MONITORINFO *info ) DECLSPEC_HIDDEN; extern UINT get_win_monitor_dpi( HWND hwnd ) DECLSPEC_HIDDEN; extern RECT get_primary_monitor_rect( UINT dpi ) DECLSPEC_HIDDEN; +extern HBRUSH get_sys_color_brush( unsigned int index ) DECLSPEC_HIDDEN; extern UINT get_system_dpi(void) DECLSPEC_HIDDEN; extern int get_system_metrics( int index ) DECLSPEC_HIDDEN; extern UINT get_thread_dpi(void) DECLSPEC_HIDDEN;
From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/user32/win.h | 1 - dlls/user32/winpos.c | 95 -------------------------------------------- 2 files changed, 96 deletions(-)
diff --git a/dlls/user32/win.h b/dlls/user32/win.h index c9ac3b8e977..2155ea51e94 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -60,7 +60,6 @@ static inline void WIN_ReleasePtr( WND *ptr )
extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN;
-extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN; extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN; extern void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) DECLSPEC_HIDDEN;
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index a5bc7d9ce17..5987d06c257 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -109,101 +109,6 @@ BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect ) }
-/*********************************************************************** - * list_children_from_point - * - * Get the list of children that can contain point from the server. - * Point is in screen coordinates. - * Returned list must be freed by caller. - */ -static HWND *list_children_from_point( HWND hwnd, POINT pt ) -{ - HWND *list; - int i, size = 128; - - for (;;) - { - int count = 0; - - if (!(list = HeapAlloc( GetProcessHeap(), 0, size * sizeof(HWND) ))) break; - - SERVER_START_REQ( get_window_children_from_point ) - { - req->parent = wine_server_user_handle( hwnd ); - req->x = pt.x; - req->y = pt.y; - req->dpi = get_thread_dpi(); - wine_server_set_reply( req, list, (size-1) * sizeof(user_handle_t) ); - if (!wine_server_call( req )) count = reply->count; - } - SERVER_END_REQ; - if (count && count < size) - { - /* start from the end since HWND is potentially larger than user_handle_t */ - for (i = count - 1; i >= 0; i--) - list[i] = wine_server_ptr_handle( ((user_handle_t *)list)[i] ); - list[count] = 0; - return list; - } - HeapFree( GetProcessHeap(), 0, list ); - if (!count) break; - size = count + 1; /* restart with a large enough buffer */ - } - return NULL; -} - - -/*********************************************************************** - * WINPOS_WindowFromPoint - * - * Find the window and hittest for a given point. - */ -HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) -{ - int i, res; - HWND ret, *list; - POINT win_pt; - - if (!hwndScope) hwndScope = GetDesktopWindow(); - - *hittest = HTNOWHERE; - - if (!(list = list_children_from_point( hwndScope, pt ))) return 0; - - /* now determine the hittest */ - - for (i = 0; list[i]; i++) - { - LONG style = GetWindowLongW( list[i], GWL_STYLE ); - - /* If window is minimized or disabled, return at once */ - if (style & WS_DISABLED) - { - *hittest = HTERROR; - break; - } - /* Send WM_NCCHITTEST (if same thread) */ - if (!WIN_IsCurrentThread( list[i] )) - { - *hittest = HTCLIENT; - break; - } - win_pt = point_thread_to_win_dpi( list[i], pt ); - res = SendMessageW( list[i], WM_NCHITTEST, 0, MAKELPARAM( win_pt.x, win_pt.y )); - if (res != HTTRANSPARENT) - { - *hittest = res; /* Found the window */ - break; - } - /* continue search with next window in z-order */ - } - ret = list[i]; - HeapFree( GetProcessHeap(), 0, list ); - TRACE( "scope %p (%d,%d) returning %p\n", hwndScope, pt.x, pt.y, ret ); - return ret; -} - - /******************************************************************* * WindowFromPoint (USER32.@) */
This merge request was approved by Huw Davies.