From c2a6c97837fc2346868f74feb0f16563588937b9 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sun, 26 Aug 2001 19:19:54 +0000 Subject: frame indicator suppressed when there is only 1 frame --- src/split.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/split.c') diff --git a/src/split.c b/src/split.c index 2a282f9..36b7b91 100644 --- a/src/split.c +++ b/src/split.c @@ -376,21 +376,21 @@ total_frame_area () return area; } -/* static int */ -/* num_frames () */ -/* { */ -/* int count = 0; */ -/* rp_window_frame *cur; */ - -/* for (cur = rp_window_frame_sentinel->next; */ -/* cur != rp_window_frame_sentinel; */ -/* cur = cur->next) */ -/* { */ -/* count++; */ -/* } */ - -/* return count; */ -/* } */ +static int +num_frames () +{ + int count = 0; + rp_window_frame *cur; + + for (cur = rp_window_frame_sentinel->next; + cur != rp_window_frame_sentinel; + cur = cur->next) + { + count++; + } + + return count; +} /* Return 1 if frames f1 and f2 overlap */ static int @@ -526,18 +526,18 @@ set_active_frame (rp_window_frame *frame) give_window_focus (frame->win, rp_current_frame->win); rp_current_frame = frame; - if (!frame->win || old != rp_current_frame) + if ((!frame->win || old != rp_current_frame) + && num_frames() > 1) { show_frame_indicator(); } - /* If the frame has no window to give focus to, give the frame - indicator focus. */ + /* If the frame has no window to give focus to, give the root window + focus. */ if( !frame->win ) { - XSetInputFocus (dpy, current_screen()->frame_window, - RevertToPointerRoot, CurrentTime); - } + XSetInputFocus (dpy, PointerRoot, RevertToPointerRoot, CurrentTime); + } } void @@ -549,7 +549,7 @@ blank_frame (rp_window_frame *frame) hide_window (frame->win); set_frames_window (frame, NULL); - if (frame == rp_current_frame) + if (frame == rp_current_frame && num_frames() > 1) { show_frame_indicator(); XSetInputFocus (dpy, current_screen()->frame_window, @@ -561,7 +561,7 @@ void hide_frame_indicator () { /* Only hide the frame indicator if a window occupies the frame */ - if (rp_current_frame->win) + if (num_frames() <= 1 || rp_current_frame->win) { XUnmapWindow (dpy, current_screen()->frame_window); } -- cgit v1.2.3