From: Zhiyi Zhang zzhang@codeweavers.com
Fix a regression from ee405dd. After ee405dd, is_window_rect_full_screen() may compare window rectangles against the empty rectangles of detached monitors. For example, is_window_rect_full_screen() can incorrectly return TRUE for a (0, 0, 1, 1) rectangle because 0 <= 0 && 1 >= 0 && 0 <= 0 && 1 >= 0 is true. --- dlls/win32u/sysparams.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index cd8e72b251f..f7bca4d9e73 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1846,6 +1846,9 @@ static BOOL is_window_rect_full_screen( const RECT *rect )
LIST_FOR_EACH_ENTRY( monitor, &monitors, struct monitor, entry ) { + if (!(monitor->dev.state_flags & DISPLAY_DEVICE_ACTIVE)) + continue; + if (rect->left <= monitor->rc_monitor.left && rect->right >= monitor->rc_monitor.right && rect->top <= monitor->rc_monitor.top && rect->bottom >= monitor->rc_monitor.bottom) {