summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-05-16 23:25:06 +0000
committersabetts <sabetts>2003-05-16 23:25:06 +0000
commitcf843449115562fe44be792e37bd78639414da4e (patch)
tree0eba8dbd41b3ad9328b600ca35b4d41e34aaec60 /src/split.c
parentbcf85f95069519c29b2263ff5391a4da0442188e (diff)
downloadratpoison-cf843449115562fe44be792e37bd78639414da4e.zip
* src/window.c (add_to_window_list): add the window to the current
group. (find_window_name): search the current group for a matching window. (find_window_other): likewise. (format_window_name): take a rp_window_elem as an argument, not an rp_window. Print the group window's number, not the window's internal number. (get_window_list): loop through the current group. * src/split.c (find_window_for_frame): search the current group for a window to fit in the frame. * src/ratpoison.h: include globals.h and group.h * src/manage.c (unmanage): remove the window from any groups it was in. (map_window): map the window in any groups it is in. (withdraw_window): unmap the window in any groups it is in. * src/main.c: Move all globals to globals.h (main): initialize the group functions. * src/data.h: Move all defines and extern globals to globals.h (struct rp_window_elem): new struct (struct rp_group): likewise * src/actions.h (cmd_gnext): new prototype (cmd_gprev): likewise (cmd_gnew): likewise * src/actions.c (user_commands): new commands gnext, gprev, and gnew (cmd_prev): fix to work with new group code. (cmd_next): likewise (cmd_gnext): new function (cmd_gprev): likewise (cmd_gnew): likewise * src/Makefile.am (ratpoison_SOURCES): add files globals.h, globals.c, group.h and group.c
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/split.c b/src/split.c
index 7b4106b..b64164b 100644
--- a/src/split.c
+++ b/src/split.c
@@ -267,24 +267,27 @@ find_window_for_frame (rp_frame *frame)
{
rp_screen *s = frames_screen (frame);
int last_access = 0;
- rp_window *most_recent = NULL;
- rp_window *cur;
+ rp_window_elem *most_recent = NULL;
+ rp_window_elem *cur;
- list_for_each_entry (cur, &rp_mapped_window, node)
+ list_for_each_entry (cur, &rp_current_group->mapped_windows, node)
{
- if (cur->scr == s
- && cur != current_window()
- && !find_windows_frame (cur)
- && cur->last_access >= last_access
- && window_fits_in_frame (cur, frame)
- && cur->frame_number == EMPTY)
+ if (cur->win->scr == s
+ && cur->win != current_window()
+ && !find_windows_frame (cur->win)
+ && cur->win->last_access >= last_access
+ && window_fits_in_frame (cur->win, frame)
+ && cur->win->frame_number == EMPTY)
{
most_recent = cur;
- last_access = cur->last_access;
+ last_access = cur->win->last_access;
}
}
- return most_recent;
+ if (most_recent)
+ return most_recent->win;
+
+ return NULL;
}
/* Splits the frame in 2. if way is 0 then split vertically otherwise