[EXPLORER]: Minor stylistic formatting changes; add a notice about a SystemParametersInfoW(SPI_SETWORKAREA) call, concerning its action when explorer's taskbar size is changed.

svn path=/trunk/; revision=71522
This commit is contained in:
Hermès Bélusca-Maïto 2016-06-04 22:57:12 +00:00
parent a3fdbc7eca
commit 1b9a4118a8

View file

@ -511,8 +511,7 @@ public:
mi.cbSize = sizeof(mi); mi.cbSize = sizeof(mi);
hMon = MonitorFromRect(pRect, dwFlags); hMon = MonitorFromRect(pRect, dwFlags);
if (hMon != NULL && if (hMon != NULL &&
GetMonitorInfo(hMon, GetMonitorInfo(hMon, &mi))
&mi))
{ {
*pRect = mi.rcMonitor; *pRect = mi.rcMonitor;
} }
@ -539,8 +538,7 @@ public:
now), minimize the risk that we determine a wrong monitor by now), minimize the risk that we determine a wrong monitor by
using the center point of the tray window if we can't determine using the center point of the tray window if we can't determine
it using the rectangle. */ it using the rectangle. */
hMon = MonitorFromRect(pRect, hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
MONITOR_DEFAULTTONULL);
if (hMon == NULL) if (hMon == NULL)
{ {
POINT pt; POINT pt;
@ -549,8 +547,7 @@ public:
pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2); pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
/* be less error-prone, find the nearest monitor */ /* be less error-prone, find the nearest monitor */
hMon = MonitorFromPoint(pt, hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
MONITOR_DEFAULTTONEAREST);
} }
return hMon; return hMon;
@ -571,11 +568,9 @@ public:
{ {
/* Hm, the monitor is gone? Try to find a monitor where it /* Hm, the monitor is gone? Try to find a monitor where it
could be located now */ could be located now */
hMon = GetMonitorFromRect( hMon = GetMonitorFromRect(pRect);
pRect);
if (hMon == NULL || if (hMon == NULL ||
!GetMonitorInfo(hMon, !GetMonitorInfo(hMon, &mi))
&mi))
{ {
hMon = NULL; hMon = NULL;
goto GetPrimaryRect; goto GetPrimaryRect;
@ -674,11 +669,10 @@ GetPrimaryRect:
/* FIXME - calculate */ /* FIXME - calculate */
GetTrayRectFromScreenRect( GetTrayRectFromScreenRect(Position,
Position, &rcScreen,
&rcScreen, &szWnd,
&szWnd, pRect);
pRect);
return hMon; return hMon;
} }
@ -716,9 +710,7 @@ GetPrimaryRect:
rcScreen.top = 0; rcScreen.top = 0;
/* Determine the screen rectangle */ /* Determine the screen rectangle */
hMon = MonitorFromPoint(pt, hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
MONITOR_DEFAULTTONULL);
if (hMon != NULL) if (hMon != NULL)
{ {
MONITORINFO mi; MONITORINFO mi;
@ -868,9 +860,8 @@ GetPrimaryScreenRect:
//m_TrayRects[DraggingPosition] = rcTray; //m_TrayRects[DraggingPosition] = rcTray;
} }
//Monitor = CalculateValidSize( //Monitor = CalculateValidSize(DraggingPosition,
// DraggingPosition, // &rcTray);
// &rcTray);
m_Monitor = m_DraggingMonitor; m_Monitor = m_DraggingMonitor;
m_Position = m_DraggingPosition; m_Position = m_DraggingPosition;
@ -991,9 +982,9 @@ ChangePos:
{ {
GetScreenRect(m_PreviousMonitor, &rcWorkArea); GetScreenRect(m_PreviousMonitor, &rcWorkArea);
SystemParametersInfoW(SPI_SETWORKAREA, SystemParametersInfoW(SPI_SETWORKAREA,
1, 1,
&rcWorkArea, &rcWorkArea,
SPIF_SENDCHANGE); SPIF_SENDCHANGE);
} }
rcTray = m_TrayRects[m_Position]; rcTray = m_TrayRects[m_Position];
@ -1001,8 +992,8 @@ ChangePos:
GetScreenRect(m_Monitor, &rcWorkArea); GetScreenRect(m_Monitor, &rcWorkArea);
m_PreviousMonitor = m_Monitor; m_PreviousMonitor = m_Monitor;
/* If AutoHide is false then change the workarea to exclude the area that /* If AutoHide is false then change the workarea to exclude
the taskbar covers. */ the area that the taskbar covers. */
if (!AutoHide) if (!AutoHide)
{ {
switch (m_Position) switch (m_Position)
@ -1022,10 +1013,14 @@ ChangePos:
} }
} }
/*
* Resize the current monitor work area. Win32k will also send
* a WM_SIZE message to automatically resize the desktop.
*/
SystemParametersInfoW(SPI_SETWORKAREA, SystemParametersInfoW(SPI_SETWORKAREA,
1, 1,
&rcWorkArea, &rcWorkArea,
SPIF_SENDCHANGE); SPIF_SENDCHANGE);
#endif #endif
} }
@ -1167,12 +1162,11 @@ ChangePos:
usable results */ usable results */
for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++) for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
{ {
GetTrayRectFromScreenRect( GetTrayRectFromScreenRect(Pos,
Pos, &rcScreen,
&rcScreen, &m_TraySize,
&m_TraySize, &m_TrayRects[Pos]);
&m_TrayRects[Pos]); // TRACE("m_TrayRects[%d(%d)]: %d,%d,%d,%d\n", Pos, Position, m_TrayRects[Pos].left, m_TrayRects[Pos].top, m_TrayRects[Pos].right, m_TrayRects[Pos].bottom);
// TRACE("m_TrayRects[%d(%d)]: %d,%d,%d,%d\n", Pos, Position, m_TrayRects[Pos].left, m_TrayRects[Pos].top, m_TrayRects[Pos].right, m_TrayRects[Pos].bottom);
} }
/* Determine which monitor we are on. It shouldn't matter which docked /* Determine which monitor we are on. It shouldn't matter which docked