Bug 385956

Summary: Support idle-inhibit-unstable-v1 protocol
Product: [Plasma] kwin Reporter: Patrick Silva <bugseforuns>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: nate
Priority: NOR Flags: mgraesslin: Wayland+
mgraesslin: X11-
mgraesslin: ReviewRequest+
Version First Reported In: git master   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://phabricator.kde.org/D8856
Latest Commit: Version Fixed/Implemented In: 5.12
Sentry Crash Report:

Description Patrick Silva 2017-10-19 16:41:42 UTC
My monitor turns off when I play videos using mpv on Arch under plasma 5.11.1 Wayland session. I just reported this problem to mpv devs, they said that kwin should support idle-inhibit-unstable-v1 protocol.

https://github.com/mpv-player/mpv/issues/5015#event-1301439138
Comment 1 Martin Flöser 2017-10-21 11:12:03 UTC
KWayland side: https://phabricator.kde.org/D8396

KWin side will follow once it's merged. I didn't expect any application to use this interface. I personally consider it a step backwards from the DBus based inhibitions we have and which are much more fine grained.
Comment 2 Martin Flöser 2017-11-16 19:23:19 UTC
Git commit 9520c2f292d0ac7bae98e96b9e067dfa25cb828f by Martin Flöser.
Committed on 16/11/2017 at 19:22.
Pushed by graesslin into branch 'master'.

Add support for zwp_idle_inhibit_manager_v1

Summary:
This protocol allows to indicate that a wl_surface should inhibit idle
actions such as DPMS, screen locking if the surface is visible.

The protocol is quite simple: it just creates an IdleInhibitor for a
Surface. If such an IdleInhibitor exists the Surface is considered to
inhibit idle.

On the server side it is also exposed like that through the API. The
IdleInhibitorInterface is private to the library and only
SurfaceInterface is extended to expose whether it currently inhibits
idle.

Test Plan: New test case added

Reviewers: #frameworks, #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland, #frameworks

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

M  +31   -0    autotests/client/test_wayland_registry.cpp
M  +63   -0    autotests/client/test_wayland_surface.cpp
M  +6    -0    src/client/CMakeLists.txt
A  +176  -0    src/client/idleinhibit.cpp     [License: BSD]
A  +217  -0    src/client/idleinhibit.h     [License: BSD]
A  +83   -0    src/client/protocols/idle-inhibit-unstable-v1.xml
M  +20   -0    src/client/registry.cpp
M  +44   -1    src/client/registry.h
M  +8    -0    src/server/CMakeLists.txt
M  +13   -0    src/server/display.cpp
M  +11   -0    src/server/display.h
A  +53   -0    src/server/idleinhibit_interface.cpp     [License: BSD]
A  +77   -0    src/server/idleinhibit_interface.h     [License: BSD]
A  +96   -0    src/server/idleinhibit_interface_p.h     [License: BSD]
A  +139  -0    src/server/idleinhibit_interface_v1.cpp     [License: BSD]
M  +23   -0    src/server/surface_interface.cpp
M  +16   -0    src/server/surface_interface.h
M  +4    -0    src/server/surface_interface_p.h
M  +2    -0    src/tools/mapping.txt

https://commits.kde.org/kwayland/9520c2f292d0ac7bae98e96b9e067dfa25cb828f
Comment 3 Martin Flöser 2017-11-16 19:24:56 UTC
Moving back to KWin for further implementation
Comment 4 Martin Flöser 2017-11-16 20:51:35 UTC
And implementation for KWin in: https://phabricator.kde.org/D8856
Comment 5 Martin Flöser 2017-11-30 20:52:01 UTC
Git commit ff2e8834694a478519f342ecc02bb2e307e87769 by Martin Flöser.
Committed on 30/11/2017 at 20:51.
Pushed by graesslin into branch 'master'.

Add support for new IdleInhibition protocol

Summary:
A small helper class is added which manages inhibiting idle for the
ShellClients. So far only very basic functionality is added. That is
only the inhibition on the Surface is followed. It is not yet checked
whether the ShellClient is visible at all. That needs some changes in
ShellClient.
FIXED-IN: 5.12

Test Plan: New test case passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

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

M  +2    -1    CMakeLists.txt
M  +1    -0    autotests/integration/CMakeLists.txt
A  +129  -0    autotests/integration/idle_inhibition_test.cpp     [License: GPL (v2)]
M  +4    -1    autotests/integration/kwin_wayland_test.h
M  +16   -0    autotests/integration/test_helpers.cpp
A  +80   -0    idle_inhibition.cpp     [License: GPL (v2)]
A  +64   -0    idle_inhibition.h     [License: GPL (v2)]
M  +7    -1    wayland_server.cpp

https://commits.kde.org/kwin/ff2e8834694a478519f342ecc02bb2e307e87769