From a4af2420815dc64ce242a2a65ed93a270b9a4020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 18 Aug 2016 10:30:27 +0200 Subject: [PATCH] Fix crash when unminizing a ShellClient On unminize we should not call windowHidden, but windowShown. Reviewed-By: bshah --- autotests/integration/shell_client_test.cpp | 7 +++++++ shell_client.cpp | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp index 1a3d6a693a..46f74d85b0 100644 --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -263,6 +263,13 @@ void TestShellClient::testMinimizeActiveWindow() workspace()->slotWindowMinimize(); QVERIFY(!c->isActive()); QVERIFY(!workspace()->activeClient()); + QVERIFY(c->isMinimized()); + + // unminimize again + c->unminimize(); + QVERIFY(!c->isMinimized()); + QVERIFY(c->isActive()); + QCOMPARE(workspace()->activeClient(), c); } WAYLANDTEST_MAIN(TestShellClient) diff --git a/shell_client.cpp b/shell_client.cpp index 79ed8b265f..ae63f2fe34 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1230,7 +1230,11 @@ KWayland::Server::XdgShellSurfaceInterface::States ShellClient::xdgSurfaceStates void ShellClient::doMinimize() { - workspace()->clientHidden(this); + if (isMinimized()) { + workspace()->clientHidden(this); + } else { + emit windowShown(this); + } } }