Making wine default to the Mac Driver on OS X

Josh DuBois duboisj at codeweavers.com
Sat Mar 2 12:20:51 CST 2013


With Friday's release, I am interested in making the Mac Driver wine's 
default on OS X.  My own immediate motivation is largely so we at 
CodeWeavers can start testing it as a default internally (which 
obviously we can do on our own, regardless, if needed), but I figured 
I'd ask the wider community to see whether it's time in winehq also.

My question is how it should be configured from a user perspective. 
Right now one can set a registry key in

HKCU/Software/Wine/Drivers/Graphics

with a comma-separated list specifying the driver load order, and the 
first one successfully loaded will be used.  Absent the key, there is a 
hardcoded load order in user32/driver.c.  Right now that is just "x11."

Discussing with Alexandre the other day I believe his thought is to make 
the hardcoded default "x11,mac" in all cases (including Linux).  I 
believe (and I don't mean to put words in his mouth) that his thought is 
that a user should never have to edit the registry to switch between 
drivers.  The thought would be that in order to switch between drivers, 
a user must instead create an environment in which all drivers which are 
ahead of the desired driver in the hardcoded load order will fail to 
load.  I think that in the specific case of "x11,mac" on an OS X box, 
the thought was to unset DISPLAY if you want to run with the Mac Driver 
on, forcing X11 to fail and therefore getting the fallback.

I just now realized, though, that OS X 10.8 ships with stub X11 
libraries which behave badly.  If you try to load X11 on a brand-new OS 
X 10.8 machine, the user sees a dialog box with directions on 
downloading XQuartz, and the process which tried to load X11 is killed.  
I hadn't thought of that earlier, but it seems to weigh against using a 
fallback mechanism where x11 is attempted first in all cases.  It means 
that to get good behavior from the fall-through, a Mac user would be 
required to download and install real X libraries, then unset DISPLAY.

It seems broadly incorrect to me to attempt to load X11 first everywhere 
and force the user to make sure loading that fails if they want a 
different driver.  I think that if the Mac Driver is to be the default 
on a Mac, rather than assume the environment will be such that other 
drivers will fail, it should really just be the first thing wine tries 
to load.  The case of OS X's bad X11 stub libraries is one where it 
seems fairly onerous for a user to ensure X11 won't load.  Wayland isn't 
here now, but it seems like when it comes it may bring similar issues.

I propose an environment variable, WINEDRIVERLOADORDER.  I would think 
we would first use the registry value, then the value of 
WINEDRIVERLOADORDER, then the hardcoded fallback.  I would also propose 
making the hardcoded fallback differ on OS X and linux, so that a user 
who does nothing on OS X can have the Mac Driver, but someone who wants 
X11 can set WINEDRIVERLOADORDER and switch to that without editing the 
registry.

Is that an acceptable approach?

Of course, Ken may abhor the idea of having the Mac Driver the default 
in winehq at this point, anyway. ;)



More information about the wine-devel mailing list