[Lazarus] Screen and Desktop inconsistencies

Paul Ishenin ip at kmiac.ru
Tue Nov 8 04:07:10 CET 2011

07.11.2011 12:42, Hans-Peter Diettrich пишет:
> There exist 3 descriptions of the display area in TScreen: Screen (Width
> and Heigth), Desktop and WorkArea. The Delphi description of the
> difference is quite vague. The Lazarus implementation seems to assume:
> Screen = primary monitor
> WorkArea = primary monitor excluding e.g. TaskBar (SPI_GETWORKAREA)
> Desktop = entire virtual display, including all monitors
> Is this correct?


> About the DesktopRect and WorkAreaRect, the WorkAreaRect contains the
> BottomRight coordinates, while DesktopRect contains the Width and Height
> in BottomRight. This may be Delphi compatible, but looks very confusing.

You understood the code wrong: Bounds() and Rect() are different 
functions. Look at it after r33405.

> No Rect (or Top, Left) properties exist for the Screen. Delphi assumes
> (0,0) for the primary monitor origin - does this hold for non-Windows
> platforms?

Delphi does not assumes anything. It gives you screen width and screen 
height. (0,0) is assumend by you.

If you need monitor area you can obtain it using PrimaryMonitor or 
Monitors[] property.

> The same for the WorkArea, where e.g. a Linux taskbar can (and typically
> does) span multiple monitors. I'm missing a property describing the
> entire WorkArea, across all monitors, excluding the system areas.

WorkArea is retrieved using SystemParametersInfo(SPI_GETWORKAREA).

 From MSDN: Retrieves the size of the work area on the primary display 
monitor. The work area is the portion of the screen not obscured by the 
system taskbar or by application desktop toolbars. The pvParam parameter 
must point to a RECT structure that receives the coordinates of the work 
area, expressed in virtual screen coordinates.

Best regards,
Paul Ishenin.

More information about the Lazarus mailing list