Huw Davies : user32: Keep the combo listbox within the monitor's work area.
Alexandre Julliard
julliard at winehq.org
Thu Mar 28 15:30:23 CDT 2013
Module: wine
Branch: master
Commit: b4b99697f99cebec0f92042075d62f27b235d35c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b4b99697f99cebec0f92042075d62f27b235d35c
Author: Huw Davies <huw at codeweavers.com>
Date: Thu Mar 28 16:03:30 2013 +0000
user32: Keep the combo listbox within the monitor's work area.
---
dlls/user32/combo.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index 346b346..2aa4424 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -1043,18 +1043,24 @@ static void CBDropDown( LPHEADCOMBO lphc )
}
}
+ r.left = rect.left;
+ r.top = rect.bottom;
+ r.right = r.left + lphc->droppedRect.right - lphc->droppedRect.left;
+ r.bottom = r.top + nDroppedHeight;
+
/*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/
monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
mon_info.cbSize = sizeof(mon_info);
GetMonitorInfoW( monitor, &mon_info );
- if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom )
- rect.bottom = rect.top - nDroppedHeight;
+ if (r.bottom > mon_info.rcWork.bottom)
+ {
+ r.top = max( rect.top - nDroppedHeight, mon_info.rcWork.top );
+ r.bottom = min( r.top + nDroppedHeight, mon_info.rcWork.bottom );
+ }
- SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,
- lphc->droppedRect.right - lphc->droppedRect.left,
- nDroppedHeight,
- SWP_NOACTIVATE | SWP_SHOWWINDOW);
+ SetWindowPos( lphc->hWndLBox, HWND_TOP, r.left, r.top, r.right - r.left, r.bottom - r.top,
+ SWP_NOACTIVATE | SWP_SHOWWINDOW );
if( !(lphc->wState & CBF_NOREDRAW) )
More information about the wine-cvs
mailing list