[openbox] client_list_menu
Peter N. Spotts
pspotts at alum.mit.edu
Thu Feb 23 10:33:53 EST 2006
On Thu, 23 Feb 2006 17:17:16 +0200
Artyom Mirgorodsky <man at alkar.net> wrote:
> Hi
>
> I think that openbox needs the list of clients on a current desktop
> I offer a following patch client_list_menu.c
>
>
>
> 31c31,32
> < #define MENU_NAME "client-list-menu"
> ---
> > #define DESKTOP_MENU_NAME "desktop-list-menu"
> > #define CLIENT_MENU_NAME "client-list-menu"
> 132c133
> < gchar *name = g_strdup_printf("%s-%u", MENU_NAME, i);
> ---
> > gchar *name = g_strdup_printf("%s-%u",
> > DESKTOP_MENU_NAME, i);
> 156a158,207
> > static void client_self_update(ObMenuFrame *frame, gpointer gdata)
> > {
> > ObMenu *menu = frame->menu;
> > menu->title = screen_desktop_names[screen_desktop];
> > menu_clear_entries(menu);
> >
> > GList *it;
> > gint i;
> > gboolean icons = FALSE;
> > gboolean empty = TRUE;
> >
> > for (it = focus_order[screen_desktop], i = 0; it; it =
> > g_list_next(it),
> ++i)
> > {
> > ObClient *c = it->data;
> > if (client_normal(c) && !c->skip_taskbar) {
> > GSList *acts = NULL;
> > ObAction* act;
> > ObMenuEntry *e;
> > const ObClientIcon *icon;
> >
> > empty = FALSE;
> >
> > if (!icons && c->iconic) {
> > icons = TRUE;
> > menu_add_separator(menu, -1);
> > }
> >
> > act = action_from_string("Activate",
> > OB_USER_ACTION_MENU_SELECTION);
> > act->data.activate.any.c = c;
> > acts = g_slist_append(acts, act);
> > e = menu_add_normal(menu, i,
> > (c->iconic ? c->icon_title :
> > c->title),
> acts);
> >
> > if ((icon = client_icon(c, 32, 32))) {
> > e->data.normal.icon_width = icon->width;
> > e->data.normal.icon_height = icon->height;
> > e->data.normal.icon_data = icon->data;
> > }
> > }
> > }
> >
> > if (empty)
> > {
> > ObMenuEntry *e;
> > e = menu_add_normal(menu, 0, _("No clients"), 0);
> > e->data.normal.enabled = FALSE;
> > }
> > }
> >
> 161c212,216
> < menu = menu_new(MENU_NAME, _("Desktops"), NULL);
> ---
> > menu = menu_new(CLIENT_MENU_NAME, _("Clients"), NULL);
> > menu_set_update_func(menu, client_self_update);
> > menu_set_execute_func(menu, desk_menu_execute);
> >
> > menu = menu_new(DESKTOP_MENU_NAME, _("Desktops"), NULL);
>
>
>
Folks,
I'm about to betray a gross ignorance of matters computational, but if
I want to see the list of clients running on my desktop (or
minimized), I use OB's built-in "Desktop" menu selection, then pick
the number assigned to the desktop I'm interested in (which in my
case is only 1). I shall now crawl back into my corner...
Pete
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Peter N. Spotts | Science Correspondent
The Christian Science Monitor
One Norway Street, Boston MA 02115
Office: 617-450-2449 | Office in home: 508-520-3139
Email: pspotts at alum.mit.edu | www.csmonitor.com
Amateur-radio call - KC1JB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"The knack of flying is to throw yourself at the ground and miss."
-- Douglas Adams
More information about the openbox
mailing list