From e1665d70b5efdb930857e6bf629e1e0e3d448806 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 25 Sep 2005 14:45:24 +0000 Subject: [PATCH] add showDelay to dock --- CHANGELOG | 3 +++ data/rc.xsd | 3 +++ openbox/config.c | 4 ++++ openbox/config.h | 2 ++ openbox/dock.c | 29 +++++++++++++++++++++-------- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9f15bbdd..e984d30c 100644 --- 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), diff --git a/data/rc.xsd b/data/rc.xsd index 07b25337..4241adda 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -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 --> + diff --git a/openbox/config.c b/openbox/config.c index c43db935..c7a6246c 100644 --- a/openbox/config.c +++ b/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 @@ 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; diff --git a/openbox/config.h b/openbox/config.h index 5be26ef4..9b92fba6 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -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 */ diff --git a/openbox/dock.c b/openbox/dock.c index ac09a913..cf8c006b 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -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); + } } } -- 2.45.2