There is no guarantees in Wine to make sure the rectangles passed to Xlib calls fit the requirement of using YXBanded. See 'man 3 XSetClipRectangles' for details of YXBanded.
Fix a bug that OCTOPATH TRAVELER may crash with BadMatch X errors when changing resolutions in fullscreen mode.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/winex11.drv/bitblt.c | 4 ++-- dlls/winex11.drv/graphics.c | 2 +- dlls/winex11.drv/window.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index fad183b0b01..4e1a4430966 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1737,7 +1737,7 @@ static void update_surface_region( struct x11drv_window_surface *surface ) if ((data = X11DRV_GetRegionData( rgn, 0 ))) { XShapeCombineRectangles( gdi_display, surface->window, ShapeBounding, 0, 0, - (XRectangle *)data->Buffer, data->rdh.nCount, ShapeSet, YXBanded ); + (XRectangle *)data->Buffer, data->rdh.nCount, ShapeSet, Unsorted ); HeapFree( GetProcessHeap(), 0, data ); }
@@ -1879,7 +1879,7 @@ static void CDECL x11drv_surface_set_region( struct window_surface *window_surfa if ((data = X11DRV_GetRegionData( surface->region, 0 ))) { XSetClipRectangles( gdi_display, surface->gc, 0, 0, - (XRectangle *)data->Buffer, data->rdh.nCount, YXBanded ); + (XRectangle *)data->Buffer, data->rdh.nCount, Unsorted ); HeapFree( GetProcessHeap(), 0, data ); } } diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 77ca60ec44d..bf30227f319 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -252,7 +252,7 @@ static void update_x11_clipping( X11DRV_PDEVICE *physDev, HRGN rgn ) else if ((data = X11DRV_GetRegionData( rgn, 0 ))) { XSetClipRectangles( gdi_display, physDev->gc, physDev->dc_rect.left, physDev->dc_rect.top, - (XRectangle *)data->Buffer, data->rdh.nCount, YXBanded ); + (XRectangle *)data->Buffer, data->rdh.nCount, Unsorted ); HeapFree( GetProcessHeap(), 0, data ); } } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 457173964eb..43173d51eba 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -423,7 +423,7 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region ) data->window_rect.left - data->whole_rect.left, data->window_rect.top - data->whole_rect.top, (XRectangle *)pRegionData->Buffer, - pRegionData->rdh.nCount, ShapeSet, YXBanded ); + pRegionData->rdh.nCount, ShapeSet, Unsorted ); HeapFree(GetProcessHeap(), 0, pRegionData); data->shaped = TRUE; }
Zhiyi Zhang zzhang@codeweavers.com writes:
There is no guarantees in Wine to make sure the rectangles passed to Xlib calls fit the requirement of using YXBanded. See 'man 3 XSetClipRectangles' for details of YXBanded.
GDI regions are supposed to be YXBanded. If there's a place where that's not true it's a bug.