From: Rémi Bernon rbernon@codeweavers.com
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 --- dlls/win32u/d3dkmt.c | 17 +++++++++++++++++ dlls/win32u/ntuser_private.h | 1 + include/ddk/d3dkmthk.h | 1 + 3 files changed, 19 insertions(+)
diff --git a/dlls/win32u/d3dkmt.c b/dlls/win32u/d3dkmt.c index 8da6886154a..baf99f69291 100644 --- a/dlls/win32u/d3dkmt.c +++ b/dlls/win32u/d3dkmt.c @@ -547,6 +547,23 @@ NTSTATUS WINAPI NtGdiDdDDIEscape( const D3DKMT_ESCAPE *desc ) return d3dkmt_object_update( &resource->obj, desc->pPrivateDriverData, desc->PrivateDriverDataSize ); }
+ case D3DKMT_ESCAPE_SET_PRESENT_RECT_WINE: + { + HWND hwnd = UlongToHandle( desc->hContext ); + RECT *rect = desc->pPrivateDriverData; + UINT dpi = get_dpi_for_window( hwnd ); + WND *win; + + if (desc->PrivateDriverDataSize != sizeof(*rect)) return STATUS_INVALID_PARAMETER; + + TRACE( "hwnd %p, rect %s\n", hwnd, wine_dbgstr_rect( rect ) ); + if (!(win = get_win_ptr( hwnd ))) return STATUS_INVALID_PARAMETER; + win->present_rect = map_dpi_rect( *rect, get_thread_dpi(), dpi ); + release_win_ptr( win ); + + return STATUS_SUCCESS; + } + default: FIXME( "(%p): stub\n", desc ); return STATUS_NO_MEMORY; diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index 14dcff3ad38..697e4c74203 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -51,6 +51,7 @@ typedef struct tagWND HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */ struct window_rects rects; /* window rects in window DPI, relative to the parent client area */ RECT normal_rect; /* Normal window rect saved when maximized/minimized */ + RECT present_rect; /* present rect for exclusive fullscreen mode */ POINT min_pos; /* Position for minimized window */ POINT max_pos; /* Position for maximized window */ WCHAR *text; /* Window text */ diff --git a/include/ddk/d3dkmthk.h b/include/ddk/d3dkmthk.h index 9f7e6d55a3d..a4da022e9aa 100644 --- a/include/ddk/d3dkmthk.h +++ b/include/ddk/d3dkmthk.h @@ -770,6 +770,7 @@ typedef enum _D3DKMT_ESCAPETYPE D3DKMT_ESCAPE_DIAGNOSTICS, /* Wine-specific escape codes */ D3DKMT_ESCAPE_UPDATE_RESOURCE_WINE = 0x80000000, + D3DKMT_ESCAPE_SET_PRESENT_RECT_WINE = 0x80000001, } D3DKMT_ESCAPETYPE;
typedef struct _D3DKMT_ESCAPE