3D WINE games crash when KDE is using effects (solution)

Submitted by Falken on

Although some excellent older games are listed as working really well on Linux through the WINE system, there appears to be an issue when KDE desktop effects are enabled. WINE say this is Intel's fault.

The workaround is to disable these effects automatically when the game is run.This turns out to be a case of just knowing the right magic command to send a DBUS signal to KDE to turn off (and on !) desktop effects. There is hardly any documentation, but I did locate this post which allowed me to build the following pattern up, for games I wanted to turn off the effects.

  1. Find the menu entry
    Right click the KDE menu and choose 'edit applications'. It won't do that, it'll open up the menu editor though. Find the entry (probably under 'wine, programs', and note down the 'Command' it'll run.
  2. Create a wrapper that disables and re-enables the KDE effects.
    If the command is 'env WINEPREFIX="/home/falken/.wine" wine "C:\PROG~FBU\goo\GALC~22Q\foo.exe"' the file you need to create in something like ~/bin/fooLaunch.sh with this as the content. Insert the command from step 1 after 'fi':

    RESULT=`qdbus org.kde.kwin /KWin org.kde.KWin.compositingActive`

    if [ "$RESULT" = "true" ]
    qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing
    sleep 2

    # This is the command from step 1 above
    env WINEPREFIX="/home/falken/.wine" wine "C:\PROG~FBU\goo\GALC~22Q\foo.exe"

    [ "$RESET" = "true" ] && qdbus org.kde.kwin /KWin org.kde.KWin.toggleCompositing
  3. Make this file executable: chmod a+x ~/bin/fooLaunch.sh
  4. Change the menu entry to use '~/bin/fooLaunch.sh' instead of the command you put in the file.
  5. Save the menu entry
    You may have to log out and back in again.

If it doesn't work, try running ~/bin/fooLaunch.sh from a Konsole window to see what the error is.