diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | src/split.c | 46 |
3 files changed, 37 insertions, 23 deletions
@@ -1,3 +1,13 @@ +2001-08-26 Shawn <sabetts@hotdog> + + * src/split.c (num_frames): uncomment. + (set_active_frame): only show the frame indicator if, in addition, + there are more than 1 frames. + (set_active_frame): give the root window focus if there is no + current window. + (blank_frame): only show the frame indicator if, in addition, + there are more than 1 frames. + 2001-08-24 Shawn <sabetts@hotdog> * src/input.c (get_more_input): detect and handle a user abort key @@ -2,6 +2,10 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- * Changes since 0.1.1 +** The frame indicator +The frame indicator only appears when the current frame is blank and +there is more than one frame (ie when there are splits). + ** Transient window handling has changed Transient windows now map ontop of the current window. 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); } |