Skip to content

Commit

Permalink
childwindow-proton: Update patches and move older version to legacy (#…
Browse files Browse the repository at this point in the history
…1190)

* childwindow-proton: Update patches

Rebase childwindow patches for compatibility with new commit: https://gitlab.winehq.org/wine/wine/-/commit/9e9d2d43c1d1931fd3450543b4913d339687d24c

Signed-off-by: Kirill Artemev <[email protected]>

* childwindow-proton: Move older version to legacy

Signed-off-by: Kirill Artemev <[email protected]>

* childwindow-proton: Update script for legacy version

Signed-off-by: Kirill Artemev <[email protected]>

* childwindow-proton: Small fix

Signed-off-by: Kirill Artemev <[email protected]>

---------

Signed-off-by: Kirill Artemev <[email protected]>
  • Loading branch information
Artewar67 committed Jun 9, 2024
1 parent 0baab04 commit 4cd49ad
Show file tree
Hide file tree
Showing 5 changed files with 1,246 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

# Standalone child window support for vk - Fixes World of Final Fantasy and others - https://bugs.winehq.org/show_bug.cgi?id=45277 - legacy patchset for older trees applied at an earlier stage in the script
if ( [ "$_childwindow_fix" = "true" ] && [ "$_proton_fs_hack" != "true" ] && [ "$_use_staging" = "true" ] ); then
if git merge-base --is-ancestor 64639c93c8cf03dc232b19365c1d0bc43969037c HEAD; then
if git merge-base --is-ancestor 9e9d2d43c1d1931fd3450543b4913d339687d24c HEAD; then
_patchname='childwindow-proton.patch' && _patchmsg="Applied child window for vk patch" && nonuser_patcher
elif git merge-base --is-ancestor 64639c93c8cf03dc232b19365c1d0bc43969037c HEAD; then
_patchname='childwindow-proton-9e9d2d43.patch' && _patchmsg="Applied child window for vk patch" && nonuser_patcher
elif git merge-base --is-ancestor 5481415d438d41ac2b9fe42beb669d19af3af974 HEAD; then
_patchname='childwindow-proton-64639c9.patch' && _patchmsg="Applied child window for vk patch" && nonuser_patcher
elif git merge-base --is-ancestor 28873ce8c426f696ceb16e3f5d98d5f5c5ed3b79 HEAD; then
Expand Down Expand Up @@ -42,8 +44,10 @@
fi

if ( [ "$_childwindow_fix" = "true" ] && [ "$_proton_fs_hack" != "true" ] && [ "$_use_staging" != "true" ] ); then
if git merge-base --is-ancestor 64639c93c8cf03dc232b19365c1d0bc43969037c HEAD; then
if git merge-base --is-ancestor 9e9d2d43c1d1931fd3450543b4913d339687d24c HEAD; then
_patchname='childwindow-proton-mainline.patch' && _patchmsg="Applied child window for vk patch (mainline)" && nonuser_patcher
elif git merge-base --is-ancestor 64639c93c8cf03dc232b19365c1d0bc43969037c HEAD; then
_patchname='childwindow-proton-mainline-9e9d2d43.patch' && _patchmsg="Applied child window for vk patch (mainline)" && nonuser_patcher
elif git merge-base --is-ancestor 5481415d438d41ac2b9fe42beb669d19af3af974 HEAD; then
_patchname='childwindow-proton-mainline-64639c9.patch' && _patchmsg="Applied child window for vk patch (mainline)" && nonuser_patcher
elif git merge-base --is-ancestor 28873ce8c426f696ceb16e3f5d98d5f5c5ed3b79 HEAD; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
free( surface );
}

@@ -126,6 +148,27 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR
@@ -126,6 +148,26 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR
struct surface *surface = surface_from_handle( surfaces[i] );

driver_funcs->p_vulkan_surface_presented( surface->hwnd, swapchain_res );
Expand All @@ -95,9 +95,8 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
+ UINT width, height;
+ RECT client_rect;
+ HDC hdc_dst;
+ UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
+
+ NtUserGetClientRect( surface->hwnd, &client_rect, dpi );
+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd));
+ width = client_rect.right - client_rect.left;
+ height = client_rect.bottom - client_rect.top;
+
Expand Down Expand Up @@ -161,7 +160,7 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
.p_vulkan_surface_detach = lazydrv_vulkan_surface_detach,
.p_vulkan_surface_presented = lazydrv_vulkan_surface_presented,
};
@@ -313,14 +367,123 @@ static void vulkan_init(void)
@@ -313,14 +367,122 @@ static void vulkan_init(void)

void vulkan_detach_surfaces( struct list *surfaces )
{
Expand Down Expand Up @@ -263,9 +262,8 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
+ {
+ RECT client_rect;
+ BOOL is_clipped;
+ UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
+
+ NtUserGetClientRect( surface->hwnd, &client_rect, dpi );
+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd));
+ NtUserMapWindowPoints( surface->hwnd, toplevel, (POINT *)&client_rect, 2 );
+ is_clipped = NtGdiRectInRegion( region, &client_rect );
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
free( surface );
}

@@ -126,6 +148,27 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR
@@ -126,6 +148,26 @@ static VkResult win32u_vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR
struct surface *surface = surface_from_handle( surfaces[i] );

driver_funcs->p_vulkan_surface_presented( surface->hwnd, swapchain_res );
Expand All @@ -95,9 +95,8 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
+ UINT width, height;
+ RECT client_rect;
+ HDC hdc_dst;
+ UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
+
+ NtUserGetClientRect( surface->hwnd, &client_rect, dpi );
+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd));
+ width = client_rect.right - client_rect.left;
+ height = client_rect.bottom - client_rect.top;
+
Expand Down Expand Up @@ -161,7 +160,7 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
.p_vulkan_surface_detach = lazydrv_vulkan_surface_detach,
.p_vulkan_surface_presented = lazydrv_vulkan_surface_presented,
};
@@ -313,14 +367,123 @@ static void vulkan_init(void)
@@ -313,14 +367,122 @@ static void vulkan_init(void)

void vulkan_detach_surfaces( struct list *surfaces )
{
Expand Down Expand Up @@ -263,9 +262,8 @@ index 5b128afe3cb3c1f752ed0f90b0e3b06915d27420..29c9dfbdb72cc9dc433cdd61ae0b6fba
+ {
+ RECT client_rect;
+ BOOL is_clipped;
+ UINT dpi = NTUSER_DPI_CONTEXT_GET_DPI( (UINT_PTR)GetThreadDpiAwarenessContext() );
+
+ NtUserGetClientRect( surface->hwnd, &client_rect, dpi );
+ NtUserGetClientRect( surface->hwnd, &client_rect, get_win_monitor_dpi(surface->hwnd));
+ NtUserMapWindowPoints( surface->hwnd, toplevel, (POINT *)&client_rect, 2 );
+ is_clipped = NtGdiRectInRegion( region, &client_rect );
+
Expand Down
Loading

0 comments on commit 4cd49ad

Please sign in to comment.