Skip to content

Commit

Permalink
fshack: winex11.drv: Use fs_hack_monitor_from_rect() in X11DRV_ShowWi…
Browse files Browse the repository at this point in the history
…ndow().

fs_hack_monitor_from_hwnd() returns the primary monitor when the window is minimized. So a fullscreen
window on the secondary monitor that later gets minimized may be moved to the primary monitor when
fs_hack_monitor_from_hwnd() returns the primary monitor. Instead, we should use fs_hack_monitor_from_rect()
and use the updated window rectangle to retrieve the monitor a window should be fullscreen on.
fs_hack_monitor_from_hwnd() should only be used when not expecting window position changes.
  • Loading branch information
zzhiyi committed Nov 14, 2023
1 parent 793404f commit a351a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dlls/winex11.drv/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,7 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
&root, &x, &y, &width, &height, &border, &depth );
XTranslateCoordinates( thread_data->display, data->whole_window, root, 0, 0, &x, &y, &top );
pos = root_to_virtual_screen( x, y );
monitor = fs_hack_monitor_from_hwnd( hwnd );
monitor = fs_hack_monitor_from_rect( rect );
if (data->fs_hack ||
(fs_hack_enabled( monitor ) &&
fs_hack_matches_current_mode( monitor, rect->right - rect->left, rect->bottom - rect->top )))
Expand Down

0 comments on commit a351a90

Please sign in to comment.