Skip to content

Commit 1e38ded

Browse files
rbernonivyl
authored andcommitted
winex11: Try harder to get offscreen blit destination rectangle.
When toplevel is in another process we won't have window data. CW-Bug-Id: #25938
1 parent 1aa78ab commit 1e38ded

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

dlls/winex11.drv/opengl.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,15 +3301,21 @@ static void present_gl_drawable( HWND hwnd, HDC hdc, struct gl_drawable *gl, BOO
33013301
NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, dpi );
33023302
if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &gl->rect )) return;
33033303
rect_dst = map_rect_virt_to_raw_for_monitor( NtUserMonitorFromWindow( toplevel, MONITOR_DEFAULTTONEAREST ), rect_dst, dpi );
3304+
3305+
window = get_dc_drawable( hdc, &rect );
3306+
region = get_dc_monitor_region( hwnd, hdc );
3307+
33043308
if ((data = get_win_data( toplevel )))
33053309
{
33063310
OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left,
33073311
data->rects.client.top - data->rects.visible.top );
33083312
release_win_data( data );
33093313
}
3310-
3311-
window = get_dc_drawable( hdc, &rect );
3312-
region = get_dc_monitor_region( hwnd, hdc );
3314+
else
3315+
{
3316+
OffsetRect( &rect_dst, rect.left, rect.top );
3317+
WARN( "Using rect %s for other process window\n", wine_dbgstr_rect( &rect_dst ) );
3318+
}
33133319

33143320
if (get_dc_drawable( gl->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst ))
33153321
set_dc_drawable( gl->hdc_dst, window, &rect_dst, IncludeInferiors );

dlls/winex11.drv/vulkan.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,23 @@ static void X11DRV_vulkan_surface_presented( HWND hwnd, void *private, VkResult
341341
NtUserMapWindowPoints( hwnd, toplevel, (POINT *)&rect_dst, 2, dpi );
342342
if (IsRectEmpty( &rect_dst ) || IsRectEmpty( &surface->rect )) return;
343343
rect_dst = map_rect_virt_to_raw_for_monitor( NtUserMonitorFromWindow( toplevel, MONITOR_DEFAULTTONEAREST ), rect_dst, dpi );
344+
345+
if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return;
346+
window = X11DRV_get_whole_window( toplevel );
347+
region = get_dc_monitor_region( hwnd, hdc );
348+
344349
if ((data = get_win_data( toplevel )))
345350
{
346351
OffsetRect( &rect_dst, data->rects.client.left - data->rects.visible.left,
347352
data->rects.client.top - data->rects.visible.top );
348353
release_win_data( data );
349354
}
350-
351-
if (!(hdc = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_USESTYLE ))) return;
352-
window = X11DRV_get_whole_window( toplevel );
353-
region = get_dc_monitor_region( hwnd, hdc );
355+
else
356+
{
357+
get_dc_drawable( hdc, &rect );
358+
OffsetRect( &rect_dst, rect.left, rect.top );
359+
WARN( "Using rect %s for other process window\n", wine_dbgstr_rect( &rect_dst ) );
360+
}
354361

355362
if (get_dc_drawable( surface->hdc_dst, &rect ) != window || !EqualRect( &rect, &rect_dst ))
356363
set_dc_drawable( surface->hdc_dst, window, &rect_dst, IncludeInferiors );

0 commit comments

Comments
 (0)