Supersedes https://gitlab.winehq.org/wine/wine/-/merge_requests/8731 with stylistic fixups.
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/winex11.drv/window.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e9edc0022c8..b73db304cee 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1617,6 +1617,8 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) static const UINT fullscreen_mask = (1 << NET_WM_STATE_MAXIMIZED) | (1 << NET_WM_STATE_FULLSCREEN); UINT old_style = NtUserGetWindowLongW( data->hwnd, GWL_STYLE ), flags; RECT rect, old_rect = data->rects.window, new_rect; + unsigned int old_generation, generation; + long old_monitors[4], monitors[4];
if (!data->managed) return 0; /* unmanaged windows are managed by the Win32 side */ if (is_virtual_desktop()) return 0; /* ignore window manager config changes in virtual desktop mode */ @@ -1627,6 +1629,18 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) if (data->mwm_hints_serial) return 0; /* another MWM_HINT update is pending, wait for it to complete */ if (data->configure_serial) return 0; /* another config update is pending, wait for it to complete */
+ /* Ignore fullscreen config changes when it's still on the same monitor. This is needed because + * adding __NET_WM_STATE_FULLSCREEN will make WMs move the window to cover exactly the monitor + * rect. If the application sets a visible rect slightly larger than the monitor rect and insists + * on changing to the rect that it previously set when the rect is changed by the WM, then the + * window rect will be repeatedly changed by the WM and the application, causing a flickering effect */ + if (data->is_fullscreen) + { + xinerama_get_fullscreen_monitors( &data->rects.visible, &old_generation, old_monitors ); + xinerama_get_fullscreen_monitors( &data->current_state.rect, &generation, monitors ); + if (!memcmp( old_monitors, monitors, sizeof(monitors) )) return 0; + } + if ((old_style & WS_CAPTION) == WS_CAPTION || !data->is_fullscreen) { if ((data->current_state.net_wm_state & (1 << NET_WM_STATE_MAXIMIZED)) && !(old_style & WS_MAXIMIZE))
This merge request was approved by Rémi Bernon.
This merge request was approved by Zhiyi Zhang.