Instead of relying on the current X window rect, which may be offscreen for other reasons.
From: Rémi Bernon rbernon@codeweavers.com
Instead of relying on the current X window rect, which may be offscreen for other reasons.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57689 --- dlls/winex11.drv/window.c | 6 +++--- dlls/winex11.drv/x11drv.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 194e41e674e..32c3800abfe 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1603,7 +1603,7 @@ static UINT window_update_client_config( struct x11drv_win_data *data ) else if (IsRectEmpty( &rect )) flags |= SWP_NOSIZE;
/* don't sync win32 position for offscreen windows */ - if (!is_window_rect_mapped( &new_rect )) flags |= SWP_NOMOVE; + if ((data->is_offscreen = !is_window_rect_mapped( &new_rect ))) flags |= SWP_NOMOVE;
if ((flags & (SWP_NOSIZE | SWP_NOMOVE)) == (SWP_NOSIZE | SWP_NOMOVE)) return 0;
@@ -1801,8 +1801,8 @@ static void sync_window_position( struct x11drv_win_data *data, UINT swp_flags,
/* if the window has been moved offscreen by the window manager, we didn't tell the Win32 side about it */ window_rect = window_rect_from_visible( old_rects, data->desired_state.rect ); - if (!is_window_rect_mapped( &window_rect )) OffsetRect( &new_rect, window_rect.left - old_rects->window.left, - window_rect.top - old_rects->window.top ); + if (data->is_offscreen) OffsetRect( &new_rect, window_rect.left - old_rects->window.left, + window_rect.top - old_rects->window.top );
window_set_config( data, &new_rect, above ); } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 995df13e843..ee5bbe07dd4 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -634,6 +634,7 @@ struct x11drv_win_data UINT add_taskbar : 1; /* does window should be added to taskbar regardless of style */ UINT net_wm_fullscreen_monitors_set : 1; /* is _NET_WM_FULLSCREEN_MONITORS set */ UINT is_fullscreen : 1; /* is the window visible rect fullscreen */ + UINT is_offscreen : 1; /* has been moved offscreen by the window manager */ UINT parent_invalid : 1; /* is the parent host window possibly invalid */ Window embedder; /* window id of embedder */ Pixmap icon_pixmap;
This will fix several misplaced window issues, which happen in some cases with multiple monitors. I know this is very late for more changes, and another option would be to revert both 710b94e212501727b3b1b8deea06a7757df43d51 and b936f7426e33508538f48f7d20e7d7cb47cc1f32 (and reintroduce some imo smaller regression instead).