diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-06-13 02:32:20 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-06-13 02:32:20 +0000 |
| commit | 8c05970840ed3a7c7ecc4a63f8f226791b495326 (patch) | |
| tree | 1ac6a8a4cb5503e5850d72a86550a3664dec9975 | |
| parent | 809619497d73598a9f3c2bd2e4b8968297af6bfd (diff) | |
fix how the dock is placed, its struts, and set a window type hint on it
| -rw-r--r-- | openbox/dock.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/openbox/dock.c b/openbox/dock.c index 121565ac..d8ca062d 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -94,6 +94,10 @@ void dock_startup(gboolean reconfig) RrColorPixel(ob_rr_theme->osd_border_color)); XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->obwidth); + /* Setting the window type so xcompmgr can tell what it is */ + PROP_SET32(dock->frame, net_wm_window_type, atom, + prop_atoms.net_wm_window_type_dock); + g_hash_table_insert(window_map, &dock->frame, dock); stacking_add(DOCK_AS_WINDOW(dock)); } @@ -214,13 +218,13 @@ void dock_remove(ObDockApp *app, gboolean reparent) void dock_configure() { GList *it; - gint spot; + gint hspot, vspot; gint gravity; - gint minw, minh; + gint l, r, t, b; gint strw, strh; Rect *a; - RrMinSize(dock->a_frame, &minw, &minh); + RrMargins(dock->a_frame, &l, &t, &r, &b); dock->w = dock->h = 0; @@ -239,21 +243,25 @@ void dock_configure() } } - spot = (config_dock_orient == OB_ORIENTATION_HORZ ? minw : minh) / 2; + dock->w += l + r; + dock->h += t + b; + + hspot = l; + vspot = t; /* position the apps */ for (it = dock->dock_apps; it; it = g_list_next(it)) { ObDockApp *app = it->data; switch (config_dock_orient) { case OB_ORIENTATION_HORZ: - app->x = spot; + app->x = hspot; app->y = (dock->h - app->h) / 2; - spot += app->w; + hspot += app->w; break; case OB_ORIENTATION_VERT: app->x = (dock->w - app->w) / 2; - app->y = spot; - spot += app->h; + app->y = vspot; + vspot += app->h; break; } @@ -435,8 +443,8 @@ void dock_configure() break; case OB_DIRECTION_NORTH: STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0, - dock->x, dock->x + dock->w - 1, - 0, 0, 0, 0, 0, 0); + 0, 0, dock->x, dock->x + dock->w - 1, + 0, 0, 0, 0); break; case OB_DIRECTION_NORTHEAST: switch (config_dock_orient) { @@ -498,9 +506,6 @@ void dock_configure() } } - dock->w += minw; - dock->h += minh; - /* not used for actually sizing shit */ dock->w -= ob_rr_theme->obwidth * 2; dock->h -= ob_rr_theme->obwidth * 2; |
