Alexandre Julliard : comctl32:
Position the tooltip window correctly on multi-monitor setups.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Oct 23 10:01:19 CDT 2006
Module: wine
Branch: master
Commit: 9d6d54f5e65d1e4eb544873746efe6ca857ae303
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9d6d54f5e65d1e4eb544873746efe6ca857ae303
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 23 14:05:34 2006 +0200
comctl32: Position the tooltip window correctly on multi-monitor setups.
---
dlls/comctl32/tooltips.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 3462ef9..e9badc8 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -496,7 +496,9 @@ static void
TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
{
TTTOOL_INFO *toolPtr;
- RECT rect, wndrect;
+ HMONITOR monitor;
+ MONITORINFO mon_info;
+ RECT rect;
SIZE size;
NMHDR hdr;
int ptfx = 0;
@@ -593,13 +595,18 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO
rect.bottom = rect.top + size.cy;
/* check position */
- wndrect.right = GetSystemMetrics( SM_CXSCREEN );
- if( rect.right > wndrect.right ) {
- rect.left -= rect.right - wndrect.right + 2;
- rect.right = wndrect.right - 2;
+
+ monitor = MonitorFromRect( &rect, MONITOR_DEFAULTTOPRIMARY );
+ mon_info.cbSize = sizeof(mon_info);
+ GetMonitorInfoW( monitor, &mon_info );
+
+ if( rect.right > mon_info.rcWork.right ) {
+ rect.left -= rect.right - mon_info.rcWork.right + 2;
+ rect.right = mon_info.rcWork.right - 2;
}
- wndrect.bottom = GetSystemMetrics( SM_CYSCREEN );
- if( rect.bottom > wndrect.bottom ) {
+ if (rect.left < mon_info.rcWork.left) rect.left = mon_info.rcWork.left;
+
+ if( rect.bottom > mon_info.rcWork.bottom ) {
RECT rc;
if (toolPtr->uFlags & TTF_IDISHWND)
More information about the wine-cvs
mailing list