# HG changeset patch # User Sadrul Habib Chowdhury # Date 1153143428 0 # Node ID 421259b9e06d104a63f3791fb91300a4a624979f # Parent f61428cc40192484937262f0126d191a37baebb1 [gaim-migrate @ 16508] Use alt+, and alt+. to change the order of the window. committer: Tailor Script diff -r f61428cc4019 -r 421259b9e06d console/libgnt/gntmain.c --- a/console/libgnt/gntmain.c Mon Jul 17 06:21:53 2006 +0000 +++ b/console/libgnt/gntmain.c Mon Jul 17 13:37:08 2006 +0000 @@ -275,6 +275,34 @@ g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); } +static void +shift_window(GntWidget *widget, int dir) +{ + GList *all = g_list_first(focus_list); + GList *list = g_list_find(all, widget); + int length, pos; + if (!list) + return; + + length = g_list_length(all); + pos = g_list_position(all, list); + + pos += dir; + if (dir > 0) + pos++; + + if (pos < 0) + pos = length; + else if (pos > length) + pos = 0; + + all = g_list_insert(all, widget, pos); + all = g_list_delete_link(all, list); + if (focus_list == list) + focus_list = g_list_find(all, widget); + draw_taskbar(); +} + static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { @@ -351,6 +379,15 @@ /* Resize window */ mode = GNT_KP_MODE_RESIZE; } + else if (strcmp(buffer + 1, ",") == 0 && focus_list) + { + /* Re-order the list of windows */ + shift_window(focus_list->data, -1); + } + else if (strcmp(buffer + 1, ".") == 0 && focus_list) + { + shift_window(focus_list->data, 1); + } } } }