mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-01 19:38:31 +00:00
win32u: Restore surface rect, which may offsetted from the window rect.
Some drivers only create surfaces over the visible part of the window,
and the surface rect has an offset.
Fixes a regression from 5d0efbcc6e
, which
causes XSHM errors with partially offscreen windows.
This commit is contained in:
parent
e39a973778
commit
09b9c1b5fe
|
@ -188,7 +188,7 @@ void create_offscreen_window_surface( HWND hwnd, const RECT *visible_rect, struc
|
|||
/* create a new window surface */
|
||||
*surface = NULL;
|
||||
if (!(impl = calloc(1, sizeof(*impl)))) return;
|
||||
window_surface_init( &impl->header, &offscreen_window_surface_funcs, hwnd, info, 0 );
|
||||
window_surface_init( &impl->header, &offscreen_window_surface_funcs, hwnd, &surface_rect, info, 0 );
|
||||
impl->info = *info;
|
||||
|
||||
TRACE( "created window surface %p\n", &impl->header );
|
||||
|
@ -199,7 +199,7 @@ void create_offscreen_window_surface( HWND hwnd, const RECT *visible_rect, struc
|
|||
/* window surface common helpers */
|
||||
|
||||
W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct window_surface_funcs *funcs,
|
||||
HWND hwnd, BITMAPINFO *info, HBITMAP bitmap )
|
||||
HWND hwnd, const RECT *rect, BITMAPINFO *info, HBITMAP bitmap )
|
||||
{
|
||||
struct bitblt_coords coords = {0};
|
||||
struct gdi_image_bits bits;
|
||||
|
@ -208,7 +208,7 @@ W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct w
|
|||
surface->funcs = funcs;
|
||||
surface->ref = 1;
|
||||
surface->hwnd = hwnd;
|
||||
SetRect( &surface->rect, 0, 0, info->bmiHeader.biWidth, abs( info->bmiHeader.biHeight ) );
|
||||
surface->rect = *rect;
|
||||
pthread_mutex_init( &surface->mutex, NULL );
|
||||
reset_bounds( &surface->bounds );
|
||||
|
||||
|
@ -256,6 +256,7 @@ W32KAPI void window_surface_flush( struct window_surface *surface )
|
|||
|
||||
window_surface_lock( surface );
|
||||
|
||||
OffsetRect( &dirty, -dirty.left, -dirty.top );
|
||||
if (intersect_rect( &dirty, &dirty, &surface->bounds ))
|
||||
{
|
||||
TRACE( "Flushing hwnd %p, surface %p %s, bounds %s, dirty %s\n", surface->hwnd, surface,
|
||||
|
|
|
@ -792,7 +792,7 @@ static struct window_surface *create_surface( HWND hwnd, const RECT *rect,
|
|||
|
||||
surface = calloc( 1, FIELD_OFFSET( struct android_window_surface, info.bmiColors[3] ));
|
||||
if (!surface) return NULL;
|
||||
if (!window_surface_init( &surface->header, &android_surface_funcs, hwnd, info, 0 )) goto failed;
|
||||
if (!window_surface_init( &surface->header, &android_surface_funcs, hwnd, rect, info, 0 )) goto failed;
|
||||
memcpy( &surface->info, info, get_dib_info_size( info, DIB_RGB_COLORS ) );
|
||||
|
||||
surface->window = get_ioctl_window( hwnd );
|
||||
|
|
|
@ -147,7 +147,7 @@ struct window_surface *create_surface(HWND hwnd, macdrv_window window, const REC
|
|||
|
||||
surface = calloc(1, FIELD_OFFSET(struct macdrv_window_surface, info.bmiColors[3]));
|
||||
if (!surface) return NULL;
|
||||
if (!window_surface_init(&surface->header, &macdrv_surface_funcs, hwnd, info, 0)) goto failed;
|
||||
if (!window_surface_init(&surface->header, &macdrv_surface_funcs, hwnd, rect, info, 0)) goto failed;
|
||||
memcpy(&surface->info, info, offsetof(BITMAPINFO, bmiColors[3]));
|
||||
|
||||
surface->window = window;
|
||||
|
|
|
@ -470,7 +470,7 @@ struct window_surface *wayland_window_surface_create(HWND hwnd, const RECT *rect
|
|||
|
||||
wws = calloc(1, sizeof(*wws));
|
||||
if (!wws) return NULL;
|
||||
if (!window_surface_init(&wws->header, &wayland_window_surface_funcs, hwnd, info, 0)) goto failed;
|
||||
if (!window_surface_init(&wws->header, &wayland_window_surface_funcs, hwnd, rect, info, 0)) goto failed;
|
||||
wws->info = *info;
|
||||
|
||||
TRACE("created %p hwnd %p %s bits [%p,%p)\n", wws, hwnd, wine_dbgstr_rect(rect),
|
||||
|
|
|
@ -2098,7 +2098,7 @@ struct window_surface *create_surface( HWND hwnd, Window window, const XVisualIn
|
|||
surface->image = image;
|
||||
surface->byteswap = byteswap;
|
||||
|
||||
if (!window_surface_init( &surface->header, &x11drv_surface_funcs, hwnd, info, bitmap )) goto failed;
|
||||
if (!window_surface_init( &surface->header, &x11drv_surface_funcs, hwnd, rect, info, bitmap )) goto failed;
|
||||
memcpy( &surface->info, info, get_dib_info_size( info, DIB_RGB_COLORS ) );
|
||||
|
||||
surface->window = window;
|
||||
|
|
|
@ -235,7 +235,7 @@ struct window_surface
|
|||
};
|
||||
|
||||
W32KAPI BOOL window_surface_init( struct window_surface *surface, const struct window_surface_funcs *funcs,
|
||||
HWND hwnd, BITMAPINFO *info, HBITMAP bitmap );
|
||||
HWND hwnd, const RECT *rect, BITMAPINFO *info, HBITMAP bitmap );
|
||||
W32KAPI void window_surface_add_ref( struct window_surface *surface );
|
||||
W32KAPI void window_surface_release( struct window_surface *surface );
|
||||
W32KAPI void window_surface_lock( struct window_surface *surface );
|
||||
|
|
Loading…
Reference in a new issue