From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57453 --- dlls/winex11.drv/window.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index dee8bec18d0..6228d2e0409 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -104,6 +104,10 @@ static XContext host_window_context = 0; static Time last_user_time; static Window user_time_window;
+/* list of _NET_SUPPORTED atoms */ +static Atom *net_supported; +static int net_supported_count; + static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = @@ -3260,26 +3264,9 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) /*********************************************************************** * is_netwm_supported */ -static BOOL is_netwm_supported( Display *display, Atom atom ) +static BOOL is_netwm_supported( Atom atom ) { - static Atom *net_supported; - static int net_supported_count = -1; int i; - - if (net_supported_count == -1) - { - Atom type; - int format; - unsigned long count, remaining; - - if (!XGetWindowProperty( display, DefaultRootWindow(display), x11drv_atom(_NET_SUPPORTED), 0, - ~0UL, False, XA_ATOM, &type, &format, &count, - &remaining, (unsigned char **)&net_supported )) - net_supported_count = get_property_size( format, count ) / sizeof(Atom); - else - net_supported_count = 0; - } - for (i = 0; i < net_supported_count; i++) if (net_supported[i] == atom) return TRUE; return FALSE; @@ -3364,7 +3351,7 @@ LRESULT X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam, const POINT
if (NtUserGetWindowLongW( hwnd, GWL_STYLE ) & WS_MAXIMIZE) goto failed;
- if (!is_netwm_supported( data->display, x11drv_atom(_NET_WM_MOVERESIZE) )) + if (!is_netwm_supported( x11drv_atom(_NET_WM_MOVERESIZE) )) { TRACE( "_NET_WM_MOVERESIZE not supported\n" ); goto failed; @@ -3410,6 +3397,14 @@ void X11DRV_FlashWindowEx( FLASHWINFO *pfinfo )
void init_win_context(void) { + unsigned long count, remaining; + int format; + Atom type; + + if (!XGetWindowProperty( gdi_display, DefaultRootWindow( gdi_display ), x11drv_atom(_NET_SUPPORTED), 0, 65536 / sizeof(CARD32), + False, XA_ATOM, &type, &format, &count, &remaining, (unsigned char **)&net_supported )) + net_supported_count = get_property_size( format, count ) / sizeof(Atom); + init_recursive_mutex( &win_data_mutex );
winContext = XUniqueContext();