summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-02-27 08:28:16 +0000
committersabetts <sabetts>2004-02-27 08:28:16 +0000
commitfab11adc940f3258dc53c823903f242d9c65da91 (patch)
treeb1057b031c67173189c0c60dbf93fe2b2f8c1210 /src/split.c
parenta5c30aed8f3d73ac39e997a11068d12b82eab42e (diff)
downloadratpoison-fab11adc940f3258dc53c823903f242d9c65da91.zip
* src/window.c (give_window_focus): save the mouse position before
checking if win is NULL. (give_window_focus): set rp_current_screen to xine_screen_num of the window's screen. (set_active_window): when using xinerama get the frame from the current screen. * src/split.c (set_frames_window): update the window's scr attribute to point to the frame's screen. (find_window_for_frame): when xinerama is being used search all windows. (set_active_frame): update rp_current_screen to point to the frame's screen. * src/screen.h (init_screens): new prototype (is_rp_window_for_screen): likewise * src/screen.c: include string.h and X11/cursorfont.h (init_screens): new function (is_rp_window_for_screen): new function. (init_screen): fill in xine_screen_num when using xinerama. * src/ratpoison.h: include xinerama.h * src/manage.c (current_screen): use xine_screen_num to find the current screen. (scanwins): use is_rp_window_for_screen to skip over ratpoison windows. (scanwins): when using xinerama only manage windows inside the viewable area. * src/main.c (main): call init_xinerama and init_screens. Move screen initing code to these functions. (init_rat_cursor): move to screen.c (init_screen): likewise (find_screen): likewise (clean_up): call free_xinerama * src/group.c (group_last_window): only check windows in the current screen, unless xinerama is being used in which case all windows are accessible. (group_next_window): likewise (group_prev_window): likewise * src/globals.h: new globals rp_have_xinerama, xine_screen_num. * src/events.c (new_window): when using xinerama, the new window's screen is the current screen. (key_press): when using xinerama, use the current screen. * src/data.h (struct rp_screen): remove root_attr and add left, top, width, height. All dependant code updated. Add xine_screen_num. * src/actions.c (cmd_remove): show the frame indicator in the new current frame after removing the frame. * src/Makefile.am (ratpoison_SOURCES): add xinerama.c and xinerama.h
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/split.c b/src/split.c
index 2dcd6ed..787c587 100644
--- a/src/split.c
+++ b/src/split.c
@@ -29,6 +29,8 @@
#define VERTICALLY 0
#define HORIZONTALLY 1
+static rp_screen *frames_screen(rp_frame *);
+
static void
update_last_access (rp_frame *frame)
{
@@ -81,8 +83,8 @@ cleanup_frame (rp_frame *frame)
#ifdef MAXSIZE_WINDOWS_ARE_TRANSIENTS
if (!win->transient
&& !(win->hints->flags & PMaxSize
- && win->hints->max_width < win->scr->root_attr.width
- && win->hints->max_height < win->scr->root_attr.height))
+ && win->hints->max_width < win->scr->width
+ && win->hints->max_height < win->scr->height))
#else
if (!win->transient)
#endif
@@ -99,6 +101,11 @@ set_frames_window (rp_frame *frame, rp_window *win)
{
frame->win_number = win->number;
win->frame_number = frame->number;
+
+ /* We need to make sure that win and frame are on the same screen,
+ * since with Xinerama, windows can move from one screen to another.
+ */
+ win->scr = frames_screen(frame);
}
else
{
@@ -272,7 +279,7 @@ find_window_for_frame (rp_frame *frame)
list_for_each_entry (cur, &rp_current_group->mapped_windows, node)
{
- if (cur->win->scr == s
+ if ((cur->win->scr == s || rp_have_xinerama)
&& cur->win != current_window()
&& !find_windows_frame (cur->win)
&& cur->win->last_access >= last_access
@@ -840,7 +847,7 @@ set_active_frame (rp_frame *frame)
s->current_frame = frame->number;
/* If frame->win == NULL, then rp_current_screen is not updated. */
- rp_current_screen = s->screen_num;
+ rp_current_screen = s->xine_screen_num;
update_bar (s);
@@ -913,9 +920,14 @@ show_frame_message (char *msg)
width = defaults.bar_x_padding * 2 + XTextWidth (defaults.font, msg, strlen (msg));
height = (FONT_HEIGHT (defaults.font) + defaults.bar_y_padding * 2);
+ /* We don't want another frame indicator to be displayed on another
+ * screen at the same time, so we hide it before bringing it back again.
+ */
+ hide_frame_indicator ();
+
XMoveResizeWindow (dpy, s->frame_window,
- frame->x + frame->width / 2 - width / 2,
- frame->y + frame->height / 2 - height / 2,
+ s->left + frame->x + frame->width / 2 - width / 2,
+ s->top + frame->y + frame->height / 2 - height / 2,
width, height);
XMapRaised (dpy, s->frame_window);