Alexandre Julliard : user: Fixed combo box drop position on multi-monitor setups.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Oct 23 10:01:09 CDT 2006


Module: wine
Branch: master
Commit: 30a25defb3ec288f7e635ce3580e61629e145992
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=30a25defb3ec288f7e635ce3580e61629e145992

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 23 14:04:42 2006 +0200

user: Fixed combo box drop position on multi-monitor setups.

---

 dlls/user/combo.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/user/combo.c b/dlls/user/combo.c
index a82cd5f..c2c49bb 100644
--- a/dlls/user/combo.c
+++ b/dlls/user/combo.c
@@ -1052,6 +1052,8 @@ static void CBUpdateEdit( LPHEADCOMBO lp
  */
 static void CBDropDown( LPHEADCOMBO lphc )
 {
+    HMONITOR monitor;
+    MONITORINFO mon_info;
    RECT rect,r;
    int nItems = 0;
    int nDroppedHeight;
@@ -1123,7 +1125,11 @@ static void CBDropDown( LPHEADCOMBO lphc
    }
 
    /*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/
-   if( (rect.bottom + nDroppedHeight) >= GetSystemMetrics( SM_CYSCREEN ) )
+   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;
 
    SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom,




More information about the wine-cvs mailing list