fix how the dock is placed, its struts, and set a window type hint on it

This commit is contained in:
Dana Jansens 2007-06-13 02:32:20 +00:00
parent 809619497d
commit 8c05970840

View file

@ -94,6 +94,10 @@ void dock_startup(gboolean reconfig)
RrColorPixel(ob_rr_theme->osd_border_color)); RrColorPixel(ob_rr_theme->osd_border_color));
XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->obwidth); 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); g_hash_table_insert(window_map, &dock->frame, dock);
stacking_add(DOCK_AS_WINDOW(dock)); stacking_add(DOCK_AS_WINDOW(dock));
} }
@ -214,13 +218,13 @@ void dock_remove(ObDockApp *app, gboolean reparent)
void dock_configure() void dock_configure()
{ {
GList *it; GList *it;
gint spot; gint hspot, vspot;
gint gravity; gint gravity;
gint minw, minh; gint l, r, t, b;
gint strw, strh; gint strw, strh;
Rect *a; Rect *a;
RrMinSize(dock->a_frame, &minw, &minh); RrMargins(dock->a_frame, &l, &t, &r, &b);
dock->w = dock->h = 0; 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 */ /* position the apps */
for (it = dock->dock_apps; it; it = g_list_next(it)) { for (it = dock->dock_apps; it; it = g_list_next(it)) {
ObDockApp *app = it->data; ObDockApp *app = it->data;
switch (config_dock_orient) { switch (config_dock_orient) {
case OB_ORIENTATION_HORZ: case OB_ORIENTATION_HORZ:
app->x = spot; app->x = hspot;
app->y = (dock->h - app->h) / 2; app->y = (dock->h - app->h) / 2;
spot += app->w; hspot += app->w;
break; break;
case OB_ORIENTATION_VERT: case OB_ORIENTATION_VERT:
app->x = (dock->w - app->w) / 2; app->x = (dock->w - app->w) / 2;
app->y = spot; app->y = vspot;
spot += app->h; vspot += app->h;
break; break;
} }
@ -435,8 +443,8 @@ void dock_configure()
break; break;
case OB_DIRECTION_NORTH: case OB_DIRECTION_NORTH:
STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0, STRUT_PARTIAL_SET(dock_strut, 0, strh, 0, 0,
dock->x, dock->x + dock->w - 1, 0, 0, dock->x, dock->x + dock->w - 1,
0, 0, 0, 0, 0, 0); 0, 0, 0, 0);
break; break;
case OB_DIRECTION_NORTHEAST: case OB_DIRECTION_NORTHEAST:
switch (config_dock_orient) { switch (config_dock_orient) {
@ -498,9 +506,6 @@ void dock_configure()
} }
} }
dock->w += minw;
dock->h += minh;
/* not used for actually sizing shit */ /* not used for actually sizing shit */
dock->w -= ob_rr_theme->obwidth * 2; dock->w -= ob_rr_theme->obwidth * 2;
dock->h -= ob_rr_theme->obwidth * 2; dock->h -= ob_rr_theme->obwidth * 2;