From abda1490d862606989664355d35d391eecbe8ffa Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Mon, 19 Apr 2004 22:42:26 +0000
Subject: kde dockapp in systray

---
 src/Slit.cc | 40 ++++------------------------------------
 src/Slit.hh | 11 ++++++-----
 2 files changed, 10 insertions(+), 41 deletions(-)

diff --git a/src/Slit.cc b/src/Slit.cc
index 08378ed..2ef77c4 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Slit.cc,v 1.92 2004/02/20 09:29:06 fluxgen Exp $
+// $Id: Slit.cc,v 1.93 2004/04/19 22:42:05 fluxgen Exp $
 
 #include "Slit.hh"
 
@@ -487,39 +487,7 @@ void Slit::addClient(Window w) {
     XWindowAttributes attrib;
     
 #ifdef KDE
-
-    //Check and see if new client is a KDE dock applet
-    //If so force reasonable size
-    bool iskdedockapp = false;
-    Atom ajunk;
-    int ijunk;
-    unsigned long *data = 0, uljunk;
-
-    // Check if KDE v2.x dock applet
-    if (XGetWindowProperty(disp, w,
-                           m_kwm2_dockwindow, 0l, 1l, False,
-                           m_kwm2_dockwindow,
-                           &ajunk, &ijunk, &uljunk, &uljunk,
-                           (unsigned char **) &data) == Success && data) {
-        iskdedockapp = (data && data[0] != 0);
-        XFree((void *) data);
-        data = 0;
-    }
-
-    // Check if KDE v1.x dock applet
-    if (!iskdedockapp) {
-        if (XGetWindowProperty(disp, w,
-                               m_kwm1_dockwindow, 0l, 1l, False,
-                               m_kwm1_dockwindow,
-                               &ajunk, &ijunk, &uljunk, &uljunk,
-                               (unsigned char **) &data) == Success && data) {
-            iskdedockapp = (data && data[0] != 0);
-            XFree((void *) data);
-            data = 0;
-        }
-    }
-
-    if (iskdedockapp)
+    if (screen().isKdeDockapp(w))   
         client->resize(24, 24);
     else
 #endif // KDE
@@ -549,13 +517,13 @@ void Slit::addClient(Window w) {
     client->enableEvents();
     
     // flush events
-    XFlush(disp);
+    //    XFlush(disp);
 
     // add slit client to eventmanager
     FbTk::EventManager::instance()->add(*this, client->clientWindow());
     FbTk::EventManager::instance()->add(*this, client->iconWindow());
 
-    frame.window.show();
+    //    frame.window.show();
     clearWindow();
     reconfigure();
 
diff --git a/src/Slit.hh b/src/Slit.hh
index 4209501..70c2ae5 100644
--- a/src/Slit.hh
+++ b/src/Slit.hh
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 // DEALINGS IN THE SOFTWARE.
 	
-/// $Id: Slit.hh,v 1.38 2003/08/29 10:30:46 fluxgen Exp $
+/// $Id: Slit.hh,v 1.39 2004/04/19 22:42:26 fluxgen Exp $
 
 #ifndef	 SLIT_HH
 #define	 SLIT_HH
@@ -49,7 +49,7 @@ class Strut;
 /// Handles dock apps
 class Slit: public FbTk::EventHandler, public FbTk::Observer {
 public:
-    
+    typedef std::list<SlitClient *> SlitClients;    
     /**
        Client alignment
     */
@@ -63,6 +63,8 @@ public:
     Slit(BScreen &screen, FbTk::XLayer &layer, const char *filename = 0);
     virtual ~Slit();
 
+    void show() { frame.window.show(); }
+    void hide() { frame.window.hide(); }
     void setDirection(Direction dir);
     void setPlacement(Placement place);
     void setAutoHide(bool val);
@@ -115,7 +117,8 @@ public:
 
     inline unsigned int width() const { return frame.width; }
     inline unsigned int height() const { return frame.height; }
-    
+    const SlitClients &clients() const { return m_client_list; }
+    SlitClients &clients() { return m_client_list; }
 private:
     void clearWindow();
     void setupMenu();
@@ -131,8 +134,6 @@ private:
     BScreen &m_screen;
     FbTk::Timer m_timer;
 
-    typedef std::list<SlitClient *> SlitClients;
-
     SlitClients m_client_list;
     FbMenu m_slitmenu, m_placement_menu, m_clientlist_menu;
     std::auto_ptr<LayerMenu<Slit> > m_layermenu;
-- 
cgit v0.11.2