diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | src/actions.c | 2 | ||||
-rw-r--r-- | src/bar.c | 20 | ||||
-rw-r--r-- | src/bar.h | 1 | ||||
-rw-r--r-- | src/split.c | 10 |
5 files changed, 44 insertions, 3 deletions
@@ -1,7 +1,21 @@ 2003-05-09 Shawn Betts <sabetts@sfu.ca> + * src/split.c (split_frame): call update_bar() instead of + update_window_names(). + (set_active_frame): likewise + (blank_frame): likewise + + * src/bar.h (update_bar): new prototype. + + * src/bar.c (BAR_IS_HIDDEN): new define. + (update_bar): new function. + + * src/actions.c (cmd_frestore): call update_bar() instead of + update_window_names(). + * src/split.c (set_active_frame): update the window list after switching frames. + (blank_frame): update the window list after blanking the screen. * src/actions.c (cmd_frestore): update the window list after restoring the frames. diff --git a/src/actions.c b/src/actions.c index 8dfb7a1..3b54b76 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3088,7 +3088,7 @@ cmd_frestore (int interactively, char *data) } set_active_frame (current_frame()); - update_window_names (s); + update_bar (s); show_frame_indicator(); PRINT_DEBUG (("Done.\n")); @@ -35,6 +35,7 @@ #include "assert.h" /* Possible values for bar_is_raised status. */ +#define BAR_IS_HIDDEN 0 #define BAR_IS_WINDOW_LIST 1 #define BAR_IS_MESSAGE 2 @@ -136,6 +137,23 @@ bar_y (screen_info *s, int height) } void +update_bar (screen_info *s) +{ + if (s->bar_is_raised == BAR_IS_HIDDEN) + return; + + if (s->bar_is_raised == BAR_IS_MESSAGE) + { + show_last_message(); + } + else + { + /* The bar is showing a window list. */ + update_window_names (s); + } +} + +void update_window_names (screen_info *s) { struct sbuf *bar_buffer; @@ -393,6 +411,8 @@ marked_wrapped_message (char *msg, int mark_start, int mark_end) } /* Keep a record of the message. */ + /* FIXME: What about multiple screens? We need a bar structure for + each screen. */ if (last_msg) free (last_msg); last_msg = xstrdup (msg); @@ -23,6 +23,7 @@ #define _RATPOISON_BAR_H 1 void update_window_names (screen_info *s); +void update_bar (screen_info *s); int show_bar (screen_info *s); int hide_bar (screen_info *s); int bar_y (screen_info *s, int height); diff --git a/src/split.c b/src/split.c index 17391b5..def1349 100644 --- a/src/split.c +++ b/src/split.c @@ -350,7 +350,7 @@ split_frame (rp_window_frame *frame, int way, int pixels) XRaiseWindow (dpy, find_window_number (frame->win_number)->w); } - update_window_names (s); + update_bar (s); show_frame_indicator(); } @@ -839,11 +839,12 @@ set_active_frame (rp_window_frame *frame) /* If frame->win == NULL, then rp_current_screen is not updated. */ rp_current_screen = s->screen_num; + update_bar (s); + /* Possibly show the frame indicator. */ if ((old != s->current_frame && num_frames(s) > 1) || s != old_s) { - update_window_names (s); show_frame_indicator(); } @@ -859,16 +860,21 @@ set_active_frame (rp_window_frame *frame) void blank_frame (rp_window_frame *frame) { + screen_info *s; rp_window *win; if (frame->win_number == EMPTY) return; + s = frames_screen (frame); + win = find_window_number (frame->win_number); hide_window (win); hide_others (win); set_frames_window (frame, NULL); + update_bar (s); + /* Give the key window focus. */ XSetInputFocus (dpy, current_screen()->key_window, RevertToPointerRoot, CurrentTime); |