From 842b2ce51b6b9471f45f94e00a942c52648e9b60 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 24 Jun 2019 22:59:21 +0200 Subject: [PATCH] [placement] Avoid smart placement strategy with invalid client sizes Summary: To do so can in some situations lock up as the loop goes through different positions incrementing by client->width/height. If this is zero we can get into a stuck state. This became a more common issue due to my earlier patch that places windows in ShellClient::finishInit to allow the maximize placement strategy to set the first configure size. BUG: 408754 Reviewers: #kwin, broulik Reviewed By: broulik Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D21997 --- placement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/placement.cpp b/placement.cpp index 9ec42b959c..4decbaa614 100644 --- a/placement.cpp +++ b/placement.cpp @@ -205,6 +205,10 @@ void Placement::placeSmart(AbstractClient* c, const QRect& area, Policy /*next*/ * with ideas from xfce. */ + if (!c->size().isValid()) { + return; + } + const int none = 0, h_wrong = -1, w_wrong = -2; // overlap types long int overlap, min_overlap = 0; int x_optimal, y_optimal;