summaryrefslogtreecommitdiff
path: root/src/split.c
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 /src/split.c
parent87ea5e2a1081de517200e9029842cb6bc0090c47 (diff)
downloadratpoison-c2a6c97837fc2346868f74feb0f16563588937b9.zip
frame indicator suppressed when there is only 1 frame
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c46
1 files changed, 23 insertions, 23 deletions
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);
}