add showDelay to dock
authorMikael Magnusson <mikachu@comhem.se>
Sun, 25 Sep 2005 14:45:24 +0000 (14:45 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Sun, 25 Sep 2005 14:45:24 +0000 (14:45 +0000)
CHANGELOG
data/rc.xsd
openbox/config.c
openbox/config.h
openbox/dock.c

index 9f15bbd..e984d30 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+3.3:
+  * Add a showDelay option for the dock.
+
 3.3-rc2:
   * Fixed some typos and errors in rc.xsd
   * Add the noStrut option to the dock (to allow maximizing windows over it),
index 07b2533..4241add 100644 (file)
@@ -35,6 +35,8 @@
          Add fourCorners to resize context.
      Sat Feb 12 01:57:16 UTC 2005 - mikachu(a)openbox.org
          Add the group option to raise/lower stuff.
+     Sun Sep 25 14:44:21 UTC 2005 - mikachu(a)openbox.org
+         Add showDelay for the dock
 -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://openbox.org/"
             <xs:element name="floatingY" type="xs:integer"/>
             <xs:element name="autoHide" type="ob:yesorno"/>
             <xs:element name="hideDelay" type="xs:integer"/>
+            <xs:element name="showDelay" type="xs:integer"/>
             <xs:element name="moveButton" type="ob:button"/>
             <xs:element name="noStrut" type="ob:yesorno"/>
         </xs:sequence>
index c43db93..c7a6246 100644 (file)
@@ -57,6 +57,7 @@ gint            config_dock_y;
 ObOrientation   config_dock_orient;
 gboolean        config_dock_hide;
 guint           config_dock_hide_delay;
+guint           config_dock_show_delay;
 guint           config_dock_app_move_button;
 guint           config_dock_app_move_modifiers;
 
@@ -387,6 +388,8 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
         config_dock_hide = parse_bool(doc, n);
     if ((n = parse_find_node("hideDelay", node)))
         config_dock_hide_delay = parse_int(doc, n) * 1000;
+    if ((n = parse_find_node("showDelay", node)))
+        config_dock_show_delay = parse_int(doc, n) * 1000;
     if ((n = parse_find_node("moveButton", node))) {
         gchar *str = parse_string(doc, n);
         guint b, s;
@@ -585,6 +588,7 @@ void config_startup(ObParseInst *i)
     config_dock_orient = OB_ORIENTATION_VERT;
     config_dock_hide = FALSE;
     config_dock_hide_delay = 300;
+    config_dock_show_delay = 300;
     config_dock_app_move_button = 2; /* middle */
     config_dock_app_move_modifiers = 0;
 
index 5be26ef..9b92fba 100644 (file)
@@ -74,6 +74,8 @@ extern ObOrientation config_dock_orient;
 extern gboolean config_dock_hide;
 /*! The number of microseconds to wait before hiding the dock */
 extern guint config_dock_hide_delay;
+/*! The number of microseconds to wait before showing the dock */
+extern guint config_dock_show_delay;
 /*! The mouse button to be used to move dock apps */
 extern guint config_dock_app_move_button;
 /*! The modifiers to be used with the button to move dock apps */
index ac09a91..cf8c006 100644 (file)
@@ -597,17 +597,30 @@ static gboolean hide_timeout(gpointer data)
     return FALSE; /* don't repeat */
 }
 
+static gboolean show_timeout(gpointer data)
+{
+    /* hide */
+    dock->hidden = FALSE;
+    dock_configure();
+
+    return FALSE; /* don't repeat */
+}
+
 void dock_hide(gboolean hide)
 {
     if (!hide) {
-        /* show */
-        dock->hidden = FALSE;
-        dock_configure();
-
-        /* if was hiding, stop it */
-        ob_main_loop_timeout_remove(ob_main_loop, hide_timeout);
-    } else if (!dock->hidden && config_dock_hide) {
-        ob_main_loop_timeout_add(ob_main_loop, config_dock_hide_delay,
+        if (dock->hidden && config_dock_hide) {
+            ob_main_loop_timeout_add(ob_main_loop, config_dock_show_delay,
+                                 show_timeout, NULL, NULL);
+        } else if (!dock->hidden && config_dock_hide) {
+            ob_main_loop_timeout_remove(ob_main_loop, hide_timeout);
+        }
+    } else {
+        if (!dock->hidden && config_dock_hide) {
+            ob_main_loop_timeout_add(ob_main_loop, config_dock_hide_delay,
                                  hide_timeout, NULL, NULL);
+        } else if (dock->hidden && config_dock_hide) {
+            ob_main_loop_timeout_remove(ob_main_loop, show_timeout);
+        }
     }
 }