X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fdock.c;h=cf8c006b7a7393af9afc339bd69c644480d64a4d;hb=ff04e2c9a98325e4ae13958ef63b455df303abc9;hp=592446a2ff22e193966dfb23bb3eecca0ff018e7;hpb=174de91c343dfbdfe866e566393bf4790ae22596;p=chaz%2Fopenbox diff --git a/openbox/dock.c b/openbox/dock.c index 592446a2..cf8c006b 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -129,7 +129,7 @@ void dock_add(Window win, XWMHints *wmhints) if (PROP_GETSS(app->win, wm_class, locale, &data)) { if (data[0]) { - app->name = g_strdup(data[0]); + app->name = g_strdup(data[0]); if (data[1]) app->class = g_strdup(data[1]); } @@ -158,7 +158,7 @@ void dock_add(Window win, XWMHints *wmhints) handled and need to be ignored. */ if (ob_state() == OB_STATE_STARTING) - app->ignore_unmaps += 2; + app->ignore_unmaps += 2; if (app->win != app->icon_win) { /* have to map it so that it can be re-managed on a restart */ @@ -197,7 +197,7 @@ void dock_remove(ObDockApp *app, gboolean reparent) g_hash_table_remove(window_map, &app->icon_win); if (reparent) - XReparentWindow(ob_display, app->icon_win, + XReparentWindow(ob_display, app->icon_win, RootWindow(ob_display, ob_screen), app->x, app->y); dock->dock_apps = g_list_remove(dock->dock_apps, app); @@ -410,7 +410,7 @@ void dock_configure() if (!dock->dock_apps) { STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } else if (config_dock_floating) { + } else if (config_dock_floating || config_dock_nostrut) { STRUT_PARTIAL_SET(dock_strut, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } else { @@ -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); + } } }