summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@pidgin.im>2007-11-23 04:04:33 +0000
committerSadrul Habib Chowdhury <sadrul@pidgin.im>2007-11-23 04:04:33 +0000
commita99fd9fca492d1c088e9664bf9b40664b79380d8 (patch)
treeda3fcc6674dc31e059175d25d9a7dfb4e0cb65ce
parent5f1ed4ef560bd30e94375004a7bd33ccd8e3be54 (diff)
downloadpidgin-a99fd9fca492d1c088e9664bf9b40664b79380d8.tar.gz
Switch to 'normal' state when: switching windows or workspaces, closing
window or getting the action/window lists.
-rw-r--r--finch/libgnt/gntwm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c
index 26f3b544c9..ad3f9dab8c 100644
--- a/finch/libgnt/gntwm.c
+++ b/finch/libgnt/gntwm.c
@@ -81,6 +81,7 @@ static gboolean workspace_prev(GntBindable *wm, GList *n);
static int widestringwidth(wchar_t *wide);
#endif
+static void ensure_normal_mode(GntWM *wm);
static gboolean write_already(gpointer data);
static int write_timeout;
static time_t last_active_time;
@@ -392,6 +393,10 @@ switch_window(GntWM *wm, int direction)
if (!wm->cws->ordered || !wm->cws->ordered->next)
return;
+ if (wm->mode != GNT_KP_MODE_NORMAL) {
+ ensure_normal_mode(wm);
+ }
+
w = wm->cws->ordered->data;
pos = g_list_index(wm->cws->list, w);
pos += direction;
@@ -503,6 +508,7 @@ window_close(GntBindable *bindable, GList *null)
if (wm->cws->ordered) {
gnt_widget_destroy(wm->cws->ordered->data);
+ ensure_normal_mode(wm);
}
return TRUE;
@@ -522,6 +528,7 @@ static void
setup__list(GntWM *wm)
{
GntWidget *tree, *win;
+ ensure_normal_mode(wm);
win = wm->_list.window = gnt_box_new(FALSE, FALSE);
gnt_box_set_toplevel(GNT_BOX(win), TRUE);
gnt_box_set_pad(GNT_BOX(win), 0);
@@ -972,6 +979,16 @@ window_reverse(GntWidget *win, gboolean set, GntWM *wm)
update_screen(wm);
}
+static void
+ensure_normal_mode(GntWM *wm)
+{
+ if (wm->mode != GNT_KP_MODE_NORMAL) {
+ if (wm->cws->ordered)
+ window_reverse(wm->cws->ordered->data, FALSE, wm);
+ wm->mode = GNT_KP_MODE_NORMAL;
+ }
+}
+
static gboolean
start_move(GntBindable *bindable, GList *null)
{
@@ -1453,6 +1470,7 @@ gnt_wm_switch_workspace(GntWM *wm, gint n)
if (wm->_list.window) {
gnt_widget_destroy(wm->_list.window);
}
+ ensure_normal_mode(wm);
gnt_ws_hide(wm->cws, wm->nodes);
wm->cws = s;
gnt_ws_show(wm->cws, wm->nodes);