Stop SDL2 Telling Linux To Disable Desktop Compositor?

Hi,

When I run my SDL2 game on Linux Mint 18.2 KDE 64Bit the desktop compositor is disabled.
I don’t really have a problem with that, but if I minimize my SDL2 game it disappears?
(by “disappear” I mean it’s gone from screen and taskbar but is still running)

I am using SDL v2.0.4 which is what is available in Synaptic Package Manager.
How can I tell SDL2 NOT to tell KDE Linux to disable the desktop compositor?
Thanks!

JeZxLee

If you have a Nvidia card, there is a bug where the panel freezes when composition is disabled. That why the taskbar don’t show your game ( https://bugs.kde.org/show_bug.cgi?id=353983 ).

You can disallow application to block composition by either creating a window rule for you application in system settings > window management > window rules, or by disabling “allow applications to block compositing” in system settings > display and monitor > compositor.

Hi,

Thanks for the reply…
I do have an nVidia graphics card.
So this is a bug in current KDE.
How can I tell SDL2 to stop disabling the desktop compositor?
Thanks!

JeZxLee

SDL always ask window manager to disable composition. You can only disallow application to block composition in system settings as i said in my previous reply.

Hi,

I just want to point out a solution for anyone who comes across this thread through a search. I hope replying this 3-year-old thread is not too annoying.

According to Sdl2Application disables compositing on startup · Issue #184 · mosra/magnum · GitHub , using the following code before creating the window will tell SDL2 to not disable the compositor:

SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
2 Likes

Yes, and this is absolutely crucial to do if you’re building a desktop application instead of a video game, and want it to be a good citizen of the desktop.

(but if you’re building a video game, this will lower your framerate.)

Hi,

Thanks!

Not making “Half-Life 3” here :slight_smile:

Jesse

1 Like