kwin: respect the autogroup configuration when restarting kwin

BUG: 279468
FIXED-IN: 4.8
This commit is contained in:
Philipp Knechtges 2011-12-23 22:10:56 +01:00
parent ea20b79d70
commit 27a7238f44

View file

@ -323,10 +323,11 @@ bool Client::manage(Window w, bool isMapped)
bool dontKeepInArea = false; bool dontKeepInArea = false;
if (!noBorder()) { if (!noBorder()) {
setClientGroup(NULL); setClientGroup(NULL);
bool autogrouping = rules()->checkAutogrouping(options->autogroupSimilarWindows);
// Automatically add to previous groups on session restore // Automatically add to previous groups on session restore
if (session && session->clientGroupClient && session->clientGroupClient != this && session->clientGroupClient->clientGroup()) if (session && session->clientGroupClient && session->clientGroupClient != this && session->clientGroupClient->clientGroup())
session->clientGroupClient->clientGroup()->add(this, -1, true); session->clientGroupClient->clientGroup()->add(this, -1, true);
else if (isMapped) else if (isMapped && autogrouping)
// If the window is already mapped (Restarted KWin) add any windows that already have the // If the window is already mapped (Restarted KWin) add any windows that already have the
// same geometry to the same client group. (May incorrectly handle maximized windows) // same geometry to the same client group. (May incorrectly handle maximized windows)
foreach (ClientGroup * group, workspace()->clientGroups) foreach (ClientGroup * group, workspace()->clientGroups)