From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/window.c | 44 +++++---------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index f70e74296cd..5ba049c7cd8 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1122,35 +1122,6 @@ void update_user_time( Time time ) XUnlockDisplay( gdi_display ); }
-static void update_desktop_fullscreen( Display *display ) -{ - XEvent xev; - - if (!is_virtual_desktop()) return; - - xev.xclient.type = ClientMessage; - xev.xclient.window = root_window; - xev.xclient.message_type = x11drv_atom(_NET_WM_STATE); - xev.xclient.serial = 0; - xev.xclient.display = display; - xev.xclient.send_event = True; - xev.xclient.format = 32; - xev.xclient.data.l[0] = is_desktop_fullscreen() ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; - xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_FULLSCREEN); - xev.xclient.data.l[2] = 0; - xev.xclient.data.l[3] = 1; - - TRACE("action=%li\n", xev.xclient.data.l[0]); - - XSendEvent( display, DefaultRootWindow(display), False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev ); - - xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_MAXIMIZED_VERT); - xev.xclient.data.l[2] = x11drv_atom(_NET_WM_STATE_MAXIMIZED_HORZ); - XSendEvent( display, DefaultRootWindow(display), False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev ); -} - /* Update _NET_WM_FULLSCREEN_MONITORS when _NET_WM_STATE_FULLSCREEN is set to support fullscreen * windows spanning multiple monitors */ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) @@ -1338,18 +1309,18 @@ static void window_set_config( struct x11drv_win_data *data, const RECT *new_rec */ static void update_net_wm_states( struct x11drv_win_data *data ) { + static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT style, ex_style, new_state = 0;
if (!data->managed || data->embedded) return; if (data->whole_window == root_window) { - update_desktop_fullscreen(data->display); + if (is_virtual_desktop()) window_set_net_wm_state( data, is_desktop_fullscreen() ? fullscreen_mask : 0 ); return; }
style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ); - if (style & WS_MINIMIZE) - new_state |= data->desired_state.net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED)); + if (style & WS_MINIMIZE) new_state |= data->desired_state.net_wm_state & fullscreen_mask; if (data->is_fullscreen) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) @@ -2354,6 +2325,7 @@ BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ) /* initialize the desktop window id in the desktop manager process */ static BOOL create_desktop_win_data( Window win, HWND hwnd ) { + static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); struct x11drv_thread_data *thread_data = x11drv_thread_data(); Display *display = thread_data->display; struct x11drv_win_data *data; @@ -2363,6 +2335,7 @@ static BOOL create_desktop_win_data( Window win, HWND hwnd ) window_set_managed( data, TRUE ); NtUserSetProp( data->hwnd, whole_window_prop, (HANDLE)win ); set_initial_wm_hints( display, win ); + if (is_desktop_fullscreen()) window_set_net_wm_state( data, fullscreen_mask ); release_win_data( data ); if (thread_data->clip_window) XReparentWindow( display, thread_data->clip_window, win, 0, 0 ); return TRUE; @@ -2407,13 +2380,6 @@ void X11DRV_SetDesktopWindow( HWND hwnd ) ERR( "Failed to create virtual desktop window data\n" ); root_window = DefaultRootWindow( gdi_display ); } - else if (is_desktop_fullscreen()) - { - Display *display = x11drv_thread_data()->display; - TRACE("setting desktop to fullscreen\n"); - XChangeProperty( display, root_window, x11drv_atom(_NET_WM_STATE), XA_ATOM, 32, PropModeReplace, - (unsigned char*)&x11drv_atom(_NET_WM_STATE_FULLSCREEN), 1 ); - } } else {