summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-08-26 19:19:54 +0000
committersabetts <sabetts>2001-08-26 19:19:54 +0000
commitc2a6c97837fc2346868f74feb0f16563588937b9 (patch)
tree9b797d441c32e1e4832d623a6741ac570abbe0a6
parent87ea5e2a1081de517200e9029842cb6bc0090c47 (diff)
downloadratpoison-c2a6c97837fc2346868f74feb0f16563588937b9.zip
frame indicator suppressed when there is only 1 frame
-rw-r--r--ChangeLog10
-rw-r--r--NEWS4
-rw-r--r--src/split.c46
3 files changed, 37 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index b66221e..310e2ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/NEWS b/NEWS
index 8797010..89ce3e8 100644
--- a/NEWS
+++ b/NEWS
@@ -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);
}