about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-08-30 00:49:38 +0100
committerJames Booth <boothj5@gmail.com>2013-08-30 00:49:38 +0100
commit4ae817cd8292f964ef1c45bfa3b70544ce23043f (patch)
tree935f88f5ddcace492c40ab8386ac5d92a26dda19
parent7f476b3e2cb4739adb6b5ea02a9b86f19637b819 (diff)
downloadprofani-tty-4ae817cd8292f964ef1c45bfa3b70544ce23043f.tar.gz
Fixed ">" indicator when tidying windows
-rw-r--r--src/ui/core.c2
-rw-r--r--src/ui/statusbar.c14
-rw-r--r--src/ui/ui.h1
-rw-r--r--src/ui/windows.c5
4 files changed, 17 insertions, 5 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index d6e17854..2229d37c 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -621,8 +621,8 @@ void
 ui_close_current(void)
 {
     int current_index = wins_get_current_num();
-    wins_close_current();
     status_bar_inactive(current_index);
+    wins_close_current();
     status_bar_active(1);
     title_bar_title();
 }
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index e4d61811..e7456adc 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -130,6 +130,20 @@ status_bar_resize(void)
 }
 
 void
+status_bar_set_all_inactive(void)
+{
+    int i = 0;
+    for (i = 0; i < 12; i++) {
+        is_active[i] = FALSE;
+        is_new[i] = FALSE;
+        _mark_inactive(i);
+    }
+
+    g_hash_table_remove_all(remaining_active);
+    g_hash_table_remove_all(remaining_new);
+}
+
+void
 status_bar_inactive(const int win)
 {
     int true_win = win;
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 157f8ad3..fa74bed6 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -225,6 +225,7 @@ void status_bar_inactive(const int win);
 void status_bar_active(const int win);
 void status_bar_new(const int win);
 void status_bar_update_time(void);
+void status_bar_set_all_inactive(void);
 
 // input window actions
 wint_t inp_get_char(char *input, int *size);
diff --git a/src/ui/windows.c b/src/ui/windows.c
index 81a6d3e6..e956068c 100644
--- a/src/ui/windows.c
+++ b/src/ui/windows.c
@@ -332,10 +332,7 @@ wins_tidy(void)
     }
 
     if (tidy_required) {
-        int i = 0;
-        for (i = 0; i < 12; i++) {
-            status_bar_inactive(i);
-        }
+        status_bar_set_all_inactive();
         GHashTable *new_windows = g_hash_table_new_full(g_direct_hash,
             g_direct_equal, NULL, (GDestroyNotify)win_free);