summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-03-31 07:06:22 +0000
committersabetts <sabetts>2003-03-31 07:06:22 +0000
commiteac6dda17283fe9f312d0c8576f4370f82fc5c0a (patch)
treeb21d6e62bee0b6e4374e240537dfb975fd8a6680 /src/window.c
parent84ee56d66b889363903eddd81a8b2a07f180656f (diff)
downloadratpoison-eac6dda17283fe9f312d0c8576f4370f82fc5c0a.zip
* src/split.c (current_window): call screen_get_frame.
(split_frame): call screen_get_frame to get appropriate structure. (split_frame): call find_window_number to get appropriate structure. (remove_all_splits): call screen_get_frame to get appropriate structure. (resize_frame): make sure all frames that will be resized are big enough for the resize. (resize_frame): return int (resize_shrink_to_window): call find_window_number to get the appropriate structure. (resize_frame_right): return int (resize_frame_left): likewise (resize_frame_top): likewise (resize_frame_bottom): likewise (resize_frame_horizontally): backup the frameset and restore it if the resize fails. Do not allow a frame to be resized too small or too big. (resize_frame_vertically): likewise (remove_frame): call find_window_number to get the appropriate structure. (set_active_frame): likewise (blank_frame): likewise (show_frame_message): call screen_get_frame to get the appropriate structure. * src/screen.c (screen_width): new function (and prototype) (screen_height): likewise (screen_left): likewise (screen_right): likewise (screen_top): likewise (screen_bottom): likewise (screen_copy_frameset): likewise (screen_restore_frameset): likewise (frameset_free): likewise (screen_get_frame): likewise * src/split.c (maximize_frame): call screen_width and screen_height to get the size for the frame. * src/ratpoison.h: include screen.h * src/manage.c (move_window): * src/frame.h (frame_copy): new prototype (frame_dump): likewise * src/frame.c (frame_copy): new function (frame_dump): likewise * src/events.c (unmap_notify): compare frame numbers, not pointers. (client_msg): call screen_get_frame when blanking the frame. * src/data.h (EMPTY): new define (struct rp_window_frame): replace the win field with win_number. Dependant code updated. (struct rp_window): replace frame with frame_number. Dependant code updated. (struct screen_info): replace rp_current_frame with current_frame and change type to int. Dependant code updated. * src/Makefile.am (ratpoison_SOURCES): added screen.h and screen.c
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index 87ad967..a3042ab 100644
--- a/src/window.c
+++ b/src/window.c
@@ -178,7 +178,10 @@ find_window (Window w)
void
set_current_window (rp_window *win)
{
- set_frames_window (current_screen()->rp_current_frame, win);
+ rp_window_frame *frame;
+
+ frame = screen_get_frame (current_screen(), current_screen()->current_frame);
+ set_frames_window (frame, win);
}
rp_window *
@@ -475,10 +478,12 @@ void
set_active_window (rp_window *win)
{
rp_window *last_win;
+ rp_window_frame *frame;
if (win == NULL) return;
- last_win = set_frames_window (win->scr->rp_current_frame, win);
+ frame = screen_get_frame (win->scr, win->scr->current_frame);
+ last_win = set_frames_window (frame, win);
if (last_win) PRINT_DEBUG (("last window: %s\n", window_name (last_win)));
PRINT_DEBUG (("new window: %s\n", window_name (win)));
@@ -683,3 +688,12 @@ free_window_stuff ()
{
numset_free (rp_window_numset);
}
+
+rp_window_frame *
+win_get_frame (rp_window *win)
+{
+ if (win->frame_number != EMPTY)
+ return screen_get_frame (win->scr, win->frame_number);
+ else
+ return NULL;
+}