Commit e00840cf authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Only update the virtual screen rect once in xinerama_init to minimize race conditions.

parent e14261db
......@@ -138,14 +138,15 @@ void xinerama_init( unsigned int width, unsigned int height )
{
MONITORINFOEXW *primary;
int i;
RECT rect;
wine_tsx11_lock();
SetRect( &virtual_screen_rect, 0, 0, width, height );
SetRect( &rect, 0, 0, width, height );
if (root_window != DefaultRootWindow( gdi_display ) || !query_screens())
{
default_monitor.rcWork = default_monitor.rcMonitor = virtual_screen_rect;
default_monitor.rcWork = default_monitor.rcMonitor = rect;
nb_monitors = 1;
monitors = &default_monitor;
}
......@@ -153,20 +154,21 @@ void xinerama_init( unsigned int width, unsigned int height )
primary = get_primary();
/* coordinates (0,0) have to point to the primary monitor origin */
OffsetRect( &virtual_screen_rect, -primary->rcMonitor.left, -primary->rcMonitor.top );
OffsetRect( &rect, -primary->rcMonitor.left, -primary->rcMonitor.top );
for (i = 0; i < nb_monitors; i++)
{
OffsetRect( &monitors[i].rcMonitor, virtual_screen_rect.left, virtual_screen_rect.top );
OffsetRect( &monitors[i].rcWork, virtual_screen_rect.left, virtual_screen_rect.top );
OffsetRect( &monitors[i].rcMonitor, rect.left, rect.top );
OffsetRect( &monitors[i].rcWork, rect.left, rect.top );
TRACE( "monitor %p: %s%s\n",
index_to_monitor(i), wine_dbgstr_rect(&monitors[i].rcMonitor),
(monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? " (primary)" : "" );
}
virtual_screen_rect = rect;
screen_width = primary->rcMonitor.right - primary->rcMonitor.left;
screen_height = primary->rcMonitor.bottom - primary->rcMonitor.top;
TRACE( "virtual size: %s primary size: %dx%d\n",
wine_dbgstr_rect(&virtual_screen_rect), screen_width, screen_height );
wine_dbgstr_rect(&rect), screen_width, screen_height );
wine_tsx11_unlock();
ClipCursor( NULL ); /* reset the cursor clip rectangle */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment