Fix crash when unminizing a ShellClient

On unminize we should not call windowHidden, but windowShown.

Reviewed-By: bshah
This commit is contained in:
Martin Gräßlin 2016-08-18 10:30:27 +02:00
parent 9581f23ed8
commit a4af242081
2 changed files with 12 additions and 1 deletions

View file

@ -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)

View file

@ -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);
}
}
}