From 8c8246d81015945bb1001cc2c205a227925340a7 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 19 May 2024 05:10:52 +0300 Subject: [PATCH] kwin: use the description as ID for rules when none is set because rules created by the configuration interface do not have an ID and one must be set for duplicates to be filtered correctly, ideally the whole rule should be checked for equality instead of the ID only (the ID should not be a thing, it is not used for other purpose really) Signed-off-by: Ivailo Monev --- kwin/rules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kwin/rules.cpp b/kwin/rules.cpp index 8b3cbe53..7ea6da51 100644 --- a/kwin/rules.cpp +++ b/kwin/rules.cpp @@ -235,7 +235,7 @@ void Rules::readFromCfg(const KConfigGroup& cfg) void Rules::write(KConfigGroup& cfg) const { - cfg.writeEntry("id", ruleid); + cfg.writeEntry("id", ruleid.isEmpty() ? QByteArray::number(qHash(description)) : ruleid); cfg.writeEntry("Description", description); // always write wmclass WRITE_MATCH_STRING(wmclass, (const char*), true);