From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 73478438928..1762e2c8228 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2303,9 +2303,9 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_
if (!(flags & ULW_COLORKEY)) key = CLR_INVALID; window_surface_set_layered( surface, key, -1, 0xff000000 ); - window_surface_flush( surface );
user_driver->pUpdateLayeredWindow( hwnd, flags ); + window_surface_flush( surface ); }
done:
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 8b7d24f59b5..febfad984e2 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1252,8 +1252,6 @@ static void map_window( HWND hwnd, DWORD new_style ) sync_window_style( data ); XMapWindow( data->display, data->whole_window ); XFlush( data->display ); - if (data->surface && data->vis.visualid != default_visual.visualid) - window_surface_flush( data->surface ); } else set_xembed_flags( data, XEMBED_MAPPED );
@@ -2762,9 +2760,6 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons }
XFlush( data->display ); /* make sure changes are done before we start painting again */ - if (data->surface && data->vis.visualid != default_visual.visualid) - window_surface_flush( data->surface ); - release_win_data( data ); }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winemac.drv/macdrv.h | 1 - dlls/winemac.drv/surface.c | 6 ------ dlls/winemac.drv/window.c | 18 ------------------ 3 files changed, 25 deletions(-)
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 7fffa8e722f..1c4d23298fa 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -193,7 +193,6 @@ extern BOOL macdrv_SystemParametersInfo(UINT action, UINT int_param, void *ptr_p unsigned int minimized : 1; /* is window minimized? */ unsigned int swap_interval : 1; /* GL swap interval for window */ struct window_surface *surface; - struct window_surface *unminimized_surface; };
extern struct macdrv_win_data *get_win_data(HWND hwnd); diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c index 9bca2a651e5..5e7f94f47ed 100644 --- a/dlls/winemac.drv/surface.c +++ b/dlls/winemac.drv/surface.c @@ -229,12 +229,6 @@ BOOL macdrv_CreateWindowSurface(HWND hwnd, BOOL layered, const RECT *surface_rec { data->layered = TRUE; data->ulw_layered = TRUE; - - if (data->unminimized_surface) - { - window_surface_release(data->unminimized_surface); - data->unminimized_surface = NULL; - } }
*surface = create_surface(hwnd, data->cocoa_window, surface_rect); diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 97f781738af..3737e2f916c 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -702,8 +702,6 @@ static void destroy_cocoa_window(struct macdrv_win_data *data) data->on_screen = FALSE; if (data->surface) window_surface_release(data->surface); data->surface = NULL; - if (data->unminimized_surface) window_surface_release(data->unminimized_surface); - data->unminimized_surface = NULL; }
@@ -1939,22 +1937,6 @@ void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, const if (data->cocoa_window && !data->ulw_layered) { if (surface) window_surface_add_ref(surface); - if (new_style & WS_MINIMIZE) - { - if (!data->unminimized_surface && data->surface) - { - data->unminimized_surface = data->surface; - window_surface_add_ref(data->unminimized_surface); - } - } - else - { - if (data->unminimized_surface) - { - window_surface_release(data->unminimized_surface); - data->unminimized_surface = NULL; - } - } if (data->surface) window_surface_release(data->surface); data->surface = surface; }
From: Rémi Bernon rbernon@codeweavers.com
This is called when per-pixel alpha status changes, which happens when window changes its layered (as in ULW) nature, and this should always trigger a window surface recreation anyway. --- dlls/winemac.drv/window.c | 26 -------------------------- 1 file changed, 26 deletions(-)
diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index 3737e2f916c..de2349e71f1 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -418,19 +418,6 @@ static void sync_window_region(struct macdrv_win_data *data, HRGN win_region) }
-/*********************************************************************** - * add_bounds_rect - */ -static inline void add_bounds_rect(RECT *bounds, const RECT *rect) -{ - if (rect->left >= rect->right || rect->top >= rect->bottom) return; - bounds->left = min(bounds->left, rect->left); - bounds->top = min(bounds->top, rect->top); - bounds->right = max(bounds->right, rect->right); - bounds->bottom = max(bounds->bottom, rect->bottom); -} - - /*********************************************************************** * sync_window_opacity */ @@ -438,7 +425,6 @@ static void sync_window_opacity(struct macdrv_win_data *data, BYTE alpha, BOOL per_pixel_alpha, DWORD flags) { CGFloat opacity = 1.0; - BOOL needs_flush = FALSE;
if (flags & LWA_ALPHA) opacity = alpha / 255.0;
@@ -450,18 +436,6 @@ static void sync_window_opacity(struct macdrv_win_data *data, BYTE alpha, TRACE("setting window %p/%p per-pixel-alpha to %d\n", data->hwnd, data->cocoa_window, per_pixel_alpha); macdrv_window_use_per_pixel_alpha(data->cocoa_window, per_pixel_alpha); data->per_pixel_alpha = per_pixel_alpha; - needs_flush = TRUE; - } - - if (needs_flush && data->surface) - { - RECT rect; - - rect = data->whole_rect; - OffsetRect(&rect, -data->whole_rect.left, -data->whole_rect.top); - window_surface_lock(data->surface); - add_bounds_rect(&data->surface->bounds, &rect); - window_surface_unlock(data->surface); } }
From: Rémi Bernon rbernon@codeweavers.com
The surface clip region is the region of the window that is visible, the expose_surface rect is the rect that has been exposed from the host point of view.
We want to invalidate the part that has been exposed and is visible, so we need to subtract the complement of the visible region from the rect. --- dlls/winex11.drv/bitblt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 7a3785ae398..5963bf98f3d 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1971,12 +1971,18 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) add_bounds_rect( &window_surface->bounds, &rc ); if (window_surface->clip_region) { + HRGN clipped = NtGdiCreateRectRgn( window_surface->rect.left, window_surface->rect.top, + window_surface->rect.right, window_surface->rect.bottom ); + NtGdiCombineRgn( clipped, clipped, window_surface->clip_region, RGN_DIFF ); + region = NtGdiCreateRectRgn( rect->left, rect->top, rect->right, rect->bottom ); - if (NtGdiCombineRgn( region, region, window_surface->clip_region, RGN_DIFF ) <= NULLREGION) + if (NtGdiCombineRgn( region, region, clipped, RGN_DIFF ) <= NULLREGION) { NtGdiDeleteObjectApp( region ); region = 0; } + + NtGdiDeleteObjectApp( clipped ); } window_surface_unlock( window_surface ); return region;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 67 ++++++++++++++++++++++++++ dlls/wineandroid.drv/window.c | 14 +----- dlls/winewayland.drv/wayland_surface.c | 5 +- dlls/winewayland.drv/waylanddrv.h | 1 - dlls/winewayland.drv/window.c | 17 ------- dlls/winex11.drv/bitblt.c | 32 ------------ dlls/winex11.drv/event.c | 16 +----- include/ntuser.h | 16 ++++++ 8 files changed, 90 insertions(+), 78 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1762e2c8228..a5499019176 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2068,6 +2068,67 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru return ret; }
+static HRGN expose_window_surface_rect( struct window_surface *surface, UINT flags, RECT dirty ) +{ + HRGN region, clipped; + + intersect_rect( &dirty, &dirty, &surface->rect ); + add_bounds_rect( &surface->bounds, &dirty ); + + if (!surface->clip_region || !flags) return 0; + + clipped = NtGdiCreateRectRgn( surface->rect.left, surface->rect.top, + surface->rect.right, surface->rect.bottom ); + NtGdiCombineRgn( clipped, clipped, surface->clip_region, RGN_DIFF ); + + region = NtGdiCreateRectRgn( dirty.left, dirty.top, dirty.right, dirty.bottom ); + if (NtGdiCombineRgn( region, region, clipped, RGN_DIFF ) <= NULLREGION) + { + NtGdiDeleteObjectApp( region ); + region = 0; + } + + NtGdiDeleteObjectApp( clipped ); + return region; +} + +static BOOL expose_window_surface( HWND hwnd, UINT flags, const RECT *rect, UINT dpi ) +{ + struct window_surface *surface; + struct window_rects rects; + HRGN region = 0; + WND *win; + + if (!(win = get_win_ptr( hwnd )) || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; + if ((surface = win->surface)) window_surface_add_ref( surface ); + rects = win->rects; + release_win_ptr( win ); + + if (surface) + { + window_surface_lock( surface ); + + if (!rect) add_bounds_rect( &surface->bounds, rect ); + else + { + RECT dirty = *rect; + OffsetRect( &dirty, rects.client.left - rects.visible.left, rects.client.top - rects.visible.top ); + if (!(region = expose_window_surface_rect( surface, flags, dirty ))) flags = 0; + else NtGdiOffsetRgn( region, rects.client.left - rects.visible.left, rects.client.top - rects.visible.top ); + } + + window_surface_unlock( surface ); + if (surface->alpha_mask) window_surface_flush( surface ); + + window_surface_release( surface ); + } + + if (flags) NtUserRedrawWindow( hwnd, rect, region, flags ); + if (region) NtGdiDeleteObjectApp( region ); + return TRUE; +} + + /******************************************************************* * NtUserGetWindowRgnEx (win32u.@) */ @@ -5778,6 +5839,12 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) return send_hardware_message( hwnd, params->flags, params->input, params->lparam ); }
+ case NtUserCallHwndParam_ExposeWindowSurface: + { + struct expose_window_surface_params *params = (void *)param; + return expose_window_surface( hwnd, params->flags, params->whole ? NULL : ¶ms->rect, params->dpi ); + } + /* temporary exports */ case NtUserSetWindowStyle: { diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 7eb37f05202..f0b94938f68 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1237,8 +1237,6 @@ void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) */ LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { - struct android_win_data *data; - switch (msg) { case WM_ANDROID_REFRESH: @@ -1246,17 +1244,9 @@ LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { update_gl_drawable( hwnd ); } - else if ((data = get_win_data( hwnd ))) + else { - struct window_surface *surface = data->surface; - if (surface) - { - window_surface_lock( surface ); - surface->bounds = surface->rect; - window_surface_unlock( surface ); - if (is_argb_surface( surface )) window_surface_flush( surface ); - } - release_win_data( data ); + NtUserExposeWindowSurface( hwnd, 0, NULL, 0 ); } return 0; default: diff --git a/dlls/winewayland.drv/wayland_surface.c b/dlls/winewayland.drv/wayland_surface.c index 39c3976cdfd..a2699d66e51 100644 --- a/dlls/winewayland.drv/wayland_surface.c +++ b/dlls/winewayland.drv/wayland_surface.c @@ -64,7 +64,10 @@ static void xdg_surface_handle_configure(void *data, struct xdg_surface *xdg_sur
/* Flush the window surface in case there is content that we weren't * able to flush before due to the lack of the initial configure. */ - if (initial_configure) wayland_window_flush(hwnd); + if (initial_configure) + { + NtUserExposeWindowSurface(hwnd, 0, NULL, 0); + } }
static const struct xdg_surface_listener xdg_surface_listener = diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h index 5bde94a0ac9..1a2eeeecb93 100644 --- a/dlls/winewayland.drv/waylanddrv.h +++ b/dlls/winewayland.drv/waylanddrv.h @@ -274,7 +274,6 @@ void wayland_shm_buffer_unref(struct wayland_shm_buffer *shm_buffer);
void wayland_window_surface_update_wayland_surface(struct window_surface *surface, const RECT *visible_rect, struct wayland_surface *wayland_surface); -void wayland_window_flush(HWND hwnd);
/********************************************************************** * Wayland Window diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index 233ca0e5a62..e8d6b770496 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -696,23 +696,6 @@ LRESULT WAYLAND_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam) return ret; }
-/********************************************************************** - * wayland_window_flush - * - * Flush the window_surface associated with a HWND. - */ -void wayland_window_flush(HWND hwnd) -{ - struct wayland_win_data *data = wayland_win_data_get(hwnd); - - if (!data) return; - - if (data->window_surface) - window_surface_flush(data->window_surface); - - wayland_win_data_release(data); -} - /********************************************************************** * wayland_surface_lock_hwnd */ diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 5963bf98f3d..be1ae962334 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1956,38 +1956,6 @@ failed: return NULL; }
-/*********************************************************************** - * expose_surface - */ -HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) -{ - HRGN region = 0; - RECT rc = *rect; - - if (window_surface->funcs != &x11drv_surface_funcs) return 0; /* we may get the null surface */ - - window_surface_lock( window_surface ); - OffsetRect( &rc, -window_surface->rect.left, -window_surface->rect.top ); - add_bounds_rect( &window_surface->bounds, &rc ); - if (window_surface->clip_region) - { - HRGN clipped = NtGdiCreateRectRgn( window_surface->rect.left, window_surface->rect.top, - window_surface->rect.right, window_surface->rect.bottom ); - NtGdiCombineRgn( clipped, clipped, window_surface->clip_region, RGN_DIFF ); - - region = NtGdiCreateRectRgn( rect->left, rect->top, rect->right, rect->bottom ); - if (NtGdiCombineRgn( region, region, clipped, RGN_DIFF ) <= NULLREGION) - { - NtGdiDeleteObjectApp( region ); - region = 0; - } - - NtGdiDeleteObjectApp( clipped ); - } - window_surface_unlock( window_surface ); - return region; -} -
/*********************************************************************** * CreateWindowSurface (X11DRV.@) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index c377bbc9984..635025aff97 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -876,7 +876,6 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) RECT rect, abs_rect; POINT pos; struct x11drv_win_data *data; - HRGN surface_region = 0; UINT flags = RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN;
TRACE( "win %p (%lx) %d,%d %dx%d\n", @@ -897,20 +896,8 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev ) rect.bottom = pos.y + event->height;
if (event->window != data->client_window) - { - if (data->surface) - { - surface_region = expose_surface( data->surface, &rect ); - if (!surface_region) flags = 0; - else NtGdiOffsetRgn( surface_region, data->whole_rect.left - data->client_rect.left, - data->whole_rect.top - data->client_rect.top ); - - if (data->vis.visualid != default_visual.visualid) - window_surface_flush( data->surface ); - } OffsetRect( &rect, data->whole_rect.left - data->client_rect.left, data->whole_rect.top - data->client_rect.top ); - }
if (event->window != root_window) { @@ -931,8 +918,7 @@ static BOOL X11DRV_Expose( HWND hwnd, XEvent *xev )
release_win_data( data );
- if (flags) redraw_window( hwnd, &rect, surface_region, flags ); - if (surface_region) NtGdiDeleteObjectApp( surface_region ); + NtUserExposeWindowSurface( hwnd, flags, &rect, get_win_monitor_dpi( hwnd ) ); return TRUE; }
diff --git a/include/ntuser.h b/include/ntuser.h index 4148c8cf0b6..61dfd7697c2 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1289,6 +1289,7 @@ enum NtUserCallHwndParam_SetWindowContextHelpId, NtUserCallHwndParam_ShowOwnedPopups, NtUserCallHwndParam_SendHardwareInput, + NtUserCallHwndParam_ExposeWindowSurface, /* temporary exports */ NtUserSetWindowStyle, }; @@ -1499,4 +1500,19 @@ static inline BOOL NtUserSendHardwareInput( HWND hwnd, UINT flags, const INPUT * return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_SendHardwareInput ); }
+struct expose_window_surface_params +{ + UINT flags; + BOOL whole; + RECT rect; + UINT dpi; +}; + +static inline BOOL NtUserExposeWindowSurface( HWND hwnd, UINT flags, const RECT *rect, UINT dpi ) +{ + struct expose_window_surface_params params = {.flags = flags, .whole = !rect, .dpi = dpi}; + if (rect) params.rect = *rect; + return NtUserCallHwndParam( hwnd, (UINT_PTR)¶ms, NtUserCallHwndParam_ExposeWindowSurface ); +} + #endif /* _NTUSER_ */
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/wineandroid.drv/android.h | 1 - dlls/wineandroid.drv/init.c | 1 - dlls/wineandroid.drv/window.c | 36 ---------------------------------- 3 files changed, 38 deletions(-)
diff --git a/dlls/wineandroid.drv/android.h b/dlls/wineandroid.drv/android.h index e5bae80f3fc..616bd5beffe 100644 --- a/dlls/wineandroid.drv/android.h +++ b/dlls/wineandroid.drv/android.h @@ -94,7 +94,6 @@ extern BOOL ANDROID_ProcessEvents( DWORD mask ); extern LRESULT ANDROID_DesktopWindowProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); extern void ANDROID_SetParent( HWND hwnd, HWND parent, HWND old_parent ); extern void ANDROID_SetCapture( HWND hwnd, UINT flags ); -extern void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ); extern UINT ANDROID_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ); extern LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ); extern BOOL ANDROID_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, struct window_rects *rects ); diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index d84a56716d8..d747ce5d091 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -345,7 +345,6 @@ static const struct user_driver_funcs android_drv_funcs = .pProcessEvents = ANDROID_ProcessEvents, .pSetCapture = ANDROID_SetCapture, .pSetParent = ANDROID_SetParent, - .pSetWindowStyle = ANDROID_SetWindowStyle, .pShowWindow = ANDROID_ShowWindow, .pWindowMessage = ANDROID_WindowMessage, .pWindowPosChanging = ANDROID_WindowPosChanging, diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index f0b94938f68..bb7a8985f3c 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -56,7 +56,6 @@ struct android_win_data RECT whole_rect; /* X window rectangle for the whole window relative to parent */ RECT client_rect; /* client area relative to parent */ ANativeWindow *window; /* native window wrapper that forwards calls to the desktop process */ - struct window_surface *surface; };
#define SWP_AGG_NOPOSCHANGE (SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_NOZORDER) @@ -690,10 +689,6 @@ static const struct window_surface_funcs android_surface_funcs = android_surface_destroy };
-static BOOL is_argb_surface( struct window_surface *surface ) -{ - return surface && surface->funcs == &android_surface_funcs && !!surface->alpha_mask; -}
/*********************************************************************** * create_surface @@ -1007,8 +1002,6 @@ void ANDROID_DestroyWindow( HWND hwnd )
if (!(data = get_win_data( hwnd ))) return;
- if (data->surface) window_surface_release( data->surface ); - data->surface = NULL; destroy_gl_drawable( hwnd ); free_win_data( data ); } @@ -1089,12 +1082,6 @@ void ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, con data->whole_rect = new_rects->visible; data->client_rect = new_rects->client;
- if (!is_argb_surface( data->surface )) - { - if (surface) window_surface_add_ref( surface ); - if (data->surface) window_surface_release( data->surface ); - data->surface = surface; - } if (!data->parent) owner = NtUserGetWindowRelative( hwnd, GW_OWNER ); release_win_data( data );
@@ -1209,29 +1196,6 @@ void ANDROID_SetCursor( HWND hwnd, HCURSOR handle ) }
-/*********************************************************************** - * ANDROID_SetWindowStyle - */ -void ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) -{ - struct android_win_data *data; - DWORD changed = style->styleNew ^ style->styleOld; - - if (hwnd == NtUserGetDesktopWindow()) return; - if (!(data = get_win_data( hwnd ))) return; - - if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */ - { - if (is_argb_surface( data->surface )) - { - if (data->surface) window_surface_release( data->surface ); - data->surface = NULL; - } - } - release_win_data( data ); -} - - /********************************************************************** * ANDROID_WindowMessage */
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winemac.drv/macdrv.h | 1 - dlls/winemac.drv/window.c | 8 -------- 2 files changed, 9 deletions(-)
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 1c4d23298fa..40fa08605c1 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -192,7 +192,6 @@ extern BOOL macdrv_SystemParametersInfo(UINT action, UINT int_param, void *ptr_p unsigned int per_pixel_alpha : 1; /* is window using per-pixel alpha? */ unsigned int minimized : 1; /* is window minimized? */ unsigned int swap_interval : 1; /* GL swap interval for window */ - struct window_surface *surface; };
extern struct macdrv_win_data *get_win_data(HWND hwnd); diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index de2349e71f1..f7d9dfd76ea 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -674,8 +674,6 @@ static void destroy_cocoa_window(struct macdrv_win_data *data) macdrv_destroy_cocoa_window(data->cocoa_window); data->cocoa_window = 0; data->on_screen = FALSE; - if (data->surface) window_surface_release(data->surface); - data->surface = NULL; }
@@ -1908,12 +1906,6 @@ void macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, const data->window_rect = new_rects->window; data->whole_rect = new_rects->visible; data->client_rect = new_rects->client; - if (data->cocoa_window && !data->ulw_layered) - { - if (surface) window_surface_add_ref(surface); - if (data->surface) window_surface_release(data->surface); - data->surface = surface; - }
TRACE("win %p/%p new_rects %s style %08x flags %08x surface %p\n", hwnd, data->cocoa_window, debugstr_window_rects(new_rects), new_style, swp_flags, surface);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 48 ++++++++++++++++----------------------- dlls/winex11.drv/x11drv.h | 1 - 2 files changed, 20 insertions(+), 29 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index febfad984e2..6e834457620 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -374,7 +374,7 @@ static void sync_window_style( struct x11drv_win_data *data ) } }
-static void sync_empty_window_shape( struct x11drv_win_data *data ) +static void sync_empty_window_shape( struct x11drv_win_data *data, struct window_surface *surface ) { #ifdef HAVE_LIBXSHAPE if (IsRectEmpty( &data->window_rect )) /* set an empty shape */ @@ -387,7 +387,7 @@ static void sync_empty_window_shape( struct x11drv_win_data *data ) { XShapeCombineMask( gdi_display, data->whole_window, ShapeBounding, 0, 0, None, ShapeSet ); /* invalidate surface shape to make sure it gets updated again */ - if (data->surface) window_surface_set_shape( data->surface, 0 ); + if (surface) window_surface_set_shape( surface, 0 ); } #endif } @@ -403,7 +403,7 @@ static void sync_window_region( struct x11drv_win_data *data, HRGN win_region ) HRGN hrgn = win_region;
if (!data->whole_window) return; - if (data->surface) return; /* use surface shape instead */ + if (client_side_graphics) return; /* use surface shape instead */ data->shaped = FALSE;
if (hrgn == (HRGN)1) /* hack: win_region == 1 means retrieve region from server */ @@ -1437,20 +1437,6 @@ static void sync_window_position( struct x11drv_win_data *data, update_net_wm_states( data ); data->configure_serial = NextRequest( data->display ); XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes ); -#ifdef HAVE_LIBXSHAPE - if (IsRectEmpty( old_window_rect ) != IsRectEmpty( &data->window_rect )) - sync_empty_window_shape( data ); - if (data->shaped) - { - int old_x_offset = old_window_rect->left - old_whole_rect->left; - int old_y_offset = old_window_rect->top - old_whole_rect->top; - int new_x_offset = data->window_rect.left - data->whole_rect.left; - int new_y_offset = data->window_rect.top - data->whole_rect.top; - if (old_x_offset != new_x_offset || old_y_offset != new_y_offset) - XShapeOffsetShape( data->display, data->whole_window, ShapeBounding, - new_x_offset - old_x_offset, new_y_offset - old_y_offset ); - } -#endif
TRACE( "win %p/%lx pos %d,%d,%dx%d after %lx changes=%x serial=%lu\n", data->hwnd, data->whole_window, (int)data->whole_rect.left, (int)data->whole_rect.top, @@ -1794,7 +1780,7 @@ static void create_whole_window( struct x11drv_win_data *data ) sync_window_text( data->display, data->whole_window, text );
/* set the window region */ - if (IsRectEmpty( &data->window_rect )) sync_empty_window_shape( data ); + if (IsRectEmpty( &data->window_rect )) sync_empty_window_shape( data, NULL ); else if (win_rgn) sync_window_region( data, win_rgn );
/* set the window opacity */ @@ -1856,8 +1842,6 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des } /* Outlook stops processing messages after destroying a dialog, so we need an explicit flush */ XFlush( data->display ); - if (data->surface) window_surface_release( data->surface ); - data->surface = NULL; NtUserRemoveProp( data->hwnd, whole_window_prop ); }
@@ -1873,8 +1857,6 @@ void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BO Window client_window = data->client_window;
if (!data->use_alpha == !use_alpha && same_visual) return; - if (data->surface) window_surface_release( data->surface ); - data->surface = NULL; data->use_alpha = use_alpha;
if (same_visual) return; @@ -2668,12 +2650,6 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons data->window_rect = new_rects->window; data->whole_rect = new_rects->visible; data->client_rect = new_rects->client; - if (data->vis.visualid == default_visual.visualid) - { - if (surface) window_surface_add_ref( surface ); - if (data->surface) window_surface_release( data->surface ); - data->surface = surface; - }
TRACE( "win %p/%lx new_rects %s style %08x flags %08x\n", hwnd, data->whole_window, debugstr_window_rects(new_rects), new_style, swp_flags ); @@ -2723,7 +2699,23 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, cons /* don't change position if we are about to minimize or maximize a managed window */ if (!event_type && !(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) + { sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); +#ifdef HAVE_LIBXSHAPE + if (IsRectEmpty( &old_window_rect ) != IsRectEmpty( &data->window_rect )) + sync_empty_window_shape( data, surface ); + if (data->shaped) + { + int old_x_offset = old_window_rect.left - old_whole_rect.left; + int old_y_offset = old_window_rect.top - old_whole_rect.top; + int new_x_offset = data->window_rect.left - data->whole_rect.left; + int new_y_offset = data->window_rect.top - data->whole_rect.top; + if (old_x_offset != new_x_offset || old_y_offset != new_y_offset) + XShapeOffsetShape( data->display, data->whole_window, ShapeBounding, + new_x_offset - old_x_offset, new_y_offset - old_y_offset ); + } +#endif + }
if ((new_style & WS_VISIBLE) && ((new_style & WS_MINIMIZE) || is_window_rect_mapped( &new_rects->window ))) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 83e7889fb59..9b070efa745 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -617,7 +617,6 @@ struct x11drv_win_data DWORD net_wm_state; /* bit mask of active x11drv_net_wm_state values */ Window embedder; /* window id of embedder */ unsigned long configure_serial; /* serial number of last configure request */ - struct window_surface *surface; Pixmap icon_pixmap; Pixmap icon_mask; unsigned long *icon_bits;