client_list_menu

Artyom Mirgorodsky man at alkar.net
Thu Feb 23 10:17:16 EST 2006


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);



-- 
MAN



More information about the openbox mailing list