Menu

#1564 scrnsave does not create working screensavers (9x/NT4)

WSL
closed
None
Bug
fixed
Feature_in_WSL_4.0
False
2013-02-24
2011-07-14
No

As written in the summary, scrnsave does not create working screensavers on Windows 9x and Windows NT 4.0.
I could not test Windows ME, so I do not know if it is affected too or not.

The compatibility with older Windows versions has been broken by this commit:

2007-10-03 Frank Fesevur <ffes@users.sourceforge.net> * lib/scnsave.c: Multi-monitor support.

With this commit, the upper left corner has been set to SM_XVIRTUALSCREEN and SM_YVIRTUALSCREEN while the bottom right corner has been set SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN, but on these OSes the call to GetSystemMetrics() with these indexes will return ZERO.
While a zero value is not a big problem for SM_XVIRTUALSCREEN and SM_YVIRTUALSCREEN, on SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN it won't allow to open the screensaver window even on the current desktop area.

Windows 2000, XP and newers are not affected by this bug and they display screensavers graphics correctly.

The solution to this problem should be to check the values associated to SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN before calling the CreateWindow(): if abnormal zero value has been received then it must fall down to use SM_CXSCREEN and SM_CYSCREEN.

I attached a patch that describes the simple fix that I implemented for solving this problem.
With this correction, Windows 9x and NT 4.0 worked again, while keeping multimonitor support for later Windows versions (two horizontal monitors tested).

Tested with w32api-3.17 but current CVS sources are still affected.

$ gcc -v
gcc version 3.4.5 (mingw-vista special r3)

$ ld -v
GNU ld (GNU Binutils) 2.20.51.20100613

Sincerely,

Carlo Bramini.

Discussion

  • Carlo Bramini

    Carlo Bramini - 2011-07-14

    Proposed fix.

     
  • Earnie Boyd

    Earnie Boyd - 2012-10-25
    • labels: 103945 --> WSL (Windows System Libraries)
    • milestone: --> Feature_in_WSL_4.0
    • assigned_to: nobody --> earnie
    • status: open --> closed-fixed
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-18
    • category: --> Feature_in_WSL_4.0
    • milestone: Feature_in_WSL_4.0 --> WSL
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-16
    • labels: WSL (Windows System Libraries) --> release notes
    • status: closed-fixed --> closed
    • type: --> Bug
    • resolution: --> fixed
    • patch_attached: --> False
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-24
    • labels: release notes -->
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-24

    Notes added to NEWS file.