[PATCH 3/5] winex11: Properly calculate the virtual screen rect in xinerama_init().

Henri Verbeet hverbeet at codeweavers.com
Sun Jul 15 08:44:59 CDT 2012


Use the union of the individual monitor rects instead of the primary display
size. Currently these end up being the same because we disable everything but
the primary display on mode changes, but the next patch will change that.
---
 dlls/winex11.drv/xinerama.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c
index b2014ed..84db8ba 100644
--- a/dlls/winex11.drv/xinerama.c
+++ b/dlls/winex11.drv/xinerama.c
@@ -177,6 +177,7 @@ void xinerama_init( unsigned int width, unsigned int height )
     }
 
     primary = get_primary();
+    SetRectEmpty( &virtual_screen_rect );
 
     /* coordinates (0,0) have to point to the primary monitor origin */
     OffsetRect( &rect, -primary->rcMonitor.left, -primary->rcMonitor.top );
@@ -184,17 +185,17 @@ void xinerama_init( unsigned int width, unsigned int height )
     {
         OffsetRect( &monitors[i].rcMonitor, rect.left, rect.top );
         OffsetRect( &monitors[i].rcWork, rect.left, rect.top );
+        UnionRect( &virtual_screen_rect, &virtual_screen_rect, &monitors[i].rcMonitor );
         TRACE( "monitor %p: %s work %s%s\n",
                index_to_monitor(i), wine_dbgstr_rect(&monitors[i].rcMonitor),
                wine_dbgstr_rect(&monitors[i].rcWork),
                (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(&rect), screen_width, screen_height );
+           wine_dbgstr_rect(&virtual_screen_rect), screen_width, screen_height );
 
     wine_tsx11_unlock();
 }
-- 
1.7.8.6




More information about the wine-patches mailing list