summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2003-06-29 01:45:32 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2003-06-29 01:45:32 +0000
commit8de13a41b6e3a8fb57c6ea1c8d769ac029654c9a (patch)
tree8d84d61a603ade9c8818b58bed0b7cfc74220c08
parent71b7b043a2ca6fc99a41a1e47e76f96eb7218ad9 (diff)
Update the send-to window only if the workspaces have changed.
-rw-r--r--plugins/menu/client_menu.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/plugins/menu/client_menu.c b/plugins/menu/client_menu.c
index aa09495b..67c17acd 100644
--- a/plugins/menu/client_menu.c
+++ b/plugins/menu/client_menu.c
@@ -21,24 +21,39 @@ typedef struct {
#define CLIENT_MENU(m) ((Menu *)m)
#define CLIENT_MENU_DATA(m) ((Client_Menu_Data *)((Menu *)m)->plugin_data)
-
void client_menu_clean_up(Menu *m) {
}
void client_send_to_update(Menu *self)
{
- guint i;
+ guint i = 0;
+ GList *it = self->entries;
- for (i = 0; i < screen_num_desktops; ++i) {
- MenuEntry *e;
- Action *a = action_from_string("sendtodesktop");
- a->data.sendto.desk = i;
- a->data.sendto.follow = FALSE;
- e = menu_entry_new(screen_desktop_names[i], a);
- menu_add_entry(self, e);
+ /* check if we have to update. lame */
+ while (it != NULL) {
+ if (i >= screen_num_desktops)
+ break;
+ if (strcmp(screen_desktop_names[i],
+ ((MenuEntry *)it->data)->label) != 0)
+ break;
+ ++i;
+ it = it->next;
}
- menu_render_full(self);
+ if (it != NULL || i != screen_num_desktops) {
+ menu_clear(self);
+ g_message("update");
+ for (i = 0; i < screen_num_desktops; ++i) {
+ MenuEntry *e;
+ Action *a = action_from_string("sendtodesktop");
+ a->data.sendto.desk = i;
+ a->data.sendto.follow = FALSE;
+ e = menu_entry_new(screen_desktop_names[i], a);
+ menu_add_entry(self, e);
+ }
+
+ menu_render_full(self);
+ }
}
void client_menu_show(Menu *self, int x, int y, Client *client)