[openbox] Wish list
Ed Murphy
emurphy42 at gmail.com
Sun Sep 19 18:05:13 EDT 2004
On Sun, 19 Sep 2004 18:07:33 +0930, Tim Riley <tr at slackzone.org> wrote:
> I am sure that Mikael will consider the implementation of these features
> when you send in the patches.
Oh dear, a challenge. I've never done any non-toy C programming,
but there's always a first time...
Here's my first (untested) pass at the dockapp ordering issue. (This
has already done me some good-- I didn't realize that you can move a
dockapp via alt+click+drag.) Criticism so far?
[dock.c, excerpt]
void dock_add(Window win, XWMHints *wmhints)
{
ObDockApp *app;
XWindowAttributes attrib;
gchar **data;
/* EWM 09/19/04 begin */
GList *it, it_order;
gboolean inserted;
gint position1, position2;
/* EWM 09/19/04 end */
app = g_new0(ObDockApp, 1);
app->obwin.type = Window_DockApp;
app->win = win;
app->icon_win = (wmhints->flags & IconWindowHint) ?
wmhints->icon_window : win;
if (PROP_GETSS(app->win, wm_class, locale, &data)) {
if (data[0]) {
app->name = g_strdup(data[0]);
if (data[1])
app->class = g_strdup(data[1]);
}
g_strfreev(data);
}
if (app->name == NULL) app->name = g_strdup("");
if (app->class == NULL) app->class = g_strdup("");
if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
app->w = attrib.width;
app->h = attrib.height;
} else {
app->w = app->h = 64;
}
/* EWM 09/19/04 begin */
/* dock->dock_apps = g_list_append(dock->dock_apps, app); */
inserted = FALSE;
/* README begin temporary code - this list should be parsed from
theme.rc at startup */
it_order = NULL;
g_list_append(it_order, "wmxmms");
g_list_append(it_order, "wmcube");
g_list_append(it_order, "wmnet");
g_list_append(it_order, "wmclock");
g_list_append(it_order, "wmuptime");
g_list_append(it_order, "Temperature");
g_list_append(it_order, "wmMoonClock");
/* README end temporary code */
position1 = g_list_position(it_order, app->name);
if (position1 > -1)
for (it = dock->dock_apps; it; it = g_list_next(it)) {
position2 = g_list_position(it_order, it->data[0]);
if (position2 > position1) {
dock->dock_apps =
g_list_insert_before(dock->dock_apps, it, app);
inserted = TRUE;
}
}
if (!inserted)
dock->dock_apps = g_list_append(dock->dock_apps, app);
/* EWM 09/19/04 end */
More information about the openbox
mailing list