summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-02-27 09:29:25 +0000
committersabetts <sabetts>2004-02-27 09:29:25 +0000
commit152a72b51659d4e7e7f919bf342c0b5f559ffefd (patch)
tree027e42a59d809b04aff0caab4de8c9aa80cee1ae /src/screen.c
parentf83599ce2cf6197a53e66a9a08854d0a51b50a35 (diff)
downloadratpoison-152a72b51659d4e7e7f919bf342c0b5f559ffefd.zip
* src/screen.c (screen_free_nums): new function. prototype added
(init_screens): init rp_frame_numset (init_screen): set screen's frames_numset to rp_frame_numset * src/globals.h: new global prototype, rp_frame_numset * src/globals.c: new global, rp_frame_numset * src/split.c (find_last_frame): find the last from of all the screens. prototype updated. Callers updated. (find_frame_number): search all screens. prototype updated. callers updated. * src/actions.c (cmd_fselect): select from frames in all screens.
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index f46e3ca..5d7329d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -91,6 +91,19 @@ screen_restore_frameset (rp_screen *s, struct list_head *head)
list_splice (head, &s->frames);
}
+
+/* Given a screen, free the frames' numbers from the numset. */
+void
+screen_free_nums (rp_screen *s)
+{
+ rp_frame *cur;
+
+ list_for_each_entry (cur, &s->frames, node)
+ {
+ numset_release (s->frames_numset, cur->number);
+ }
+}
+
/* Given a list of frames, free them, but don't remove their numbers
from the numset. */
void
@@ -168,6 +181,9 @@ init_screens (int screen_arg, int screen_num)
num_screens = 1;
}
+ /* Create our global frame numset */
+ rp_frame_numset = numset_new();
+
/* Initialize the screens */
screens = (rp_screen *)xmalloc (sizeof (rp_screen) * num_screens);
PRINT_DEBUG (("%d screens.\n", num_screens));
@@ -227,8 +243,8 @@ init_screen (rp_screen *s, int screen_num)
| SubstructureRedirectMask | SubstructureNotifyMask );
XSync (dpy, False);
- /* Create the numset for the frames. */
- s->frames_numset = numset_new ();
+ /* Set the numset for the frames to our global numset. */
+ s->frames_numset = rp_frame_numset;
/* Build the display string for each screen */
s->display_string = xmalloc (strlen(DisplayString (dpy)) + 21);