From: Zhiyi Zhang zzhang@codeweavers.com
If _NET_WM_FULLSCREEN_MONITORS is set then the property needs to be updated because it can't be deleted by sending a _NET_WM_FULLSCREEN_MONITORS client message to the root window according to the wm-spec version 1.5. Having the window spanning more than two monitors also needs the property set. In other cases, _NET_WM_FULLSCREEN_MONITORS doesn't need to be set. What's more, setting _NET_WM_FULLSCREEN_MONITORS adds a constraint on Mutter so that such a window can't be moved to another monitor by using the Shift+Super+Up/Down/Left/Right shortcut. So the property should be added only when necessary. --- dlls/winex11.drv/window.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ed3728773af..df189e3fe95 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -993,6 +993,38 @@ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) if (!xinerama_get_fullscreen_monitors( &data->whole_rect, monitors )) return;
+ /* If _NET_WM_FULLSCREEN_MONITORS is not set and the fullscreen monitors are spanning only one + * monitor then do not set _NET_WM_FULLSCREEN_MONITORS. + * + * If _NET_WM_FULLSCREEN_MONITORS is set then the property needs to be updated because it can't + * be deleted by sending a _NET_WM_FULLSCREEN_MONITORS client message to the root window + * according to the wm-spec version 1.5. Having the window spanning more than two monitors also + * needs the property set. In other cases, _NET_WM_FULLSCREEN_MONITORS doesn't need to be set. + * What's more, setting _NET_WM_FULLSCREEN_MONITORS adds a constraint on Mutter so that such a + * window can't be moved to another monitor by using the Shift+Super+Up/Down/Left/Right + * shortcut. So the property should be added only when necessary. */ + if (monitors[0] == monitors[1] && monitors[1] == monitors[2] && monitors[2] == monitors[3]) + { + unsigned long count, remaining; + BOOL prop_found = FALSE; + long *prop_data; + int format; + Atom type; + + if (!XGetWindowProperty( data->display, data->whole_window, + x11drv_atom(_NET_WM_FULLSCREEN_MONITORS), 0, ~0, False, + XA_CARDINAL, &type, &format, &count, &remaining, + (unsigned char **)&prop_data )) + { + if (type == XA_CARDINAL && format == 32 && count == 4) + prop_found = TRUE; + XFree( prop_data ); + } + + if (!prop_found) + return; + } + if (!data->mapped) { XChangeProperty( data->display, data->whole_window, x11drv_atom(_NET_WM_FULLSCREEN_MONITORS),