From 8e75ace959d2a5d56d30cb6a06ce895f397c1f19 Mon Sep 17 00:00:00 2001
From: markt <markt>
Date: Sat, 30 Jun 2007 04:15:55 +0000
Subject: fixed the groups file for the last time

---
 ChangeLog        | 2 ++
 src/Screen.cc    | 4 ++++
 src/Workspace.cc | 6 ++++--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 83aeb15..0ea1318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
  (Format: Year/Month/Day)
 Changes for 1.0.0:
 *07/06/30:
+   * Fixed the groups file, even though it's deprecated (Mark)
+     Workspace.cc Screen.cc
    * Fix _NET_WM_STATE_DEMANDS_ATTENTION with tabbed windows, #1732392 (Mark)
      Ewmh.cc/hh
 *07/06/29:
diff --git a/src/Screen.cc b/src/Screen.cc
index 99e88d6..1c69eda 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1465,6 +1465,10 @@ FluxboxWindow *BScreen::createWindow(Window client) {
                 delete win;
                 return 0;
             }
+
+            Workspace *workspace = getWorkspace(win->workspaceNumber());
+            if (workspace && !Fluxbox::instance()->isStartup())
+                workspace->checkGrouping(*win);
         }
     }
 
diff --git a/src/Workspace.cc b/src/Workspace.cc
index fd81e5e..888c20a 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -326,8 +326,10 @@ bool Workspace::checkGrouping(FluxboxWindow &win) {
 #ifdef DEBUG
                     cerr<<__FILE__<<"("<<__FUNCTION__<<"): window ("<<*wit<<") attaching window ("<<&win<<")"<<endl;
 #endif // DEBUG
-                    (*wit)->attachClient(win.winClient());
-                    (*wit)->raise();
+                    WinClient &client = win.winClient();
+                    (*wit)->attachClient(client);
+                    if (client.screen().focusControl().focusNew())
+                        (*wit)->setCurrentClient(client);
                     return true; // grouping done
 
                 }
-- 
cgit v0.11.2