38 auto updateInhibit = [
this, client] {
49 auto it = m_connections.find(client);
50 if (it != m_connections.end()) {
51 disconnect(it.value());
52 m_connections.erase(it);
59void IdleInhibition::inhibit(
Window *client)
65void IdleInhibition::uninhibit(
Window *client)
70void IdleInhibition::update(
Window *client)
72 if (client->isInternal() || client->isUnmanaged()) {
78 const bool visible = client->isShown() && client->isOnCurrentDesktop();
79 if (visible && client->surface() && client->surface()->inhibitsIdle()) {
86void IdleInhibition::slotWorkspaceCreated()
92void IdleInhibition::slotDesktopChanged()
101#include "moc_idle_inhibition.cpp"
void registerClient(Window *client)
IdleInhibition(QObject *parent=nullptr)
~IdleInhibition() override
void inhibitsIdleChanged()
SurfaceInterface * surface() const
void windowShown(KWin::Window *window)
void windowHidden(KWin::Window *window)
void forEachWindow(std::function< void(Window *)> func)
void currentDesktopChanged(KWin::VirtualDesktop *previousDesktop, KWin::Window *)
void windowAdded(KWin::Window *)
InputRedirection * input()