]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
oops buttons not keycodes
[chaz/openbox] / openbox / dock.c
index da9bdd2a0dc4758c74d9806c9a6ec61ec7cce754..c2190ee239cf0383c3584339cc4db99fc62830a5 100644 (file)
@@ -1,3 +1,4 @@
+#include "debug.h"
 #include "dock.h"
 #include "screen.h"
 #include "prop.h"
@@ -27,7 +28,8 @@ void dock_startup()
 
     attrib.event_mask = DOCK_EVENT_MASK;
     attrib.override_redirect = True;
-    dock->frame = XCreateWindow(ob_display, ob_root, 0, 0, 1, 1, 0,
+    dock->frame = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),
+                                0, 0, 1, 1, 0,
                                 RrDepth(ob_rr_inst), InputOutput,
                                 RrVisual(ob_rr_inst),
                                 CWOverrideRedirect | CWEventMask,
@@ -92,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) {
@@ -114,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()
@@ -134,12 +136,13 @@ void dock_remove(ObDockApp *app, gboolean reparent)
     g_hash_table_remove(window_map, &app->icon_win);
 
     if (reparent)
-       XReparentWindow(ob_display, app->icon_win, ob_root, app->x, app->y);
+       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_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);
@@ -454,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:
@@ -466,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;
 
@@ -518,7 +523,7 @@ void dock_hide(gboolean hide)
     } else {
         g_assert(!dock->hide_timer);
         dock->hide_timer = timer_start(config_dock_hide_timeout * 1000,
-                                       (TimeoutHandler)hide_timeout,
+                                       (ObTimeoutHandler)hide_timeout,
                                        NULL);
     }
 }
This page took 0.02377 seconds and 4 git commands to generate.