[racket] Second display monitor issue

From: Kieron Hardy (kieron.hardy at gmail.com)
Date: Sat May 26 07:45:52 EDT 2012

So it seems that for some reason (Older Dell laptop, ATI video, Windows 7
using generic drivers) the Windows system call to return the list of
monitors is returning them to Racket in a different order (primary display
monitor last) than expected (primary display monitor first).

The code for get-all-screen-rects (in
collects/mred/private/wx/win32/frame.rkt) assumes monitor 0 is the primary
display monitor and is the first item in the list returned by
EnumDisplayDevices. My tests show that at least sometimes the primary
display monitor is not the first item in the list (also noted on SO at

An alternative solution to getting monitor information would be to use
GetMonitorInfo passing a MONITORINFO or MONITORINFOEX structure for each of
the values in the range 0 .. GetSystemMetrics (SM_CMONITORS) and used in
Racket perhaps sorted by the monitor name returned in the szDevice field of
the MONITORINFOEX structure.

If Racket needs to designate monitor 0 as the primary monitor then
get-all-screen-rects must enumerate the display monitors and then perform
some processing to sort them so that the primary monitor is returned as the
first item in the list.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120526/d55b7215/attachment.html>

Posted on the users mailing list.