KWIN doesn't seem to disable window composition when the application window sets _NET_WM_BYPASS_COMPOSITOR flag. The freedesktop WM specification http://standards.freedesktop.org/wm-spec/latest/ar01s05.html#idm139870829920368 states that _NET_WM_BYPASS_COMPOSITOR could be set by the client to request uncomposited window. There was a patch submitted by "Alexander Mezin" https://git.reviewboard.kde.org/r/110088/ which added support for the before-said window property, however it hasn't been merged yet. There are a lot of issues when running games especially Dota 2 which explicitly sets _NET_WM_BYPASS_COMPOSITOR=1, but kwin doesn't seem to respect the setting. This causes drastic drops in framerate and when I switch to another window from the game, kwin often crashes or the nvidia gpu driver starts to misbehave. More details here: https://github.com/ValveSoftware/Dota-2-Reborn/issues/204 Reproducible: Always Steps to Reproduce: 1. Enable Desktop Effects in KWIN 2. Start an SDL application or a game which sets _NET_WM_BYPASS_COMPOSITOR 3. Application would run with composition, thereby affecting performance. Actual Results: KWIN handles the composition for the application even when the application window property is set. Expected Results: KWIN should respect _NET_WM_BYPASS_COMPOSITOR and disable composition for that particular window just
@dhiru Simply suspend the compositor for the time being (SHIFT+Alt+F12) - also, because of the legacy nvidia blob, I'd bet the actual problem is in the sync fences. Please try to run KWIN_EXPLICIT_SYNC=0 kwin_x11 --replace & and test [lol, i thought: that's supposed to be a 2013 title? looks like WC3 - well, seem's it's actually a WC3 mod ;-)] *without* suspending compositing. --- Dev note: from the description in this and the linked bug report, suspending the compositor when this flag is set (ie. invoke it for composition blocking) should make most sense - also because a) driver bugs reg. unredirection (should we ignore the hint for intel IGPs or risk to raise that bug again?) b) "when I switch to another window" - we'd have to ignore the hint for non-fullscreen windows (I like this sentence: "The compositing manager MAY bypass compositing for both fullscreen and non-fullscreen windows if bypassing is requested, but MUST NOT bypass if it would cause differences from the composited appearance." - let's please never get any explicit and where would you know whether some effect or even the client alters depending on the presence of a compositor - should we ignore the hint if color correction is enabled?? *sigh*) The setter/getter should imo best go into kwindowsystem / netwininfo (like for the composition blocker hint)?
*** Bug 349917 has been marked as a duplicate of this bug. ***
I tested this on Manjaro with Kwin 5.4.3 with MPV-git and I confirm that doesn't work even with "KWIN_EXPLICIT_SYNC=0 kwin_x11 --replace &". https://github.com/mpv-player/mpv/commit/ad3f75cc94adac9781fda93cc2a7c0c23ac0a606 http://cgit.freedesktop.org/xdg/xdg-specs/tree/wm-spec/wm-spec.xml#n1579
Can the review request be merged now ? https://git.reviewboard.kde.org/r/126561/
Git commit 2a5b7943a020f2154049d28a33216149b6220d53 by Thomas Lübking. Committed on 16/02/2016 at 13:03. Pushed by luebking into branch 'master'. support _NET_WM_BYPASS_COMPOSITOR FIXED-IN: 5.20 M +1 -1 src/netwm_def.h M +1 -0 src/platforms/xcb/atoms_p.h M +26 -4 src/platforms/xcb/netwm.cpp http://commits.kde.org/kwindowsystem/2a5b7943a020f2154049d28a33216149b6220d53
Thank you !
Thanks Thomas!
Does that mean that is it no longer needed to disable compositing with Valve games?
It means that it will automatically be suspended when the game sets this property. Whether that happens: I've no idea ;-) (But you check the window with "xprop" for it)
That seem to be set with CS GO indeed. Does it still disable compositing for the window, even if you have an intel card?
Yes, this has nothing to do with unredirection - it's virtually like auto-pressing SHIFT+Alt+F12 when the window appears/closes.
(In reply to Thomas Lübking from comment #9) > It means that it will automatically be suspended when the game sets this > property. > Whether that happens: I've no idea ;-) > (But you check the window with "xprop" for it) I have had a chance to test this with few games this week. I can confirm that upon starting the game, the compositing is disabled and upon exiting the game, the composition is enabled again. This works as intended and the framerate in the games that I have tested is good. However, it would be good if the composition can be enabled back again if the window is minimized. Currently it only gets enabled if the application is completely closed. This makes switching between applications difficult when the game is running in the background.