From a24fc0b2a0e41eea417cd29ee6ed0a893663e9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Fri, 5 Nov 2004 17:05:40 +0000 Subject: [PATCH] Ok, one more subtle fix: If the WM_CLASS components differ, use complete WM_CLASS. This allows e.g. having extra settings for one specific Konsole, all that's needed is to launch it as "konsole -name konsole_special", and make KWin's window-specific settings match for complete window class "konsole_special konsole". Generic Konsole settings will apply to all Konsole's, while these specific ones will apply only to instances using -name. The nice advantage is this shouldn't have all those weird issues kstart has (die, kstart, die!). svn path=/trunk/kdebase/kwin/; revision=360769 --- kcmkwin/kwinrules/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kcmkwin/kwinrules/main.cpp b/kcmkwin/kwinrules/main.cpp index 561bf53abc..c124997f97 100644 --- a/kcmkwin/kwinrules/main.cpp +++ b/kcmkwin/kwinrules/main.cpp @@ -150,11 +150,21 @@ static Rules* findRule( const QValueList< Rules* >& rules, Window wid ) if( !role.isEmpty() && role != "unknown" && role != "unnamed" ) // Qt sets this if not specified { - ret->wmclasscomplete = false; - ret->wmclass = wmclass_class; - ret->wmclassmatch = Rules::ExactMatch; ret->windowrole = role; ret->windowrolematch = Rules::ExactMatch; + if( wmclass_name == wmclass_class ) + { + ret->wmclasscomplete = false; + ret->wmclass = wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + else + { + // WM_CLASS components differ - perhaps the app got -name argument + ret->wmclasscomplete = true; + ret->wmclass = wmclass_name + ' ' + wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } } else // no role set {