From f6fcf362314ef7385bba48cf911ab967f5086667 Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Sun, 15 Jun 2003 18:35:32 +0000
Subject: instance and class name in WinClient instead

---
 src/Window.cc | 44 +++++++++++++-------------------------------
 src/Window.hh | 10 +++-------
 2 files changed, 16 insertions(+), 38 deletions(-)

diff --git a/src/Window.cc b/src/Window.cc
index 85cadef..0e4e8b0 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Window.cc,v 1.191 2003/06/13 20:49:05 fluxgen Exp $
+// $Id: Window.cc,v 1.192 2003/06/15 18:35:32 fluxgen Exp $
 
 #include "Window.hh"
 
@@ -2055,40 +2055,22 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
 	break;
 
     case NormalState: {
-        // if the window was destroyed while autogrouping
+        // if this window was destroyed while autogrouping
         bool destroyed = false;
-
+       
         // check WM_CLASS only when we changed state to NormalState from 
-        // WithdrawnState (ICCC 4.1.2.5)				
-        XClassHint ch;
-        if (XGetClassHint(display, client->window(), &ch) == 0) {
-            cerr<<"Failed to read class hint!"<<endl;
-        } else {
-            if (ch.res_name != 0) {
-                m_instance_name = const_cast<char *>(ch.res_name);
-                XFree(ch.res_name);
-            } else
-                m_instance_name = "";
-
-            if (ch.res_class != 0) {
-                m_class_name = const_cast<char *>(ch.res_class);
-                XFree(ch.res_class);
-            } else 
-                m_class_name = "";
-
-            
-            Workspace *wsp = screen().getWorkspace(m_workspace_number);
-            // we must be resizable AND maximizable to be autogrouped
-            //!! TODO: there should be an isGroupable() function
-            if (wsp != 0 && isResizable() && isMaximizable()) {
-                destroyed = wsp->checkGrouping(*this);
-            }
-            
-        }
-	// if we wasn't grouped with another window we deiconify ourself
-	if (!destroyed)
+        // WithdrawnState (ICCC 4.1.2.5)
+        client->updateWMClassHint();
+
+        Workspace *wsp = screen().getWorkspace(m_workspace_number);
+        if (wsp != 0 && isGroupable())
+            destroyed = wsp->checkGrouping(*this);
+                
+	// if we wasn't grouped with another window we deiconify ourself	
+        if (!destroyed)
             deiconify(false);
 
+
     } break;
     case InactiveState:
     case ZoomState:
diff --git a/src/Window.hh b/src/Window.hh
index 7a150e8..b5b86fa 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Window.hh,v 1.77 2003/06/12 14:34:28 fluxgen Exp $
+// $Id: Window.hh,v 1.78 2003/06/15 18:34:48 fluxgen Exp $
 
 #ifndef	 WINDOW_HH
 #define	 WINDOW_HH
@@ -304,8 +304,7 @@ public:
     unsigned int width() const;
     unsigned int height() const;
     unsigned int titlebarHeight() const;
-    const std::string &className() const { return m_class_name; }
-    const std::string &instanceName() const { return m_instance_name; }
+
     bool isLowerTab() const;
     int initialState() const;
 
@@ -350,7 +349,7 @@ private:
     void shape();
 
     void grabButtons();
-	
+
     void startMoving(Window win);
     void stopMoving();
     void startResizing(Window win, int x, int y, bool left); 
@@ -389,9 +388,6 @@ private:
     // state and hint signals
     WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig;
 
-    std::string m_instance_name; /// instance name from WM_CLASS
-    std::string m_class_name; /// class name from WM_CLASS
-	
     // Window states
     bool moving, resizing, shaded, maximized, iconic,
         focused, stuck, send_focus_message, m_managed;
-- 
cgit v0.11.2