diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-06-08 17:50:23 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-06-14 12:19:01 -0400 |
| commit | fd77a0a7b3f892925f203287b8b46c6ec9be94ea (patch) | |
| tree | a3e61c8c17969a41279ba21592be7543a262fcd5 /openbox/dock.c | |
| parent | 2e94af28e4c12166cb74233526bb79f50877903c (diff) | |
Use GMainLoop instead of ObtMainLoop
Diffstat (limited to 'openbox/dock.c')
| -rw-r--r-- | openbox/dock.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/openbox/dock.c b/openbox/dock.c index 3a58344e..fa088c6b 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -33,6 +33,8 @@ ButtonMotionMask) static ObDock *dock; +static guint show_timeout_id; +static guint hide_timeout_id; StrutPartial dock_strut; @@ -628,15 +630,19 @@ static gboolean hide_timeout(gpointer data) dock->hidden = TRUE; dock_configure(); + hide_timeout_id = 0; + return FALSE; /* don't repeat */ } static gboolean show_timeout(gpointer data) { - /* hide */ + /* show */ dock->hidden = FALSE; dock_configure(); + show_timeout_id = 0; + return FALSE; /* don't repeat */ } @@ -644,21 +650,21 @@ void dock_hide(gboolean hide) { if (!hide) { if (dock->hidden && config_dock_hide) { - obt_main_loop_timeout_add(ob_main_loop, - config_dock_show_delay * 1000, - show_timeout, NULL, - g_direct_equal, NULL); - } else if (!dock->hidden && config_dock_hide) { - obt_main_loop_timeout_remove(ob_main_loop, hide_timeout); + show_timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT, + config_dock_show_delay, + show_timeout, NULL, NULL); + } else if (!dock->hidden && config_dock_hide && hide_timeout_id) { + if (hide_timeout_id) g_source_remove(hide_timeout_id); + hide_timeout_id = 0; } } else { if (!dock->hidden && config_dock_hide) { - obt_main_loop_timeout_add(ob_main_loop, - config_dock_hide_delay * 1000, - hide_timeout, NULL, - g_direct_equal, NULL); - } else if (dock->hidden && config_dock_hide) { - obt_main_loop_timeout_remove(ob_main_loop, show_timeout); + hide_timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT, + config_dock_show_delay, + hide_timeout, NULL, NULL); + } else if (dock->hidden && config_dock_hide && show_timeout_id) { + if (show_timeout_id) g_source_remove(show_timeout_id); + show_timeout_id = 0; } } } |
