]> Dogcows Code - chaz/openbox/blobdiff - openbox/dock.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / dock.c
index 291cd1d0a27c7ff224cae1acd9e66b425623880e..f36fca8249e10199d4dc41d6a24f85f5f460ff57 100644 (file)
@@ -85,8 +85,7 @@ void dock_startup(gboolean reconfig)
     attrib.event_mask = DOCK_EVENT_MASK;
     attrib.override_redirect = True;
     attrib.do_not_propagate_mask = DOCK_NOPROPAGATEMASK;
-    dock->frame = XCreateWindow(obt_display,
-                                RootWindow(obt_display, ob_screen),
+    dock->frame = XCreateWindow(obt_display, obt_root(ob_screen),
                                 0, 0, 1, 1, 0,
                                 RrDepth(ob_rr_inst), InputOutput,
                                 RrVisual(ob_rr_inst),
@@ -202,7 +201,7 @@ void dock_remove(ObDockApp *app, gboolean reparent)
 
     if (reparent)
         XReparentWindow(obt_display, app->icon_win,
-                        RootWindow(obt_display, ob_screen), app->x, app->y);
+                        obt_root(ob_screen), app->x, app->y);
 
     dock->dock_apps = g_list_remove(dock->dock_apps, app);
     dock_configure();
@@ -244,8 +243,10 @@ void dock_configure(void)
         }
     }
 
-    dock->area.width += l + r;
-    dock->area.height += t + b;
+    if (dock->dock_apps) {
+        dock->area.width += l + r;
+        dock->area.height += t + b;
+    }
 
     hspot = l;
     vspot = t;
@@ -422,11 +423,12 @@ void dock_configure(void)
     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 || config_dock_nostrut)
-    {
+    }
+    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 {
+    }
+    else {
         switch (config_dock_pos) {
         case OB_DIRECTION_NORTHWEST:
             switch (config_dock_orient) {
@@ -524,9 +526,12 @@ void dock_configure(void)
     } else
         XUnmapWindow(obt_display, dock->frame);
 
-    /* but they are useful outside of this function! */
-    dock->area.width += ob_rr_theme->obwidth * 2;
-    dock->area.height += ob_rr_theme->obwidth * 2;
+    /* but they are useful outside of this function! but don't add it if the
+       dock is actually not visible */
+    if (dock->dock_apps) {
+        dock->area.width += ob_rr_theme->obwidth * 2;
+        dock->area.height += ob_rr_theme->obwidth * 2;
+    }
 
     screen_update_areas();
 
@@ -652,7 +657,6 @@ void dock_get_area(Rect *a)
 
 ObDockApp* dock_find_dockapp(Window xwin)
 {
-    g_assert(xwin != None);
     GList *it;
     /* there are never that many dock apps, so we can use a list here instead
        of a hash table */
This page took 0.022052 seconds and 4 git commands to generate.