summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-11-19 03:30:36 +0000
committersabetts <sabetts>2006-11-19 03:30:36 +0000
commit59dd6a0795dd27192e5c9e63a1d2648bce559326 (patch)
tree9b3c9f1ea0262d83d1a0d191b525ad267b19f757 /src/split.c
parentdbf36396207f43980270d5cdd6c9785c594958b9 (diff)
downloadratpoison-59dd6a0795dd27192e5c9e63a1d2648bce559326.zip
(show_frame_message): handle the case when the frame
is empty.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/split.c b/src/split.c
index ba4cd3b..ce9bb35 100644
--- a/src/split.c
+++ b/src/split.c
@@ -971,18 +971,27 @@ show_frame_message (char *msg)
int width, height;
rp_frame *frame;
rp_window *win;
- rp_group *g;
- rp_window_elem *elem;
+ rp_window_elem *elem = NULL;
struct sbuf *msgbuf;
frame = current_frame();
-
win = current_window ();
- g = groups_find_group_by_window (win);
- elem = group_find_window (&g->mapped_windows, win);
- msgbuf = sbuf_new (0);
+ if (win)
+ {
+ rp_group *g;
+
+ g = groups_find_group_by_window (win);
+ elem = group_find_window (&g->mapped_windows, win);
+ }
- format_string (msg, elem, msgbuf);
+ /* A frame doesn't always contain a window. */
+ msgbuf = sbuf_new (0);
+ if (elem)
+ format_string (msg, elem, msgbuf);
+ else
+ {
+ sbuf_concat (msgbuf, EMPTY_FRAME_MESSAGE);
+ }
width = defaults.bar_x_padding * 2 + XmbTextEscapement (defaults.font, msgbuf->data,
msgbuf->len);