add showDelay to dock
Mikael Magnusson mikachu@comhem.se
5 files changed,
33 insertions(+),
8 deletions(-)
M
data/rc.xsd
→
data/rc.xsd
@@ -35,6 +35,8 @@ Thu Nov 4 12:07:08 UTC 2004 - mikachu(a)openbox.org
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/"@@ -133,6 +135,7 @@ <xs:element name="floatingX" type="xs:integer"/>
<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>
M
openbox/config.c
→
openbox/config.c
@@ -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 @@ if ((n = parse_find_node("autoHide", 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 @@ config_dock_y = 0;
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;
M
openbox/config.h
→
openbox/config.h
@@ -74,6 +74,8 @@ /*! Whether to auto-hide the dock when the pointer is not over it */
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 */
M
openbox/dock.c
→
openbox/dock.c
@@ -597,17 +597,30 @@
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); + } } }