Alexandre Julliard : x11drv: Get rid of the using_wine_desktop flag.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 27 14:50:29 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 6bb18e24e9e3c17e514cc899a59d7237676ccedb
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=6bb18e24e9e3c17e514cc899a59d7237676ccedb

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar 27 15:33:43 2006 +0200

x11drv: Get rid of the using_wine_desktop flag.

---

 dlls/x11drv/window.c      |    9 +++++----
 dlls/x11drv/x11drv.h      |    1 -
 dlls/x11drv/x11drv_main.c |    2 --
 dlls/x11drv/xrandr.c      |    2 +-
 dlls/x11drv/xvidmode.c    |    8 ++++----
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c
index 5cac2ed..e8c376d 100644
--- a/dlls/x11drv/window.c
+++ b/dlls/x11drv/window.c
@@ -119,9 +119,10 @@ BOOL X11DRV_is_window_rect_mapped( const
  *
  * Fill the window attributes structure for an X window.
  */
-static int get_window_attributes( struct x11drv_win_data *data, XSetWindowAttributes *attr )
+static int get_window_attributes( Display *display, struct x11drv_win_data *data,
+                                  XSetWindowAttributes *attr )
 {
-    if (!data->managed && !using_wine_desktop && is_window_managed( data->hwnd ))
+    if (!data->managed && (root_window == DefaultRootWindow( display )) && is_window_managed( data->hwnd ))
     {
         data->managed = TRUE;
         SetPropA( data->hwnd, managed_prop, (HANDLE)1 );
@@ -142,7 +143,7 @@ static int get_window_attributes( struct
 void X11DRV_sync_window_style( Display *display, struct x11drv_win_data *data )
 {
     XSetWindowAttributes attr;
-    int mask = get_window_attributes( data, &attr );
+    int mask = get_window_attributes( display, data, &attr );
 
     wine_tsx11_lock();
     if (data->whole_window != DefaultRootWindow(display))
@@ -654,7 +655,7 @@ static Window create_whole_window( Displ
     if (!(cx = rect.right - rect.left)) cx = 1;
     if (!(cy = rect.bottom - rect.top)) cy = 1;
 
-    mask = get_window_attributes( data, &attr );
+    mask = get_window_attributes( display, data, &attr );
 
     /* set the attributes that don't change over the lifetime of the window */
     attr.bit_gravity   = NorthWestGravity;
diff --git a/dlls/x11drv/x11drv.h b/dlls/x11drv/x11drv.h
index 98c0e93..5976c7e 100644
--- a/dlls/x11drv/x11drv.h
+++ b/dlls/x11drv/x11drv.h
@@ -262,7 +262,6 @@ extern int client_side_with_render;
 extern int client_side_antialias_with_core;
 extern int client_side_antialias_with_render;
 extern int using_client_side_fonts;
-extern int using_wine_desktop;
 extern void X11DRV_XRender_Init(void);
 extern void X11DRV_XRender_Finalize(void);
 extern BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE*, HFONT);
diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c
index 55226d4..757eff7 100644
--- a/dlls/x11drv/x11drv_main.c
+++ b/dlls/x11drv/x11drv_main.c
@@ -82,7 +82,6 @@ int client_side_with_core = 1;
 int client_side_with_render = 1;
 int client_side_antialias_with_core = 1;
 int client_side_antialias_with_render = 1;
-int using_wine_desktop = 0;
 int copy_default_colors = 128;
 int alloc_system_colors = 256;
 DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES;
@@ -424,7 +423,6 @@ static BOOL process_attach(void)
     if (desktop_geometry)
     {
         root_window = X11DRV_create_desktop( desktop_vi, desktop_geometry );
-        using_wine_desktop = 1;
     }
     if(desktop_vi)
         XFree(desktop_vi);
diff --git a/dlls/x11drv/xrandr.c b/dlls/x11drv/xrandr.c
index 96b5a7a..fbe4350 100644
--- a/dlls/x11drv/xrandr.c
+++ b/dlls/x11drv/xrandr.c
@@ -254,7 +254,7 @@ void X11DRV_XRandR_Init(void)
 
     if (xrandr_major) return; /* already initialized? */
     if (!usexrandr) return; /* disabled in config */
-    if (using_wine_desktop) return; /* not compatible with desktop mode */
+    if (root_window != DefaultRootWindow( gdi_display )) return;
     if (!load_xrandr()) return;  /* can't load the Xrandr library */
 
     /* see if Xrandr is available */
diff --git a/dlls/x11drv/xvidmode.c b/dlls/x11drv/xvidmode.c
index 20af410..c32bd59 100644
--- a/dlls/x11drv/xvidmode.c
+++ b/dlls/x11drv/xvidmode.c
@@ -172,14 +172,14 @@ void X11DRV_XF86VM_Init(void)
 #endif /* X_XF86VidModeSetGammaRamp */
 
       /* retrieve modes */
-      if (!using_wine_desktop) ok = XF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes, &real_xf86vm_modes);
+      if (root_window == DefaultRootWindow( gdi_display ))
+          ok = XF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes, &real_xf86vm_modes);
+      else
+          ok = FALSE; /* In desktop mode, do not switch resolution... But still use the Gamma ramp stuff */
   }
   wine_tsx11_unlock();
   if (!ok) return;
 
-  /* In desktop mode, do not switch resolution... But still use the Gamma ramp stuff */
-  if (using_wine_desktop) return;
-  
   TRACE("XVidMode modes: count=%d\n", nmodes);
 
   real_xf86vm_mode_count = nmodes;




More information about the wine-cvs mailing list