These calls are Wine-specific and expected to fail on Windows, as the
escape codes and parameter combinations are likely invalid there. There
doesn't seem to be any mechanism to do this otherwise.
When a window presentation rect has been set, the window is meant to be
presented to that rect on screen exactly, mapped to physical coords.
Then this also has the following side effects:
* In exclusive fullscreen mode, GDI drawn child windows are clipped out
of the rendered screen, regardless of the normal clipping rules.
* The window position and size changes should be ignored wrt its visible
area, and in particular the window should not be unmapped even if its
Win32 rect is moved to an invisible location.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58844
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58443
---
This only introduces the mechanism and calls it from Wine D3D side. The
side effects will be implemented later in win32u and the user drivers.
This is necessary both for Command & Conquer 2, which has dialog child
windows covering the entire game window while using WS_CLIPCHILDREN, and
for Fallout 3 which does a bogus call sequence after window restoration
which moves the window outside of screen area and causes its window and
client rects to be empty:
```
SetRect(&rect, 0, 0, width, height);
AdjustWindowRectEx(&rect, style, FALSE, 0);
SetWindowPos(hwnd, 0, rect.left, rect.bottom, rect.right - rect.left,
rect.top - rect.bottom, 0);
```
We need either this kind of mechanism (which could be later changed to
some D3DKMTPresent call, but it would require a lot more work and I'd like
to fix those regressions before the release), or to hook the window proc
like modern Windows seems to be doing as tested in !9549 (and more tests
suggest that invalid window moves are also now inhibited and corrected on
modern Windows).
--
v4: wined3d: Use the present rather than client rect when fullscreen.
wined3d: Set the window present rect when entering fullscreen mode.
win32u: Introduce a D3DKMT escape code to set fullscreen present rect.
https://gitlab.winehq.org/wine/wine/-/merge_requests/9585
wglSetPixelFormatWINE now sets the internal pixel format privately on
each DC, and it is unnecessary to restore the window pixel format.
That call is even undesirable as it allocates and destroys a private
OpenGL drawable when the DC is acquired, its internal pixel format is
set, and the DC is then immediately released.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/9653
--
v2: dmsynth: Clear the buffer notifications before closing the event handle.
dmsynth: Estimate a continuously-advancing buffer position for a more precise timing.
dmsynth: Call GetCurrentPosition from a separate thread.
https://gitlab.winehq.org/wine/wine/-/merge_requests/9651