]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
use ob_debug for any debug printing and only display the output when its a debug...
[chaz/openbox] / openbox / dock.c
index 5d110353fcd84cf3807d09c5fc5faa4937edfad9..c2190ee239cf0383c3584339cc4db99fc62830a5 100644 (file)
@@ -1,3 +1,4 @@
+#include "debug.h"
 #include "dock.h"
 #include "screen.h"
 #include "prop.h"
@@ -93,7 +94,7 @@ void dock_add(Window win, XWMHints *wmhints)
       member set the root window, and one set to the client, but both get
       handled and need to be ignored.
     */
-    if (ob_state == OB_STATE_STARTING)
+    if (ob_state() == OB_STATE_STARTING)
        app->ignore_unmaps += 2;
 
     if (app->win != app->icon_win) {
@@ -115,7 +116,7 @@ void dock_add(Window win, XWMHints *wmhints)
 
     g_hash_table_insert(window_map, &app->icon_win, app);
 
-    g_message("Managed Dock App: 0x%lx (%s)", app->icon_win, app->class);
+    ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
 }
 
 void dock_remove_all()
@@ -141,7 +142,7 @@ void dock_remove(ObDockApp *app, gboolean reparent)
     dock->dock_apps = g_list_remove(dock->dock_apps, app);
     dock_configure();
 
-    g_message("Unmanaged Dock App: 0x%lx (%s)", app->icon_win, app->class);
+    ob_debug("Unmanaged Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
 
     g_free(app->name);
     g_free(app->class);
@@ -456,7 +457,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 && !stop; it = it->next) {
+    for (it = dock->dock_apps; it; it = it->next) {
         over = it->data;
         switch (config_dock_orient) {
         case OB_ORIENTATION_HORZ:
@@ -468,6 +469,8 @@ void dock_app_drag(ObDockApp *app, XMotionEvent *e)
                 stop = TRUE;
             break;
         }
+        /* dont go to it->next! */
+        if (stop) break;
     }
     if (!it || app == over) return;
 
This page took 0.022517 seconds and 4 git commands to generate.