diff -ur ratpoison.backup/configure.in ratpoison/configure.in --- ratpoison.backup/configure.in 2003-11-03 11:17:59.000000000 +0800 +++ ratpoison/configure.in 2003-11-25 19:34:45.000000000 +0800 @@ -87,6 +87,11 @@ AC_CHECK_LIB(X11, XOpenDisplay,, AC_MSG_ERROR([*** Can't find libX11])) +AC_CHECK_HEADERS([X11/extensions/Xinerama.h]) +AC_CHECK_LIB(Xext, XMissingExtension, [LIBS="-lXext $LIBS"],, $CFLAGS $LDFLAGS) +AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [LIBS="-lXinerama $LIBS"],, $CFLAGS $LDFLAGS) + + dnl Check for electric fence library dnl AC_CHECK_LIB(efence,malloc,,) diff -ur ratpoison.backup/src/actions.c ratpoison/src/actions.c --- ratpoison.backup/src/actions.c 2003-11-18 13:06:35.000000000 +0800 +++ ratpoison/src/actions.c 2003-11-25 20:10:13.000000000 +0800 @@ -1792,7 +1792,7 @@ s = current_screen (); - XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width - 2, s->root_attr.height - 2); + XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->left + s->width - 2, s->top + s->height - 2); return NULL; } @@ -1854,8 +1854,8 @@ } /* Offset the text so its in the center. */ - x = (s->root_attr.width - max_width) / 2; - y = (s->root_attr.height - i * FONT_HEIGHT (defaults.font)) / 2; + x = s->left + (s->width - max_width) / 2; + y = s->top + (s->height - i * FONT_HEIGHT (defaults.font)) / 2; if (x < 0) x = 0; if (y < 0) y = 0; @@ -1967,7 +1967,7 @@ y += FONT_HEIGHT (defaults.font); /* Make sure the next line fits entirely within the window. */ - if (y + FONT_HEIGHT (defaults.font) >= s->root_attr.height) + if (y + FONT_HEIGHT (defaults.font) >= (s->top + s->height)) { if (drawing_keys) { @@ -2354,8 +2354,8 @@ frame->width += bk_pos - l; } - if (bk_pos + bk_len == current_screen()->root_attr.width - defaults.padding_right) - frame->width = current_screen()->root_attr.width - r - frame->x; + if ((bk_pos + bk_len) == (current_screen()->left + current_screen()->width - defaults.padding_right)) + frame->width = current_screen()->left + current_screen()->width - r - frame->x; /* Resize vertically. */ bk_pos = frame->y; @@ -2367,8 +2367,8 @@ frame->height += bk_pos - t; } - if (bk_pos + bk_len == current_screen()->root_attr.height - defaults.padding_bottom) - frame->height = current_screen()->root_attr.height - b - frame->y; + if ((bk_pos + bk_len) == (current_screen()->top + current_screen()->height - defaults.padding_bottom)) + frame->height = current_screen()->top + current_screen()->height - b - frame->y; maximize_all_windows_in_frame (frame); } @@ -2747,8 +2747,8 @@ if (current_window() == NULL) { marked_message_printf (0, 0, " (%d, %d) No window ", - current_screen()->root_attr.width, - current_screen()->root_attr.height); + current_screen()->width, + current_screen()->height); } else { diff -ur ratpoison.backup/src/bar.c ratpoison/src/bar.c --- ratpoison.backup/src/bar.c 2003-09-22 05:30:52.000000000 +0800 +++ ratpoison/src/bar.c 2003-11-25 20:12:56.000000000 +0800 @@ -96,17 +96,17 @@ case NorthWestGravity: case WestGravity: case SouthWestGravity: - x = 0; + x = s->left; break; case NorthGravity: case CenterGravity: case SouthGravity: - x = (s->root_attr.width - width - defaults.bar_border_width * 2) / 2; + x = s->left + (s->width - width - defaults.bar_border_width * 2) / 2; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: - x = s->root_attr.width - width - defaults.bar_border_width * 2; + x = s->left + s->width - width - defaults.bar_border_width * 2; break; } @@ -123,18 +123,18 @@ case NorthEastGravity: case NorthGravity: case NorthWestGravity: - y = 0; + y = s->top; break; case EastGravity: case CenterGravity: case WestGravity: - y = (s->root_attr.height - height + y = s->top + (s->height - height - defaults.bar_border_width * 2) / 2; break; case SouthEastGravity: case SouthGravity: case SouthWestGravity: - y = (s->root_attr.height - height + y = s->top + (s->height - height - defaults.bar_border_width * 2); break; } diff -ur ratpoison.backup/src/data.h ratpoison/src/data.h --- ratpoison.backup/src/data.h 2003-09-03 01:33:58.000000000 +0800 +++ ratpoison/src/data.h 2003-11-25 20:40:01.000000000 +0800 @@ -137,14 +137,17 @@ struct rp_screen { GC normal_gc; - XWindowAttributes root_attr; Window root, bar_window, key_window, input_window, frame_window, help_window; int bar_is_raised; int screen_num; /* Our screen number as dictated my X */ + int xine_screen_num; /* Our screen number for the Xinerama extension */ Colormap def_cmap; Cursor rat; unsigned long fg_color, bg_color; /* The pixel color. */ - + + /* Here to abstract over the Xinerama vs X screens difference */ + int left, top, width, height; + char *display_string; /* A list of frames that may or may not contain windows. There should diff -ur ratpoison.backup/src/events.c ratpoison/src/events.c --- ratpoison.backup/src/events.c 2003-11-18 13:06:35.000000000 +0800 +++ ratpoison/src/events.c 2003-11-25 21:47:07.000000000 +0800 @@ -50,9 +50,22 @@ if (e->override_redirect) return; - s = find_screen (e->parent); win = find_window (e->window); + /* In Xinerama mode, all windows have the same root, so check + * all Xinerama screens + */ + if (rp_have_xinerama) + { + /* New windows belong to the current screen */ + s = &screens[rp_current_screen]; + } + else + { + s = find_screen (e->parent); + } + if (is_rp_window_for_screen(e->window, s)) return; + if (s && win == NULL && e->window != s->key_window && e->window != s->bar_window @@ -376,10 +389,13 @@ unsigned int modifier; KeySym ks; - s = find_screen (ev->xkey.root); + if (rp_have_xinerama) + s = current_screen(); + else + s = find_screen (ev->xkey.root); #ifdef HIDE_MOUSE - XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width - 2, s->root_attr.height - 2); + XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->left + s->width - 2, s->top + s->height - 2); #endif if (!s) return; @@ -825,3 +841,4 @@ } } } + diff -ur ratpoison.backup/src/globals.h ratpoison/src/globals.h --- ratpoison.backup/src/globals.h 2003-10-16 06:26:19.000000000 +0800 +++ ratpoison/src/globals.h 2003-11-25 19:13:21.000000000 +0800 @@ -141,4 +141,7 @@ void set_rp_window_focus (rp_window *win); void set_window_focus (Window window); +extern int rp_have_xinerama; +extern int xine_screen_count; + #endif diff -ur ratpoison.backup/src/main.c ratpoison/src/main.c --- ratpoison.backup/src/main.c 2003-11-18 13:06:35.000000000 +0800 +++ ratpoison/src/main.c 2003-11-25 19:04:10.000000000 +0800 @@ -44,8 +44,6 @@ # define WAIT_ANY -1 #endif -static void init_screen (rp_screen *s, int screen_num); - /* Command line options */ static struct option ratpoison_longopts[] = { {"help", no_argument, 0, 'h'}, @@ -598,38 +596,8 @@ init_defaults (); init_groups (); init_window_stuff (); - - /* Get the number of screens */ - num_screens = ScreenCount (dpy); - - /* make sure the screen specified is valid. */ - if (screen_arg) - { - if (screen_num < 0 || screen_num >= num_screens) - { - fprintf (stderr, "%d is an invalid screen for the display\n", screen_num); - exit (EXIT_FAILURE); - } - - /* we're only going to use one screen. */ - num_screens = 1; - } - - /* Initialize the screens */ - screens = (rp_screen *)xmalloc (sizeof (rp_screen) * num_screens); - PRINT_DEBUG (("%d screens.\n", num_screens)); - - if (screen_arg) - { - init_screen (&screens[0], screen_num); - } - else - { - for (i=0; irat = XCreateFontCursor( dpy, XC_icon ); -} - -static void -init_screen (rp_screen *s, int screen_num) -{ - XGCValues gv; - - /* Select on some events on the root window, if this fails, then - there is already a WM running and the X Error handler will catch - it, terminating ratpoison. */ - XSelectInput(dpy, RootWindow (dpy, screen_num), - PropertyChangeMask | ColormapChangeMask - | SubstructureRedirectMask | SubstructureNotifyMask ); - XSync (dpy, False); - - /* Create the numset for the frames. */ - s->frames_numset = numset_new (); - - /* Build the display string for each screen */ - s->display_string = xmalloc (strlen(DisplayString (dpy)) + 21); - sprintf (s->display_string, "DISPLAY=%s", DisplayString (dpy)); - if (strrchr (DisplayString (dpy), ':')) - { - char *dot; - - dot = strrchr(s->display_string, '.'); - if (dot) - sprintf(dot, ".%i", screen_num); - } - - PRINT_DEBUG (("%s\n", s->display_string)); - - s->screen_num = screen_num; - s->root = RootWindow (dpy, screen_num); - s->def_cmap = DefaultColormap (dpy, screen_num); - XGetWindowAttributes (dpy, s->root, &s->root_attr); - - init_rat_cursor (s); - - s->fg_color = BlackPixel (dpy, s->screen_num); - s->bg_color = WhitePixel (dpy, s->screen_num); - - /* Setup the GC for drawing the font. */ - gv.foreground = s->fg_color; - gv.background = s->bg_color; - gv.function = GXcopy; - gv.line_width = 1; - gv.subwindow_mode = IncludeInferiors; - gv.font = defaults.font->fid; - s->normal_gc = XCreateGC(dpy, s->root, - GCForeground | GCBackground | GCFunction - | GCLineWidth | GCSubwindowMode | GCFont, - &gv); - - /* Create the program bar window. */ - s->bar_is_raised = 0; - s->bar_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, - defaults.bar_border_width, - s->fg_color, s->bg_color); - - /* Setup the window that will recieve all keystrokes once the prefix - key has been pressed. */ - s->key_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, 0, - WhitePixel (dpy, s->screen_num), - BlackPixel (dpy, s->screen_num)); - XSelectInput (dpy, s->key_window, KeyPressMask | KeyReleaseMask); - XMapWindow (dpy, s->key_window); - - /* Create the input window. */ - s->input_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, - defaults.bar_border_width, - s->fg_color, s->bg_color); - XSelectInput (dpy, s->input_window, KeyPressMask | KeyReleaseMask); - - /* Create the frame indicator window */ - s->frame_window = XCreateSimpleWindow (dpy, s->root, 1, 1, 1, 1, defaults.bar_border_width, - s->fg_color, s->bg_color); - - /* Create the help window */ - s->help_window = XCreateSimpleWindow (dpy, s->root, 0, 0, s->root_attr.width, - s->root_attr.height, 0, s->fg_color, s->bg_color); - XSelectInput (dpy, s->help_window, KeyPressMask); - - XSync (dpy, 0); -} - -static void free_screen (rp_screen *s) { rp_frame *frame; @@ -806,6 +684,8 @@ } free (screens); + free_xinerama(); + XFreeFont (dpy, defaults.font); free (defaults.window_fmt); @@ -813,14 +693,3 @@ XCloseDisplay (dpy); } -/* Given a root window, return the rp_screen struct */ -rp_screen * -find_screen (Window w) -{ - int i; - - for (i=0; ibar_window - || wins[i] == s->key_window - || wins[i] == s->input_window - || wins[i] == s->frame_window - || wins[i] == s->help_window + if (is_rp_window_for_screen(wins[i], s) || attr.override_redirect == True || unmanaged_window (wins[i])) continue; + /* FIXME - with this code, windows which are entirely off-screen + * when RP starts won't ever be managed when Xinerama is enabled. + */ + if (rp_have_xinerama + && ((attr.x > s->left + s->width) + || (attr.x < s->left) + || (attr.y > s->top + s->height) + || (attr.y < s->top))) continue; + win = add_to_window_list (s, wins[i]); PRINT_DEBUG (("map_state: %s\n", @@ -671,7 +676,7 @@ /* Actually do the maximizing. */ - XMoveResizeWindow (dpy, win->w, win->x, win->y, win->width, win->height); + XMoveResizeWindow (dpy, win->w, win->scr->left + win->x, win->scr->top + win->y, win->width, win->height); XSetWindowBorderWidth (dpy, win->w, win->border); XSync (dpy, False); @@ -696,7 +701,7 @@ problem. */ if (win->hints->flags & PResizeInc) { - XMoveResizeWindow (dpy, win->w, win->x, win->y, + XMoveResizeWindow (dpy, win->w, win->scr->left + win->x, win->scr->top + win->y, win->width + win->hints->width_inc, win->height + win->hints->height_inc); } @@ -708,7 +713,7 @@ XSync (dpy, False); /* Resize the window to its proper maximum size. */ - XMoveResizeWindow (dpy, win->w, win->x, win->y, win->width, win->height); + XMoveResizeWindow (dpy, win->w, win->scr->left + win->x, win->scr->top + win->y, win->width, win->height); XSetWindowBorderWidth (dpy, win->w, win->border); XSync (dpy, False); diff -ur ratpoison.backup/src/ratpoison.h ratpoison/src/ratpoison.h --- ratpoison.backup/src/ratpoison.h 2003-11-18 13:06:35.000000000 +0800 +++ ratpoison/src/ratpoison.h 2003-11-25 22:24:52.000000000 +0800 @@ -84,6 +84,7 @@ #endif /* HAVE_READLINE_HISTORY_H */ #include "completions.h" #include "hook.h" +#include "xinerama.h" void clean_up (); rp_screen *find_screen (Window w); diff -ur ratpoison.backup/src/screen.c ratpoison/src/screen.c --- ratpoison.backup/src/screen.c 2003-05-25 18:56:20.000000000 +0800 +++ ratpoison/src/screen.c 2003-11-25 21:45:57.000000000 +0800 @@ -19,23 +19,27 @@ */ #include "ratpoison.h" +#include +#include + +static void init_screen (rp_screen *s, int screen_num); int screen_width (rp_screen *s) { - return DisplayWidth (dpy, s->screen_num) - defaults.padding_right - defaults.padding_left; + return s->width - defaults.padding_right - defaults.padding_left; } int screen_height (rp_screen *s) { - return DisplayHeight (dpy, s->screen_num) - defaults.padding_bottom - defaults.padding_top; + return s->height - defaults.padding_bottom - defaults.padding_top; } int screen_left (rp_screen *s) { - return defaults.padding_left; + return s->left + defaults.padding_left; } int @@ -47,7 +51,7 @@ int screen_top (rp_screen *s) { - return defaults.padding_top; + return s->top + defaults.padding_top; } int @@ -116,3 +120,210 @@ return NULL; } + +/* Given a root window, return the rp_screen struct */ +rp_screen * +find_screen (Window w) +{ + int i; + + for (i=0; i= num_screens) + { + fprintf (stderr, "%d is an invalid screen for the display\n", screen_num); + exit (EXIT_FAILURE); + } + + /* we're only going to use one screen. */ + num_screens = 1; + } + + /* Initialize the screens */ + screens = (rp_screen *)xmalloc (sizeof (rp_screen) * num_screens); + PRINT_DEBUG (("%d screens.\n", num_screens)); + + if (screen_arg) + { + init_screen (&screens[0], screen_num); + } + else + { + for (i=0; irat = XCreateFontCursor( dpy, XC_icon ); +} + +static void +init_screen (rp_screen *s, int screen_num) +{ + XGCValues gv; + int xine_screen_num; + + /* We use screen_num below to refer to the real X screen number, but + * if we're using Xinerama, it will only be the Xinerama logical screen + * number. So we shuffle it away and replace it with the real one now, + * to cause confusion. -- CP + */ + if (rp_have_xinerama) + { + xine_screen_num = screen_num; + screen_num = DefaultScreen(dpy); + xinerama_get_screen_info(xine_screen_num, + &s->left, &s->top, &s->width, &s->height); + } + else + { + xine_screen_num = screen_num; + s->left = 0; + s->top = 0; + s->width = DisplayWidth(dpy, screen_num); + s->height = DisplayHeight(dpy, screen_num); + } + + /* Select on some events on the root window, if this fails, then + there is already a WM running and the X Error handler will catch + it, terminating ratpoison. */ + XSelectInput(dpy, RootWindow (dpy, screen_num), + PropertyChangeMask | ColormapChangeMask + | SubstructureRedirectMask | SubstructureNotifyMask ); + XSync (dpy, False); + + /* Create the numset for the frames. */ + s->frames_numset = numset_new (); + + /* Build the display string for each screen */ + s->display_string = xmalloc (strlen(DisplayString (dpy)) + 21); + sprintf (s->display_string, "DISPLAY=%s", DisplayString (dpy)); + if (strrchr (DisplayString (dpy), ':')) + { + char *dot; + + dot = strrchr(s->display_string, '.'); + if (dot) + sprintf(dot, ".%i", screen_num); + } + + PRINT_DEBUG (("%s\n", s->display_string)); + + s->screen_num = screen_num; + s->xine_screen_num = xine_screen_num; + s->root = RootWindow (dpy, screen_num); + s->def_cmap = DefaultColormap (dpy, screen_num); + + init_rat_cursor (s); + + s->fg_color = BlackPixel (dpy, s->screen_num); + s->bg_color = WhitePixel (dpy, s->screen_num); + + /* Setup the GC for drawing the font. */ + gv.foreground = s->fg_color; + gv.background = s->bg_color; + gv.function = GXcopy; + gv.line_width = 1; + gv.subwindow_mode = IncludeInferiors; + gv.font = defaults.font->fid; + s->normal_gc = XCreateGC(dpy, s->root, + GCForeground | GCBackground | GCFunction + | GCLineWidth | GCSubwindowMode | GCFont, + &gv); + + /* Create the program bar window. */ + s->bar_is_raised = 0; + s->bar_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, + defaults.bar_border_width, + s->fg_color, s->bg_color); + + /* Setup the window that will recieve all keystrokes once the prefix + key has been pressed. */ + s->key_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, 0, + WhitePixel (dpy, s->screen_num), + BlackPixel (dpy, s->screen_num)); + XSelectInput (dpy, s->key_window, KeyPressMask | KeyReleaseMask); + XMapWindow (dpy, s->key_window); + + /* Create the input window. */ + s->input_window = XCreateSimpleWindow (dpy, s->root, 0, 0, 1, 1, + defaults.bar_border_width, + s->fg_color, s->bg_color); + XSelectInput (dpy, s->input_window, KeyPressMask | KeyReleaseMask); + + /* Create the frame indicator window */ + s->frame_window = XCreateSimpleWindow (dpy, s->root, 1, 1, 1, 1, defaults.bar_border_width, + s->fg_color, s->bg_color); + + /* Create the help window */ + s->help_window = XCreateSimpleWindow (dpy, s->root, s->left, s->top, s->width, + s->height, 0, s->fg_color, s->bg_color); + XSelectInput (dpy, s->help_window, KeyPressMask); + + XSync (dpy, 0); +} + +static int +is_rp_window_for_given_screen (Window w, rp_screen *s) +{ + if (w != s->key_window && + w != s->bar_window && + w != s->input_window && + w != s->frame_window && + w != s->help_window) + return 0; + return 1; +} + +int +is_rp_window_for_screen(Window w, rp_screen *s) +{ + int i; + + if (rp_have_xinerama) + { + for (i=0; itransient && !(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 @@ -840,7 +840,7 @@ 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); @@ -911,8 +911,8 @@ height = (FONT_HEIGHT (defaults.font) + defaults.bar_y_padding * 2); 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); diff -ur ratpoison.backup/src/window.c ratpoison/src/window.c --- ratpoison.backup/src/window.c 2003-08-30 05:17:43.000000000 +0800 +++ ratpoison/src/window.c 2003-11-25 21:34:09.000000000 +0800 @@ -344,7 +344,7 @@ XInstallColormap (dpy, win->colormap); /* Finally, give the window focus */ - rp_current_screen = win->scr->screen_num; + rp_current_screen = win->scr->xine_screen_num; set_rp_window_focus (win); XSync (dpy, False); @@ -481,8 +481,8 @@ #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 diff -ur ratpoison.backup/src/xinerama.c ratpoison/src/xinerama.c --- ratpoison.backup/src/xinerama.c 2003-11-25 22:26:46.000000000 +0800 +++ ratpoison/src/xinerama.c 2003-11-25 20:17:20.000000000 +0800 @@ -0,0 +1,94 @@ +/* functions for grabbing information about Xinerama screens + * Copyright (C) 2003 Cameron Patrick + * + * This file is part of ratpoison. + * + * ratpoison is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * ratpoison is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + */ + +#include "ratpoison.h" + +#ifdef HAVE_X11_EXTENSIONS_XINERAMA_H +# include +# define XINERAMA +#endif + +int rp_have_xinerama = 0; +int xine_screen_count; + +#ifdef XINERAMA +static XineramaScreenInfo *xine_screens; +#endif + +void +init_xinerama() +{ + int evbase, errbase, major, minor; + + rp_have_xinerama = 0; + +#ifdef XINERAMA + if (!XineramaQueryExtension(dpy, &evbase, &errbase)) { + return; + } + + if (!XineramaQueryVersion(dpy, &major, &minor) != Success) { + return; + } + + if (major != 1) { + printf ("Xinerama version %d.%d not supported\n", major, minor); + return; + } + + printf ("Detected xinerama extension %d.%d; evbase=%d errbase=%d\n", major, minor, evbase, errbase); + + if (!XineramaIsActive(dpy)) { + return; + } + + xine_screens = XineramaQueryScreens(dpy, &xine_screen_count); + if ((xine_screens == NULL) || (xine_screen_count < 2)) { + return; + } + + rp_have_xinerama = 1; +#endif +} + +void xinerama_get_screen_info(int sc, int *x, int *y, int *w, int *h) +{ +#ifdef XINERAMA + if ((sc < xine_screen_count) && (sc >= 0)) { + *x = xine_screens[sc].x_org; + *y = xine_screens[sc].y_org; + *w = xine_screens[sc].width; + *h = xine_screens[sc].height; + } +#endif +} + +void +free_xinerama() +{ +#ifdef XINERAMA + if (rp_have_xinerama) { + XFree(xine_screens); + } + rp_have_xinerama = 0; +#endif +} + diff -ur ratpoison.backup/src/xinerama.h ratpoison/src/xinerama.h --- ratpoison.backup/src/xinerama.h 2003-11-25 22:26:47.000000000 +0800 +++ ratpoison/src/xinerama.h 2003-11-25 19:14:10.000000000 +0800 @@ -0,0 +1,28 @@ +/* Copyright (C) 2003 Cameron Patrick + * + * This file is part of ratpoison. + * + * ratpoison is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * ratpoison is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + */ + +#ifndef XINERAMA_H +#define XINERAMA_H + +void init_xinerama(); +void free_xinerama(); +void xinerama_get_screen_info(int sc, int *x, int *y, int *w, int *h); + +#endif