From 17c41e5bacb70bbe2910ec3bd967343236a437db Mon Sep 17 00:00:00 2001
From: fluxgen <fluxgen>
Date: Mon, 16 Feb 2004 10:26:03 +0000
Subject: added hidden state to remember, patch from akira

---
 src/IconbarTool.cc |  4 ++--
 src/Remember.cc    | 29 +++++++++++++++++++++++------
 src/Remember.hh    | 22 +++++++++++++++-------
 3 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index 72e6ce1..d1292c4 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -20,7 +20,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: IconbarTool.cc,v 1.32 2004/01/21 14:13:57 fluxgen Exp $
+// $Id: IconbarTool.cc,v 1.33 2004/02/16 10:26:03 fluxgen Exp $
 
 #include "IconbarTool.hh"
 
@@ -682,7 +682,7 @@ void IconbarTool::removeWindow(FluxboxWindow &win) {
 
 void IconbarTool::addWindow(FluxboxWindow &win) {
     // we just want windows that has clients
-    if (win.clientList().empty())
+    if (win.clientList().empty() || win.isHidden() )
         return;
 
     IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win);
diff --git a/src/Remember.cc b/src/Remember.cc
index fef995b..5f1787f 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -21,7 +21,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Remember.cc,v 1.33 2003/12/19 00:48:41 fluxgen Exp $
+// $Id: Remember.cc,v 1.34 2004/02/16 10:25:33 fluxgen Exp $
 
 #include "Remember.hh"
 #include "ClientPattern.hh"
@@ -208,15 +208,16 @@ Application::Application(bool grouped)
     : is_grouped(grouped),
       group(0)
 {
-    workspace_remember =
+	decostate_remember     = 
 	dimensions_remember =
+	hiddenstate_remember   = 
+	jumpworkspace_remember = 
+	layer_remember         = 
 	position_remember =
-	stuckstate_remember =
-	decostate_remember =
 	shadedstate_remember =
+	stuckstate_remember    = 
 	tabstate_remember =
-	jumpworkspace_remember =
-        layer_remember =
+	workspace_remember     = 
 	save_on_close_remember = false;
 }
 
@@ -363,6 +364,8 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) {
                 app.rememberShadedstate((str_label=="yes"));
             } else if (str_key == "Tab") {
                 app.rememberTabstate((str_label=="yes"));
+            } else if (str_key == "Hidden") {
+                app.rememberHiddenstate((str_label=="yes")); 
             } else if (str_key == "Deco") {
                 if (str_label == "NONE") {
                     app.rememberDecostate((unsigned int) 0);
@@ -545,6 +548,9 @@ void Remember::save() {
         if (a.tabstate_remember) {
             apps_file << "  [Tab]\t\t{" << ((a.tabstate)?"yes":"no") << "}" << endl;
         }
+        if (a.hiddenstate_remember) {
+            apps_file << "  [Hidden]\t\t{" << ((a.tabstate)?"yes":"no") << "}" << endl;
+        }
         if (a.decostate_remember) {
             switch (a.decostate) {
             case (0) :
@@ -601,6 +607,9 @@ bool Remember::isRemembered(WinClient &winclient, Attribute attrib) {
     case REM_POSITION:
         return app->position_remember;
         break;
+    case REM_HIDDENSTATE:
+        return app->hiddenstate_remember;
+        break;
     case REM_STUCKSTATE:
         return app->stuckstate_remember;
         break;
@@ -646,6 +655,9 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) {
     case REM_POSITION:
         app->rememberPosition(win->x(), win->y());
         break;
+    case REM_HIDDENSTATE:
+        app->rememberHiddenstate(win->isHidden());
+        break;
     case REM_SHADEDSTATE:
         app->rememberShadedstate(win->isShaded());
         break;
@@ -691,6 +703,9 @@ void Remember::forgetAttrib(WinClient &winclient, Attribute attrib) {
     case REM_POSITION:
         app->forgetPosition();
         break;
+    case REM_HIDDENSTATE:
+        app->forgetHiddenstate();
+        break;
     case REM_STUCKSTATE:
         app->forgetStuckstate();
         break;
@@ -794,6 +809,8 @@ void Remember::setupFrame(FluxboxWindow &win) {
         if (win.isStuck() && !app->stuckstate ||
             !win.isStuck() && app->stuckstate)
             win.stick(); // toggles
+    if (app->hiddenstate_remember)
+        win.setHidden(true);
 
     if (app->layer_remember)
         win.moveToLayer(app->layer);
diff --git a/src/Remember.hh b/src/Remember.hh
index 50c15df..2e92e42 100644
--- a/src/Remember.hh
+++ b/src/Remember.hh
@@ -21,7 +21,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
-// $Id: Remember.hh,v 1.14 2004/01/19 18:26:25 fluxgen Exp $
+// $Id: Remember.hh,v 1.15 2004/02/16 10:25:34 fluxgen Exp $
 
 /* Based on the original "Remember patch" by Xavier Brouckaert */
 
@@ -50,6 +50,7 @@ public:
     inline void forgetShadedstate() { shadedstate_remember = false; }
     inline void forgetTabstate() { tabstate_remember = false; }
     inline void forgetDecostate() { decostate_remember = false; }
+    inline void forgetHiddenstate() { hiddenstate_remember= false; }
     inline void forgetStuckstate() { stuckstate_remember = false; }
     inline void forgetJumpworkspace() { jumpworkspace_remember = false; }
     inline void forgetLayer() { layer_remember = false; }
@@ -59,6 +60,9 @@ public:
         { workspace = ws; workspace_remember = true; }
     inline void rememberDimensions(int width, int height) 
         { w = width; h = height; dimensions_remember = true; }
+
+    inline void rememberHiddenstate(bool state)
+        { hiddenstate= state; hiddenstate_remember= true; }
     inline void rememberPosition(int posx, int posy, unsigned char rfc= 0 )
         { x = posx; y = posy; refc = rfc; position_remember = true; }
     inline void rememberShadedstate(bool state)
@@ -102,6 +106,9 @@ public:
     bool stuckstate_remember;
     bool stuckstate;
 
+    bool hiddenstate_remember;
+    bool hiddenstate;
+
     bool jumpworkspace_remember;
     bool jumpworkspace;
 
@@ -129,16 +136,17 @@ public:
      * holds which attributes to remember
      */
     enum Attribute {
-        REM_WORKSPACE=0,
+        REM_DECOSTATE= 0,
         REM_DIMENSIONS,
+        REM_HIDDENSTATE,
+        REM_JUMPWORKSPACE,
+        REM_LAYER,
         REM_POSITION,
-        REM_STUCKSTATE,
-        REM_DECOSTATE,
+        REM_SAVEONCLOSE,
         REM_SHADEDSTATE,
+        REM_STUCKSTATE,
         //REM_TABSTATE, ... external tabs disabled atm
-        REM_LAYER,
-        REM_JUMPWORKSPACE,
-        REM_SAVEONCLOSE,
+        REM_WORKSPACE,
         REM_LASTATTRIB // not actually used
     };
 
-- 
cgit v0.11.2