From 5795fc8cc04a422194e06d20fb395cbbf3ea2ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sun, 4 Feb 2018 14:19:23 +0100 Subject: [PATCH] Init the icon in ShellClient::init Summary: If the window never provides the appId, we would not get an icon for the window. This happens for example for KWin's internal windows which don't set the app id as KWin also doesn't have a desktop file. With this change the DebugConsole has a window icon in the decoration. Test Plan: Extended tests and manual verification of DebugConsole Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #plasma Differential Revision: https://phabricator.kde.org/D10294 --- autotests/integration/internal_window.cpp | 1 + autotests/integration/shell_client_test.cpp | 1 + shell_client.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index f67da3faaa..9a2407c8ba 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -211,6 +211,7 @@ void InternalWindowTest::testEnterLeave() QVERIFY(!workspace()->activeClient()); ShellClient *c = clientAddedSpy.first().first().value(); QVERIFY(c->isInternal()); + QCOMPARE(c->icon().name(), QStringLiteral("wayland")); QCOMPARE(workspace()->findToplevel(&win), c); QCOMPARE(c->geometry(), QRect(0, 0, 100, 100)); QVERIFY(c->isShown(false)); diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp index adfe9bb532..46d0f80089 100644 --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -160,6 +160,7 @@ void TestShellClient::testMapUnmapMap() QCOMPARE(client->readyForPainting(), true); QCOMPARE(client->depth(), 32); QVERIFY(client->hasAlpha()); + QCOMPARE(client->icon().name(), QStringLiteral("wayland")); QCOMPARE(workspace()->activeClient(), client); QVERIFY(effectsWindowShownSpy.isEmpty()); QVERIFY(client->isMaximizable()); diff --git a/shell_client.cpp b/shell_client.cpp index 6df6814bb9..38099594e0 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -197,6 +197,7 @@ void ShellClient::init() findInternalWindow(); createWindowId(); setupCompositing(); + updateIcon(); SurfaceInterface *s = surface(); Q_ASSERT(s); if (s->buffer()) {