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]);
}
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 */
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);
dock->w = dock->h = 0;
/* get the size */
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
ObDockApp *app = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
spot = (config_dock_orient == OB_ORIENTATION_HORZ ? minw : minh) / 2;
/* position the apps */
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
ObDockApp *app = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
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 {
/* which dock app are we on top of? */
stop = FALSE;
- for (it = dock->dock_apps; it; it = it->next) {
+ for (it = dock->dock_apps; it; it = g_list_next(it)) {
over = it->data;
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
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);
+ }
}
}