Always emit Client::captionChanged when the caption changed

Summary:
With ddf3536f19 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
This commit is contained in:
Martin Gräßlin 2017-08-13 16:54:04 +02:00
parent f9e0e8a980
commit f50fbde1a9
2 changed files with 3 additions and 2 deletions

View file

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

View file

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