From: Rémi Bernon rbernon@codeweavers.com
This might happen if the window manager is restarted or changed while a Wine window is opened. We should support that use case properly. --- dlls/winex11.drv/event.c | 17 +++++++++++++++++ dlls/winex11.drv/window.c | 2 +- dlls/winex11.drv/x11drv_main.c | 1 + 3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 65b31518691..cf9fd96a2fb 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -1245,6 +1245,21 @@ static void handle_net_wm_state_notify( HWND hwnd, XPropertyEvent *event ) NtUserPostMessage( hwnd, WM_WINE_WINDOW_STATE_CHANGED, 0, 0 ); }
+static void handle_net_supported_notify( XPropertyEvent *event ) +{ + struct x11drv_thread_data *data = x11drv_thread_data(); + + if (data->net_supported) + { + data->net_supported_count = 0; + XFree( data->net_supported ); + data->net_supported = NULL; + data->net_wm_state_mask = 0; + } + + if (event->state == PropertyNewValue) net_supported_init( data ); +} + /*********************************************************************** * X11DRV_PropertyNotify */ @@ -1256,6 +1271,8 @@ static BOOL X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) if (event->atom == x11drv_atom(WM_STATE)) handle_wm_state_notify( hwnd, event ); if (event->atom == x11drv_atom(_XEMBED_INFO)) handle_xembed_info_notify( hwnd, event ); if (event->atom == x11drv_atom(_NET_WM_STATE)) handle_net_wm_state_notify( hwnd, event ); + if (event->atom == x11drv_atom(_NET_SUPPORTED)) handle_net_supported_notify( event ); + return TRUE; }
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 11864d3d515..9c3b0b8602d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2541,7 +2541,7 @@ void X11DRV_SystrayDockInit( HWND hwnd ) sprintf( systray_buffer, "_NET_SYSTEM_TRAY_S%u", DefaultScreen( display ) ); systray_atom = XInternAtom( display, systray_buffer, False ); } - XSelectInput( display, root_window, StructureNotifyMask ); + XSelectInput( display, root_window, StructureNotifyMask | PropertyChangeMask ); }
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 6e2690e1817..e58d3afca63 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -751,6 +751,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) set_queue_display_fd( data->display ); NtUserGetThreadInfo()->driver_data = (UINT_PTR)data;
+ XSelectInput( data->display, DefaultRootWindow( data->display ), PropertyChangeMask ); if (use_xim) xim_thread_attach( data ); x11drv_xinput2_init( data ); net_supported_init( data );