From: Rémi Bernon rbernon@codeweavers.com
And return the property value instead of updating the window data. --- dlls/winex11.drv/event.c | 4 ++-- dlls/winex11.drv/window.c | 12 +++++------- dlls/winex11.drv/x11drv.h | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 9e380141e18..8a60e817802 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1125,7 +1125,7 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); if ((style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen) { - read_net_wm_states( event->display, data ); + data->net_wm_state = get_window_net_wm_state( event->display, data->whole_window ); if ((data->net_wm_state & (1 << NET_WM_STATE_MAXIMIZED))) { if (!(style & WS_MAXIMIZE)) @@ -1226,7 +1226,7 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat if (data->iconic && data->wm_state == NormalState) /* restore window */ { data->iconic = FALSE; - read_net_wm_states( event->display, data ); + data->net_wm_state = get_window_net_wm_state( event->display, data->whole_window ); if ((style & WS_CAPTION) == WS_CAPTION && (data->net_wm_state & (1 << NET_WM_STATE_MAXIMIZED))) { if ((style & WS_MAXIMIZEBOX) && !(style & WS_DISABLED)) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e06b515025b..76bf99af032 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1213,7 +1213,7 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) /*********************************************************************** * update_net_wm_states */ -void update_net_wm_states( struct x11drv_win_data *data ) +static void update_net_wm_states( struct x11drv_win_data *data ) { UINT i, style, ex_style, new_state = 0;
@@ -1301,17 +1301,15 @@ void update_net_wm_states( struct x11drv_win_data *data ) /*********************************************************************** * read_net_wm_states */ -void read_net_wm_states( Display* display, struct x11drv_win_data *data ) +UINT get_window_net_wm_state( Display *display, Window window ) { Atom type, *state; int format; unsigned long i, j, count, remaining; - DWORD new_state = 0; + UINT new_state = 0; BOOL maximized_horz = FALSE;
- if (!data->whole_window) return; - - if (!XGetWindowProperty( display, data->whole_window, x11drv_atom(_NET_WM_STATE), 0, + if (!XGetWindowProperty( display, window, x11drv_atom(_NET_WM_STATE), 0, 65536/sizeof(CARD32), False, XA_ATOM, &type, &format, &count, &remaining, (unsigned char **)&state )) { @@ -1336,7 +1334,7 @@ void read_net_wm_states( Display* display, struct x11drv_win_data *data ) if (!maximized_horz) new_state &= ~(1 << NET_WM_STATE_MAXIMIZED);
- data->net_wm_state = new_state; + return new_state; }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 64380c1322f..83a423b8996 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -650,8 +650,7 @@ extern void destroy_vk_surface( HWND hwnd ); extern void wait_for_withdrawn_state( HWND hwnd, BOOL set ); extern Window init_clip_window(void); extern void update_user_time( Time time ); -extern void read_net_wm_states( Display *display, struct x11drv_win_data *data ); -extern void update_net_wm_states( struct x11drv_win_data *data ); +extern UINT get_window_net_wm_state( Display *display, Window window ); extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); extern void detach_client_window( struct x11drv_win_data *data, Window client_window );