diff options
author | James Booth <boothj5@gmail.com> | 2015-03-08 18:12:50 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-03-08 18:12:50 +0000 |
commit | 2e493112bb6cb7a6b2ca21042d84b5c98db33460 (patch) | |
tree | f998e558de333acad317b68293be7c0ea0efdad8 /src | |
parent | 2112ddea65b076dafc08fb0b5a58ca57f65a6066 (diff) | |
parent | 7638f379cac3869abdd8530faa09cc7481e99ec6 (diff) | |
download | profani-tty-2e493112bb6cb7a6b2ca21042d84b5c98db33460.tar.gz |
Merge branch 'master' into readline
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/windows.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/windows.c b/src/ui/windows.c index dba5290c..b534e973 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -639,20 +639,21 @@ wins_swap(int source_win, int target_win) { ProfWin *source = g_hash_table_lookup(windows, GINT_TO_POINTER(source_win)); - if (source != NULL) { + if (source) { ProfWin *target = g_hash_table_lookup(windows, GINT_TO_POINTER(target_win)); // target window empty - if (target == NULL) { + if (!target) { g_hash_table_steal(windows, GINT_TO_POINTER(source_win)); - status_bar_inactive(source_win); g_hash_table_insert(windows, GINT_TO_POINTER(target_win), source); + status_bar_inactive(source_win); if (win_unread(source) > 0) { status_bar_new(target_win); } else { status_bar_active(target_win); } - if ((wins_get_current_num() == source_win) || (wins_get_current_num() == target_win)) { + if (wins_get_current_num() == source_win) { + wins_set_current_by_num(target_win); ui_switch_win(1); } return TRUE; |