From f50fbde1a9edae2eb9dd2947e457687dc94b41a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 13 Aug 2017 16:54:04 +0200 Subject: [PATCH] Always emit Client::captionChanged when the caption changed Summary: With ddf3536f19a4243670e5fc87f5fbaf9e44031542 a regression got introduced resulting in Client::captionChanged not being emitted if Client::setCaption was called without the force parameter. The regression is only in master branch. BUG: 383444 Test Plan: Added test case passes Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D7290 --- autotests/integration/x11_client_test.cpp | 1 - client.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autotests/integration/x11_client_test.cpp b/autotests/integration/x11_client_test.cpp index 5e9bb05ee0..bb5af38c12 100644 --- a/autotests/integration/x11_client_test.cpp +++ b/autotests/integration/x11_client_test.cpp @@ -414,7 +414,6 @@ void X11ClientTest::testCaptionChanges() QVERIFY(captionChangedSpy.isValid()); info.setName("bar"); xcb_flush(c.data()); - QEXPECT_FAIL("", "BUG 383444", Continue); QVERIFY(captionChangedSpy.wait()); QCOMPARE(client->caption(), QStringLiteral("bar")); diff --git a/client.cpp b/client.cpp index 1187b8bb83..3dd7fd87f9 100644 --- a/client.cpp +++ b/client.cpp @@ -1431,8 +1431,10 @@ void Client::setCaption(const QString& _s, bool force) if (!s[i].isPrint()) s[i] = QChar(u' '); cap_normal = s; - if (!force) + if (!force) { + emit captionChanged(); return; + } bool reset_name = force; bool was_suffix = (!cap_suffix.isEmpty());