mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
parent
fa120ac0cd
commit
dce62240f1
1 changed files with 20 additions and 14 deletions
|
@ -1048,27 +1048,33 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
|
|
||||||
case SPI_SETWORKAREA:
|
case SPI_SETWORKAREA:
|
||||||
{
|
{
|
||||||
/* FIXME: We should set the work area of the monitor
|
PMONITOR pmonitor;
|
||||||
that contains the specified rectangle */
|
RECTL rcWorkArea, rcIntersect;
|
||||||
PMONITOR pmonitor = UserGetPrimaryMonitor();
|
|
||||||
RECT rcWorkArea;
|
|
||||||
|
|
||||||
|
if (!pvParam)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
RtlCopyMemory(&rcWorkArea, pvParam, sizeof(rcWorkArea));
|
||||||
|
|
||||||
|
/* fail if empty */
|
||||||
|
if (RECTL_bIsEmptyRect(&rcWorkArea))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* get the nearest monitor */
|
||||||
|
pmonitor = UserMonitorFromRect(&rcWorkArea, MONITOR_DEFAULTTONEAREST);
|
||||||
if (!pmonitor)
|
if (!pmonitor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl))
|
/* fail unless work area is completely in monitor */
|
||||||
|
if (!RECTL_bIntersectRect(&rcIntersect, &pmonitor->rcMonitor, &rcWorkArea) ||
|
||||||
|
!RtlEqualMemory(&rcIntersect, &rcWorkArea, sizeof(rcIntersect)))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!SpiSet(&pmonitor->rcWork, pvParam, sizeof(RECTL), fl))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Verify the new values */
|
|
||||||
if (rcWorkArea.left < 0 ||
|
|
||||||
rcWorkArea.top < 0 ||
|
|
||||||
rcWorkArea.right > gpsi->aiSysMet[SM_CXSCREEN] ||
|
|
||||||
rcWorkArea.bottom > gpsi->aiSysMet[SM_CYSCREEN] ||
|
|
||||||
rcWorkArea.right <= rcWorkArea.left ||
|
|
||||||
rcWorkArea.bottom <= rcWorkArea.top)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
pmonitor->rcWork = rcWorkArea;
|
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: What to do?
|
// FIXME: What to do?
|
||||||
|
|
Loading…
Reference in a new issue