Alexandre Julliard : user32: Use the monitor rectangle to position icons on the desktop.
Alexandre Julliard
julliard at winehq.org
Thu May 26 10:54:44 CDT 2016
Module: wine
Branch: master
Commit: b4bccfee05ac49e1c685d86c6ac3cea375f07381
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b4bccfee05ac49e1c685d86c6ac3cea375f07381
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu May 26 16:38:36 2016 +0900
user32: Use the monitor rectangle to position icons on the desktop.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/winpos.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index e0e4a62..cf54329 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -859,7 +859,17 @@ static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt )
SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(metrics), &metrics, 0 );
parent = GetAncestor( hwnd, GA_PARENT );
- GetClientRect( parent, &rectParent );
+ if (parent == GetDesktopWindow())
+ {
+ MONITORINFO mon_info;
+ HMONITOR monitor = MonitorFromWindow( hwnd, MONITOR_DEFAULTTOPRIMARY );
+
+ mon_info.cbSize = sizeof( mon_info );
+ GetMonitorInfoW( monitor, &mon_info );
+ rectParent = mon_info.rcWork;
+ }
+ else GetClientRect( parent, &rectParent );
+
if ((pt.x >= rectParent.left) && (pt.x + GetSystemMetrics(SM_CXICON) < rectParent.right) &&
(pt.y >= rectParent.top) && (pt.y + GetSystemMetrics(SM_CYICON) < rectParent.bottom))
return pt; /* The icon already has a suitable position */
@@ -2486,7 +2496,18 @@ UINT WINAPI ArrangeIconicWindows( HWND parent )
metrics.cbSize = sizeof(metrics);
SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS, sizeof(metrics), &metrics, 0 );
- GetClientRect( parent, &rectParent );
+
+ if (parent == GetDesktopWindow())
+ {
+ MONITORINFO mon_info;
+ HMONITOR monitor = MonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY );
+
+ mon_info.cbSize = sizeof( mon_info );
+ GetMonitorInfoW( monitor, &mon_info );
+ rectParent = mon_info.rcWork;
+ }
+ else GetClientRect( parent, &rectParent );
+
x = y = 0;
xspacing = GetSystemMetrics(SM_CXICONSPACING);
yspacing = GetSystemMetrics(SM_CYICONSPACING);
More information about the wine-cvs
mailing list