From: Rémi Bernon rbernon@codeweavers.com
Fixes: 065d637e3eebbd0600b48f84447c5249cbea4752 --- dlls/winex11.drv/window.c | 2 +- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xinerama.c | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e154db1e23a..6b5cb4e44d5 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1168,7 +1168,7 @@ void window_set_user_time( struct x11drv_win_data *data, Time time, BOOL init ) * windows spanning multiple monitors */ static void update_net_wm_fullscreen_monitors( struct x11drv_win_data *data ) { - long *old_monitors = data->pending_state.monitors, monitors[4]; + long *old_monitors = data->pending_state.monitors, monitors[5]; /* 4 + 1 for xinerama generation */ XEvent xev;
if (!(data->pending_state.net_wm_state & (1 << NET_WM_STATE_FULLSCREEN)) || is_virtual_desktop() diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 1c7282d443d..3177cdb572e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -625,7 +625,7 @@ struct window_state BOOL activate; UINT net_wm_state; MwmHints mwm_hints; - long monitors[4]; + long monitors[5]; /* 4 + 1 for xinerama generation */ RECT rect; };
diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 096bd95f04e..e890d69701c 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -46,6 +46,7 @@ static MONITORINFOEXW default_monitor = };
static pthread_mutex_t xinerama_mutex = PTHREAD_MUTEX_INITIALIZER; +static unsigned long xinerama_generation; static MONITORINFOEXW *monitors; static int nb_monitors;
@@ -133,7 +134,7 @@ void xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ) pthread_mutex_lock( &xinerama_mutex ); if (nb_monitors == 1) { - memset( indices, 0, sizeof(*indices) * 4 ); + memset( indices, 0, sizeof(*indices) * 5 ); goto done; }
@@ -154,6 +155,7 @@ void xinerama_get_fullscreen_monitors( const RECT *rect, long *indices ) }
indices[0] = indices[1] = indices[2] = indices[3] = -1; + indices[4] = xinerama_generation; for (i = 0; i < nb_monitors; ++i) { SetRect( &monitor_rect, monitors[i].rcMonitor.left - offset.x, @@ -354,6 +356,7 @@ void xinerama_init( unsigned int width, unsigned int height ) (monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? " (primary)" : "" ); }
+ xinerama_generation++; pthread_mutex_unlock( &xinerama_mutex );
handler.name = "Xinerama";