]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
update copyright step 2
[chaz/openbox] / openbox / dock.c
index b770890058ab626f75da3ee887309733a54d5cd2..7b92ff5892f2cb12734727b35c0bcb72d930f066 100644 (file)
@@ -1,6 +1,7 @@
 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
 
    dock.c for the Openbox window manager
+   Copyright (c) 2006        Mikael Magnusson
    Copyright (c) 2003        Ben Jansens
 
    This program is free software; you can redistribute it and/or modify
@@ -60,7 +61,7 @@ void dock_startup(gboolean reconfig)
         XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
 
         RrAppearanceFree(dock->a_frame);
-        dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_unfocused_title);
+        dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
 
         stacking_add(DOCK_AS_WINDOW(dock));
 
@@ -88,7 +89,7 @@ void dock_startup(gboolean reconfig)
                                 RrVisual(ob_rr_inst),
                                 CWOverrideRedirect | CWEventMask,
                                 &attrib);
-    dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_unfocused_title);
+    dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
     XSetWindowBorder(ob_display, dock->frame,
                      RrColorPixel(ob_rr_theme->b_color));
     XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
@@ -129,7 +130,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 +159,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 +198,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);
@@ -224,7 +225,7 @@ void dock_configure()
     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:
@@ -241,7 +242,7 @@ void dock_configure()
     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:
@@ -410,7 +411,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 {
@@ -550,7 +551,7 @@ void dock_app_drag(ObDockApp *app, XMotionEvent *e)
 
     /* 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:
@@ -597,17 +598,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);
+        }
     }
 }
This page took 0.026432 seconds and 4 git commands to generate.