Huw Davies : user32: Don't bother drawing an item if it' s outside the items_rect.
Alexandre Julliard
julliard at winehq.org
Fri Mar 31 14:26:28 CDT 2017
Module: wine
Branch: master
Commit: 962d5e6469730afb7614c0a8d65a168d7c200e45
URL: http://source.winehq.org/git/wine.git/?a=commit;h=962d5e6469730afb7614c0a8d65a168d7c200e45
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Mar 31 09:52:40 2017 +0100
user32: Don't bother drawing an item if it's outside the items_rect.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/menu.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 6c6888a..a65f01e 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1417,6 +1417,12 @@ static void MENU_DrawMenuItem( HWND hwnd, POPUPMENU *menu, HWND hwndOwner, HDC h
return;
}
+ TRACE( "rect=%s\n", wine_dbgstr_rect( &lpitem->rect ) );
+ rect = lpitem->rect;
+ MENU_AdjustMenuItemRect( menu, &rect );
+ if (!IntersectRect( &bmprc, &rect, &menu->items_rect )) /* bmprc is used as a dummy */
+ return;
+
SystemParametersInfoW (SPI_GETFLATMENU, 0, &flat_menu, 0);
bkgnd = (menuBar && flat_menu) ? COLOR_MENUBAR : COLOR_MENU;
@@ -1444,10 +1450,6 @@ static void MENU_DrawMenuItem( HWND hwnd, POPUPMENU *menu, HWND hwndOwner, HDC h
SetBkColor( hdc, GetSysColor( bkgnd ) );
}
- TRACE("rect=%s\n", wine_dbgstr_rect( &lpitem->rect));
- rect = lpitem->rect;
- MENU_AdjustMenuItemRect(menu, &rect);
-
old_clip = CreateRectRgn( 0, 0, 0, 0 );
if (GetClipRgn( hdc, old_clip ) <= 0)
{
More information about the wine-cvs
mailing list