http://bugs.freedesktop.org/show_bug.cgi?id=23182

           Summary: [patch] GLUT - Incorrect Vista maximisation size due to
                    WM_GETMINMAXINFO handling
           Product: Mesa
           Version: 7.2
          Platform: All
        OS/Version: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: GLUT
        AssignedTo: [email protected]
        ReportedBy: [email protected]


On Windows Vista in DWM (Desktop Window Manager) mode
the handling of WM_GETMINMAXINFO results in ptMaxSize
being set incorrectly in the case of a resolution
change into fullscreen mode.

In win32_winproc.c:

  case WM_GETMINMAXINFO:
    /* this voodoo is brought to you by Win32 (again).  It allows the
       window to be bigger than the screen, and smaller than 100x100
       (although it doesn't seem to help the y minimum). */
    minmax = (LPMINMAXINFO)lParam;
    minmax->ptMaxSize.x = __glutScreenWidth;
    minmax->ptMaxSize.y = __glutScreenHeight;
    minmax->ptMinTrackSize.x = 0;
    minmax->ptMinTrackSize.y = 0;
    minmax->ptMaxTrackSize.x = __glutScreenWidth + 
      GetSystemMetrics(SM_CXSIZE) * 2;
    minmax->ptMaxTrackSize.y = __glutScreenHeight + 
      GetSystemMetrics(SM_CXSIZE) * 2 + GetSystemMetrics(SM_CYCAPTION);
    return 0;

Note that ptMaxSize is being set to __glutScreenWidth
and __glutScreenHeight, which have been observed to be
the initial desktop resolution - which may in fact be
smaller or larger than the appropriate fullscreen
"maximimised" resolution for WM_GETMINMAXINFO.

The two lines of code in question:

    minmax->ptMaxSize.x = __glutScreenWidth;
    minmax->ptMaxSize.y = __glutScreenHeight;

Seem to be trying to "guarantee" that a maximised GLUT
window will be fullscreen - but fails due to __glutScreenWidth
and __glutScreenHeight being wrong.

The proposed fix is to simply remove these two lines.

Observations:

- freeglut doesn't pay any attention to WM_GETMINMAXINFO.
- Nate Robbins GLUT 3.7.6 doesn't touch ptMaxSize, although
  it does adjust ptMinTrackSize and ptMaxTrackSize
- The Mark Kilgard GLUT shipped with the Cg toolkit exhibits
  the same runtime problem as MesaGlut 7.5

An alternative might be to ensure that __glutScreenWidth
and __glutScreenHeight are upto date for WM_GETMINMAXINFO,
or directly querying for the current (primary) desktop
resolution.  But this seems like a lot of testing and
support without a clearer rationale for messing with
ptMaxSize.

See also:
http://en.wikipedia.org/wiki/Desktop_Window_Manager
http://msdn.microsoft.com/en-us/library/ms632626(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms632605(VS.85).aspx

  "...
   ptMaxSize
    Specifies the maximized width ( POINT.x) and the maximized
    height (POINT.y) of the window. For top-level windows, this
    value is based on the width of the primary monitor...."

The proposed patch, relative to MesaGlut 7.5:

551,552d550
<     minmax->ptMaxSize.x = __glutScreenWidth;
<     minmax->ptMaxSize.y = __glutScreenHeight;


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to