From d0875aa11707dd042e14f8723e1fd141452dca80 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 16 Apr 2020 00:57:50 +0100 Subject: [PATCH] [wayland] avoid potential crash when checking for window inhibitions on desktop change Summary: Xwayland clients are sometimes offset from being visible to having a surface applied. We might also have internal windows which will be AbstractClients without a surface. No idle interface will be set up for non wayland clients, but on a desktop change we itterate through all AbstractClients and need to guard somewhere. BUG: 420039 Test Plan: None Reviewers: #kwin, apol Reviewed By: apol Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D28858 --- idle_inhibition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idle_inhibition.cpp b/idle_inhibition.cpp index fc662af64a..6862d5d586 100644 --- a/idle_inhibition.cpp +++ b/idle_inhibition.cpp @@ -101,7 +101,7 @@ void IdleInhibition::update(AbstractClient *client) // TODO: Don't honor the idle inhibitor object if the shell client is not // on the current activity (currently, activities are not supported). const bool visible = client->isShown(true) && client->isOnCurrentDesktop(); - if (visible && client->surface()->inhibitsIdle()) { + if (visible && client->surface() && client->surface()->inhibitsIdle()) { inhibit(client); } else { uninhibit(client);