Bug 412353

Summary: Support for _NET_WM_BYPASS_COMPOSITOR broken
Product: [Plasma] kwin Reporter: hexchain <kde>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: jchevarley
Priority: VHI Keywords: regression
Version First Reported In: 5.16.90Flags: vlad.zahorodnii: ReviewRequest+
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://phabricator.kde.org/D24244
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description hexchain 2019-09-26 12:22:58 UTC
SUMMARY
KWin does not disable compositor even if there are windows with _NET_WM_BYPASS_COMPOSITOR set.


STEPS TO REPRODUCE
execute "xprop -f _NET_WM_BYPASS_COMPOSITOR 32c -set _NET_WM_BYPASS_COMPOSITOR 1" on an existing window, or use "mpv --x11-bypass-compositor=yes"

OBSERVED RESULT
KWin still has compositing enabled.

EXPECTED RESULT
KWin should disable compositing.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.16.90
KDE Frameworks Version: 5.62.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Every time when trying to set _NET_WM_BYPASS_COMPOSITOR to 1 for a window, the following log appears:

kwin_x11[<PID>]: QMetaMethod::invoke: Unable to handle unregistered datatype 'SuspendReason'
Comment 1 David Edmundson 2019-09-26 15:09:33 UTC
Git commit 3ba33e4b581f7d95effc481d47e553c392404e11 by David Edmundson.
Committed on 26/09/2019 at 15:09.
Pushed by davidedmundson into branch 'Plasma/5.17'.

Use lambdas for queued invocation of composition suspending

Summary:
Qt's metaobject is rather sensitive with scope resolution.

Foo::Bar and Bar don't always match to a Qt metaobject, even if they
refer to the same thing to a compiler. Here we register
X11Compositor::SuspendReason but Q_ARG uses SuspendReason and they don't
match. This leads to a runtime failure where the method isn't invoked.

Rather than fixing metaobject usage, port the whole thing to lambdas
which does better compile time checking and is generally nicer to read.

Test Plan:
Ran xprop to block compositing. Compositing was blocked.
Grepped source code for Q_ARG use

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24244

M  +9    -8    composite.cpp
M  +4    -2    composite.h
M  +4    -2    plugins/scenes/opengl/scene_opengl.cpp

https://commits.kde.org/kwin/3ba33e4b581f7d95effc481d47e553c392404e11
Comment 2 Vlad Zahorodnii 2019-09-28 20:38:31 UTC
*** Bug 412428 has been marked as a duplicate of this bug. ***