How to fix black screen when launching games fullscreen on KDE

When I tried playing games (Dishonored, Terraria, Darkest Dungeon) in fullscreen from Steam, I got a black screen, while still hearing the music / sounds. Playing the games in windowed mode still worked.

A bunch of “solutions” I found hinted at GPU drivers being incorrect in some way, but that wasn’t the issue in my case.

Turns out it’s the KDE compositor’s issue. Once I disabled it, fullscreen games started working fine again, so that may be what’s holding you up as well!

A simple but annoying way to disable the compositor is to go to KDE settings → Display and Monitor → Compositor and tick the box that says “Enable on startup”.
This way once you reboot, your compositor will not be active, so you’ll lose transparency and cool animations, but will be able to play your games correctly. (You’ll have to change the setting back and restart again after you’re done playing the game to get back the cool animations)

Now obviously restarting just to play a game is pretty annoying, which is why this was my first solution, but it’s not one I recommend.

You can actually make a hotkey to toggle compositing!

Go to Settings → Shortcuts → KWin → Suspend Compositing. Set a hotkey to that and now, next time you launch your game in fullscreen and get the black screen issue, just press that hotkey and everything should be fixed!

Also, there are two commands that you can use in scripting to pause / resume the compositor. I barely know what a compositor even is, so don’t trust me 100% on this, but I’ve found them in a couple of places that were saying you can use them for their purpose.

Before you actually run them MAKE SURE to have that hotkey I told you about.

qdbus org.kde.KWin /Compositor suspend
qdbus org.kde.KWin /Compositor resume

Reason for needing a hotkey is that in my case, executing the first command gave me a black screen. I’m not that confident in my touch typing skills, so instead of blindly typing in the second command I had to reboot. With the mentioned hotkey, you could just press it and boom.

If pressing a hotkey every time you launch some game sounds annoying to you, you can actually create a window rule (Settings → Window Management → Window Rules) to automatically suspend the compositor while in the game’s window. I would bet on me just being stupid, but for some reason it didn’t work for me.

2 Likes

Thanks for this information.

Thankfully I’m on Gnome (joke).

Forgot to mention that the “Suspend compositing” hotkey is actually a toggle!