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 <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-19 05:10:52 +03:00
parent 9194097ab6
commit 8c8246d810

View file

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