XVidMode default mode

Alex Pasadyn ajp at mail.utexas.edu
Mon Feb 2 14:18:39 CST 2004


ChangeLog:
- Use the first mode in the XVidMode mode list as the default


I haven't been able to find documentation on this, but experimentation 
indicates that the first mode in the mode list provided by XVidMode is 
the default, even if it differs from the size of the desktop.

(The XRandR docs say that the first mode it presents is the default. 
Interestingly, the two extensions list the modes in a different order 
for me, but they do both put the same one first.)

This is a preparation for a simple "restore default mode" utility that 
people can use in case Wine crashes running a full-screen game.

-ajp
-------------- next part --------------
Index: dlls/x11drv/xvidmode.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xvidmode.c,v
retrieving revision 1.27
diff -u -r1.27 xvidmode.c
--- dlls/x11drv/xvidmode.c	20 Jan 2004 22:48:57 -0000	1.27
+++ dlls/x11drv/xvidmode.c	2 Feb 2004 19:37:03 -0000
@@ -57,7 +57,6 @@
 static unsigned int dd_mode_count;
 static XF86VidModeModeInfo** real_xf86vm_modes;
 static unsigned int real_xf86vm_mode_count;
-static unsigned int xf86vm_initial_mode = 0;
 
 static void convert_modeinfo( const XF86VidModeModeInfo *mode)
 {
@@ -114,7 +113,7 @@
       return i;
     }
   ERR("In unknown mode, returning default\n");
-  return xf86vm_initial_mode;
+  return 0;
 }
 
 void X11DRV_XF86VM_SetCurrentMode(int mode)
@@ -211,9 +210,8 @@
 
   TRACE("Available DD modes: count=%d\n", dd_mode_count);
 
-  /* store the current mode at the time we started */
-  xf86vm_initial_mode = X11DRV_XF86VM_GetCurrentMode();
-  X11DRV_Settings_SetDefaultMode(xf86vm_initial_mode);
+  /* the first mode in the list seems to be the default */
+  X11DRV_Settings_SetDefaultMode(0);
   
   TRACE("Enabling XVidMode\n");
 }


More information about the wine-patches mailing list