From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 1 Sep 2019 00:00:32 +0200 Subject: Initial import --- .../files/rdesktop-1.6.0-smartcard_configure.patch | 22 +++ .../files/rdesktop-1.6.0-sound_configure.patch | 15 ++ .../files/rdesktop-1.7.0-libao_crash.patch | 18 ++ .../files/rdesktop-1.8.3-xrandr_configure.patch | 17 ++ net-misc/rdesktop/files/rdesktop-keymap-additional | 64 ++++++++ net-misc/rdesktop/files/rdesktop-keymap-cs | 122 ++++++++++++++ net-misc/rdesktop/files/rdesktop-keymap-sk | 124 ++++++++++++++ net-misc/rdesktop/files/rdesktop-xinerama.patch | 180 ++++++++++++++++++++ .../rdesktop/files/rdesktop171-ds-xinerama.patch | 181 +++++++++++++++++++++ 9 files changed, 743 insertions(+) create mode 100644 net-misc/rdesktop/files/rdesktop-1.6.0-smartcard_configure.patch create mode 100644 net-misc/rdesktop/files/rdesktop-1.6.0-sound_configure.patch create mode 100644 net-misc/rdesktop/files/rdesktop-1.7.0-libao_crash.patch create mode 100644 net-misc/rdesktop/files/rdesktop-1.8.3-xrandr_configure.patch create mode 100644 net-misc/rdesktop/files/rdesktop-keymap-additional create mode 100644 net-misc/rdesktop/files/rdesktop-keymap-cs create mode 100644 net-misc/rdesktop/files/rdesktop-keymap-sk create mode 100644 net-misc/rdesktop/files/rdesktop-xinerama.patch create mode 100644 net-misc/rdesktop/files/rdesktop171-ds-xinerama.patch (limited to 'net-misc/rdesktop/files') diff --git a/net-misc/rdesktop/files/rdesktop-1.6.0-smartcard_configure.patch b/net-misc/rdesktop/files/rdesktop-1.6.0-smartcard_configure.patch new file mode 100644 index 0000000..a237966 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-1.6.0-smartcard_configure.patch @@ -0,0 +1,22 @@ +--- configure.ac.orig 2009-07-05 16:13:23.000000000 +0200 ++++ configure.ac 2009-07-05 16:19:39.000000000 +0200 +@@ -108,7 +108,10 @@ + AC_ARG_ENABLE(smartcard, + [ --enable-smartcard Enables smart-card support. + ], +- [ ++ [ ++ if test "$enableval" = no; then ++ WITH_SCARD=0 ++ else + case "$OSTYPE" in + darwin*) + AC_CHECK_HEADER(PCSC/pcsclite.h, [WITH_SCARD=1], [WITH_SCARD=0]) +@@ -143,6 +146,7 @@ + [AC_MSG_RESULT(yes) AC_DEFINE(WITH_PCSC120, 1, [old version of PCSC])], + [AC_MSG_RESULT(no)] + ) ++ fi + ]) + + AC_SUBST(SCARDOBJ) diff --git a/net-misc/rdesktop/files/rdesktop-1.6.0-sound_configure.patch b/net-misc/rdesktop/files/rdesktop-1.6.0-sound_configure.patch new file mode 100644 index 0000000..8e64ba8 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-1.6.0-sound_configure.patch @@ -0,0 +1,15 @@ +--- configure.ac.orig 2009-06-30 10:35:14.000000000 +0200 ++++ configure.ac 2009-06-30 11:35:10.000000000 +0200 +@@ -228,7 +228,11 @@ + if test -n "$PKG_CONFIG"; then + PKG_CHECK_MODULES(LIBAO, ao, [HAVE_LIBAO=1], [HAVE_LIBAO=0]) + PKG_CHECK_MODULES(ALSA, alsa, [HAVE_ALSA=1], [HAVE_ALSA=0]) +- PKG_CHECK_MODULES(LIBSAMPLERATE, samplerate, [HAVE_LIBSAMPLERATE=1], [HAVE_LIBSAMPLERATE=0]) ++ AC_ARG_WITH(libsamplerate, ++ [ --without-libsamplerate disable libsamplerate support]) ++ if test "x$with_libsamplerate" != "xno"; then ++ PKG_CHECK_MODULES(LIBSAMPLERATE, samplerate, [HAVE_LIBSAMPLERATE=1], [HAVE_LIBSAMPLERATE=0]) ++ fi + if test x"$HAVE_LIBSAMPLERATE" = "x1"; then + AC_DEFINE(HAVE_LIBSAMPLERATE) + if test x"$static_libsamplerate" = "xyes"; then diff --git a/net-misc/rdesktop/files/rdesktop-1.7.0-libao_crash.patch b/net-misc/rdesktop/files/rdesktop-1.7.0-libao_crash.patch new file mode 100644 index 0000000..3afb9b2 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-1.7.0-libao_crash.patch @@ -0,0 +1,18 @@ +--- rdpsnd_libao.c.orig 2010-11-29 14:55:31.124907038 +0100 ++++ rdpsnd_libao.c 2010-11-29 14:55:51.708464083 +0100 +@@ -76,6 +76,7 @@ + format.channels = 2; + format.rate = 44100; + format.byte_format = AO_FMT_NATIVE; ++ format.matrix = NULL; + + + o_device = ao_open_live(default_driver, &format, NULL); +@@ -115,6 +116,7 @@ + format.channels = pwfx->nChannels; + format.rate = 44100; + format.byte_format = AO_FMT_NATIVE; ++ format.matrix = NULL; + + if (o_device != NULL) + ao_close(o_device); diff --git a/net-misc/rdesktop/files/rdesktop-1.8.3-xrandr_configure.patch b/net-misc/rdesktop/files/rdesktop-1.8.3-xrandr_configure.patch new file mode 100644 index 0000000..f57a86b --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-1.8.3-xrandr_configure.patch @@ -0,0 +1,17 @@ +--- configure.ac.orig 2015-09-14 11:27:54.974472081 +0200 ++++ configure.ac 2015-09-14 11:34:37.729155044 +0200 +@@ -151,9 +151,12 @@ + AC_SUBST(CREDSSPOBJ) + + # xrandr +-if test -n "$PKG_CONFIG"; then +- PKG_CHECK_MODULES(XRANDR, xrandr, [HAVE_XRANDR=1], [HAVE_XRANDR=0]) ++AC_ARG_WITH([xrandr], AS_HELP_STRING([--without-xrandr], [Build without Xrandr library (default: true)])) ++AS_IF([test "x$with_xrandr" != "xno"], [ ++ if test -n "$PKG_CONFIG"; then ++ PKG_CHECK_MODULES(XRANDR, xrandr, [HAVE_XRANDR=1], [HAVE_XRANDR=0]) + fi ++]) + if test x"$HAVE_XRANDR" = "x1"; then + CFLAGS="$CFLAGS $XRANDR_CFLAGS" + LIBS="$LIBS $XRANDR_LIBS" diff --git a/net-misc/rdesktop/files/rdesktop-keymap-additional b/net-misc/rdesktop/files/rdesktop-keymap-additional new file mode 100644 index 0000000..04a03a5 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-keymap-additional @@ -0,0 +1,64 @@ +#Additional sequences +#2007-05-28 by Jaroslav Jiricka + +sequence ecaron dead_caron e +sequence Ecaron dead_caron E +sequence eogonek dead_ogonek e +sequence Eogonek dead_ogonek E + +sequence rcaron dead_caron r +sequence Rcaron dead_caron R +sequence racute dead_acute r +sequence Racute dead_acute R + +sequence tcaron dead_caron t +sequence Tcaron dead_caron T +sequence tcedilla dead_cedilla t +sequence Tcedilla dead_cedilla T + +sequence zcaron dead_caron z +sequence Zcaron dead_caron Z +sequence zacute dead_acute z +sequence Zacute dead_acute Z +sequence zabovedot dead_abovedot z +sequence Zabovedot dead_abovedot Z + +sequence uring dead_abovering u +sequence Uring dead_abovering U +sequence udoubleacute dead_doubleacute u +sequence Udoubleacute dead_doubleacute U + +sequence odoubleacute dead_doubleacute o +sequence Odoubleacute dead_doubleacute O + +sequence aogonek dead_ogonek a +sequence Aogonek dead_ogonek A +sequence abreve dead_breve a +sequence Abreve dead_breve A + +sequence scaron dead_caron s +sequence Scaron dead_caron S +sequence sacute dead_acute s +sequence Sacute dead_acute S +sequence scedilla dead_cedilla s +sequence Scedilla dead_cedilla S + +sequence dcaron dead_caron d +sequence Dcaron dead_caron D + +sequence gbreve dead_breve g +sequence Gbreve dead_breve G + +sequence lcaron dead_caron l +sequence Lcaron dead_caron L +sequence lacute dead_acute l +sequence Lacute dead_acute L + +sequence ccaron dead_caron c +sequence Ccaron dead_caron C + +sequence ncaron dead_caron n +sequence Ncaron dead_caron N +sequence nacute dead_acute n +sequence Nacute dead_acute N + diff --git a/net-misc/rdesktop/files/rdesktop-keymap-cs b/net-misc/rdesktop/files/rdesktop-keymap-cs new file mode 100644 index 0000000..0467628 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-keymap-cs @@ -0,0 +1,122 @@ +#Czech keymap +#2007-05-28 by Jaroslav Jiricka +include common +include additional +map 0x405 + +semicolon 0x29 +dead_abovering 0x29 shift + +plus 0x02 +1 0x02 shift +dead_tilde 0x02 altgr +asciitilde 0x02 altgr + +ecaron 0x03 +2 0x03 shift +dead_caron 0x03 altgr + +scaron 0x04 +3 0x04 shift +dead_circumflex 0x04 altgr + +ccaron 0x05 +4 0x05 shift +dead_breve 0x05 altgr + +rcaron 0x06 +5 0x06 shift +dead_abovering 0x06 altgr + +zcaron 0x07 +6 0x07 shift +dead_ogonek 0x07 altgr + +yacute 0x08 +7 0x08 shift +dead_grave 0x08 altgr + +aacute 0x09 +8 0x09 shift +dead_abovedot 0x08 altgr + +iacute 0x0a +9 0x0a shift +dead_acute 0x08 altgr + +eacute 0x0b +0 0x0b shift +dead_doubleacute 0x0b altgr + +equal 0x0c +percent 0x0c shift +dead_macron 0x0c altgr + +dead_acute 0x0d +dead_caron 0x0d shift +dead_cedilla 0x0d altgr + +backslash 0x10 altgr + +bar 0x11 altgr + +EuroSign 0x12 altgr + +z 0x15 addupper + +uacute 0x1a +slash 0x1a shift +division 0x1a altgr + +parenright 0x1b +parenleft 0x1b shift +multiply 0x1b altgr + +dead_diaeresis 0x2b +apostrophe 0x2b shift +currency 0x2b altgr + +dstroke 0x1f altgr + +Dstroke 0x20 altgr + +bracketleft 0x21 altgr + +bracketright 0x22 altgr + +lstroke 0x25 altgr + +Lstroke 0x26 altgr + +uring 0x27 +quotedbl 0x27 shift +dollar 0x27 altgr + +section 0x28 +exclam 0x28 shift +ssharp 0x28 altgr + +y 0x2c addupper + +numbersign 0x2d altgr + +ampersand 0x2e altgr + +at 0x2f altgr + +braceleft 0x30 altgr + +braceright 0x31 altgr + +comma 0x33 +question 0x33 shift +less 0x33 altgr + +period 0x34 +colon 0x34 shift +greater 0x34 altgr + +minus 0x35 +underscore 0x35 shift +asterisk 0x35 altgr + diff --git a/net-misc/rdesktop/files/rdesktop-keymap-sk b/net-misc/rdesktop/files/rdesktop-keymap-sk new file mode 100644 index 0000000..afa1a3b --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-keymap-sk @@ -0,0 +1,124 @@ +#Slovak keymap +#2007-05-28 by Jaroslav Jiricka +include common +include additional +map 0x41B + +semicolon 0x29 +dead_abovering 0x29 shift + +plus 0x02 +1 0x02 shift +dead_tilde 0x02 altgr +asciitilde 0x02 altgr + +lcaron 0x03 +2 0x03 shift +dead_caron 0x03 altgr + +scaron 0x04 +3 0x04 shift +dead_circumflex 0x04 altgr + +ccaron 0x05 +4 0x05 shift +dead_breve 0x05 altgr + +tcaron 0x06 +5 0x06 shift +dead_abovering 0x06 altgr + +zcaron 0x07 +6 0x07 shift +dead_ogonek 0x07 altgr + +yacute 0x08 +7 0x08 shift +dead_grave 0x08 altgr + +aacute 0x09 +8 0x09 shift +dead_abovedot 0x08 altgr + +iacute 0x0a +9 0x0a shift +dead_acute 0x08 altgr + +eacute 0x0b +0 0x0b shift +dead_doubleacute 0x0b altgr + +equal 0x0c +percent 0x0c shift +dead_diaeresis 0x0c altgr + +dead_acute 0x0d +dead_caron 0x0d shift +dead_cedilla 0x0d altgr + +backslash 0x10 altgr + +bar 0x11 altgr + +EuroSign 0x12 altgr + +z 0x15 addupper + +apostrophe 0x19 altgr + +uacute 0x1a +slash 0x1a shift +division 0x1a altgr + +adiaeresis 0x1b +parenleft 0x1b shift +multiply 0x1b altgr + +ncaron 0x2b +parenright 0x2b shift +currency 0x2b altgr + +dstroke 0x1f altgr + +Dstroke 0x20 altgr + +bracketleft 0x21 altgr + +bracketright 0x22 altgr + +lstroke 0x25 altgr + +Lstroke 0x26 altgr + +ocircumflex 0x27 +quotedbl 0x27 shift +dollar 0x27 altgr + +section 0x28 +exclam 0x28 shift +ssharp 0x28 altgr + +y 0x2c addupper + +numbersign 0x2d altgr + +ampersand 0x2e altgr + +at 0x2f altgr + +braceleft 0x30 altgr + +braceright 0x31 altgr + +comma 0x33 +question 0x33 shift +less 0x33 altgr + +period 0x34 +colon 0x34 shift +greater 0x34 altgr + +minus 0x35 +underscore 0x35 shift +asterisk 0x35 altgr + diff --git a/net-misc/rdesktop/files/rdesktop-xinerama.patch b/net-misc/rdesktop/files/rdesktop-xinerama.patch new file mode 100644 index 0000000..3421cc5 --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop-xinerama.patch @@ -0,0 +1,180 @@ +--- configure.ac.orig 2008-06-25 23:22:27.000000000 +0200 ++++ configure.ac 2008-06-25 23:17:51.000000000 +0200 +@@ -18,6 +18,8 @@ + AC_SEARCH_LIBS(socket, socket) + AC_SEARCH_LIBS(inet_aton, resolv) + ++AC_CHECK_LIB(Xinerama, XineramaQueryScreens, AC_DEFINE(HAVE_XINERAMA) LIBS="$LIBS -lXinerama", [], []) ++ + AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H)) + AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H)) + AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H)) +--- xwin.c.orig 2008-06-25 23:50:02.000000000 +0200 ++++ xwin.c 2008-06-25 23:49:25.000000000 +0200 +@@ -21,6 +21,9 @@ + + #include + #include ++#ifdef HAVE_XINERAMA ++ #include ++#endif + #include + #include + #include +@@ -570,6 +573,71 @@ + #define LOUT24(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; } + #define LOUT32(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; *(o++) = x >> 24; } + ++#ifdef HAVE_XINERAMA ++// IF XINERAMA LIBRARY ++ ++int g_last_wnd_pos_x; ++int g_last_wnd_pos_y; ++ ++void ++ScreenSize(XRectangle *screen) ++{ ++ int screens; ++ int event_base; ++ int error_base; ++ ++ if (XineramaQueryExtension(g_display, &event_base, &error_base)) ++ { ++ XineramaScreenInfo *screeninfo; ++ int i; ++ ++ /* Get the Xinerama screen infomation. */ ++ screeninfo = XineramaQueryScreens(g_display, &screens); ++ ++ /* Search for the appropriate screen. */ ++ i = 0; ++ while (!(screeninfo[i].x_org <= g_last_wnd_pos_x ++ && screeninfo[i].y_org <= g_last_wnd_pos_y ++ && screeninfo[i].x_org + screeninfo[i].width >= g_last_wnd_pos_x ++ && screeninfo[i].y_org + screeninfo[i].height >= g_last_wnd_pos_y )) ++ { ++ i++; ++ } ++ if (i >= screens) i = 0; ++ ++ /* Position according to the present screen. */ ++ screen->x = screeninfo[i].x_org; ++ screen->y = screeninfo[i].y_org; ++ screen->width = screeninfo[i].width; ++ screen->height = screeninfo[i].height; ++ ++ /* Free allocated memory. */ ++ XFree(screeninfo); ++ } ++ else ++ { ++ /* Xinerama is not in use, default to the XLib screensize call. */ ++ screen->x = 0; ++ screen->y = 0; ++ screen->width = WidthOfScreen(g_screen); ++ screen->height = HeightOfScreen(g_screen); ++ } ++} ++ ++#else ++// IF NO XINERAMA LIBRARY ++ ++void ++ScreenSize(XRectangle *screen) ++{ ++ screen->x = 0; ++ screen->y = 0; ++ screen->width = WidthOfScreen(g_screen); ++ screen->height = HeightOfScreen(g_screen); ++} ++ ++#endif ++ + static uint32 + translate_colour(uint32 colour) + { +@@ -1615,17 +1683,26 @@ + */ + if (g_fullscreen) + { +- g_width = WidthOfScreen(g_screen); +- g_height = HeightOfScreen(g_screen); ++ XRectangle screen; ++ ScreenSize(&screen); ++ ++ g_width = screen.width; ++ g_height = screen.height; + g_using_full_workarea = True; + } + else if (g_width < 0) + { ++ XRectangle screen; ++ ScreenSize(&screen); ++ ++ g_width = screen.width; ++ g_height = screen.height; ++ + /* Percent of screen */ + if (-g_width >= 100) + g_using_full_workarea = True; +- g_height = HeightOfScreen(g_screen) * (-g_width) / 100; +- g_width = WidthOfScreen(g_screen) * (-g_width) / 100; ++ g_width = screen.width * (-g_width) / 100; ++ g_height = screen.height * (-g_width) / 100; + } + else if (g_width == 0) + { +@@ -1734,14 +1811,19 @@ + long input_mask, ic_input_mask; + XEvent xevent; + +- wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; +- wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; ++ XRectangle screen; ++ ++ ScreenSize(&screen); ++ wndwidth = g_fullscreen ? screen.width : g_width; ++ wndheight = g_fullscreen ? screen.height : g_height; ++ g_xpos = g_fullscreen ? screen.x : g_xpos; ++ g_ypos = g_fullscreen ? screen.y : g_ypos; + + /* Handle -x-y portion of geometry string */ + if (g_xpos < 0 || (g_xpos == 0 && (g_pos & 2))) +- g_xpos = WidthOfScreen(g_screen) + g_xpos - g_width; ++ g_xpos = screen.width + g_xpos - g_width; + if (g_ypos < 0 || (g_ypos == 0 && (g_pos & 4))) +- g_ypos = HeightOfScreen(g_screen) + g_ypos - g_height; ++ g_ypos = screen.height + g_ypos - g_height; + + get_window_attribs(&attribs); + +@@ -1882,6 +1964,11 @@ + void + xwin_toggle_fullscreen(void) + { ++#ifdef HAVE_XINERAMA ++ Window root, parent, *children; ++ unsigned int nchildren; ++ XWindowAttributes win_attrib; ++#endif + Pixmap contents = 0; + + if (g_seamless_active) +@@ -1895,6 +1982,17 @@ + XCopyArea(g_display, g_wnd, contents, g_gc, 0, 0, g_width, g_height, 0, 0); + } + ++#ifdef HAVE_XINERAMA ++ /* Determine the parent window. */ ++ XQueryTree(g_display, g_wnd, &root, &parent, &children, &nchildren); ++ if (children != NULL) XFree(children); ++ ++ /* Find the present coordinates of the window. */ ++ XGetWindowAttributes(g_display, parent, &win_attrib); ++ g_last_wnd_pos_x = win_attrib.x + 1; ++ g_last_wnd_pos_y = win_attrib.y + 1; ++#endif ++ + ui_destroy_window(); + g_fullscreen = !g_fullscreen; + ui_create_window(); diff --git a/net-misc/rdesktop/files/rdesktop171-ds-xinerama.patch b/net-misc/rdesktop/files/rdesktop171-ds-xinerama.patch new file mode 100644 index 0000000..0d66e3d --- /dev/null +++ b/net-misc/rdesktop/files/rdesktop171-ds-xinerama.patch @@ -0,0 +1,181 @@ +diff -dPNur rdesktop-1.7.1/configure.ac rdesktop-1.7.1-ds/configure.ac +--- rdesktop-1.7.1/configure.ac 2012-01-09 13:29:39.000000000 +0100 ++++ rdesktop-1.7.1-ds/configure.ac 2012-11-21 00:55:34.000000000 +0100 +@@ -32,6 +32,8 @@ + AC_SEARCH_LIBS(socket, socket) + AC_SEARCH_LIBS(inet_aton, resolv) + ++AC_CHECK_LIB(Xinerama, XineramaQueryScreens, AC_DEFINE(HAVE_XINERAMA) LIBS="$LIBS -lXinerama", [], []) ++ + AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H)) + AC_CHECK_HEADER(sys/modem.h, AC_DEFINE(HAVE_SYS_MODEM_H)) + AC_CHECK_HEADER(sys/filio.h, AC_DEFINE(HAVE_SYS_FILIO_H)) +diff -dPNur rdesktop-1.7.1/configure.ac.orig rdesktop-1.7.1-ds/configure.ac.orig +diff -dPNur rdesktop-1.7.1/rdesktop-xinerama.patch rdesktop-1.7.1-ds/rdesktop-xinerama.patch +diff -dPNur rdesktop-1.7.1/xwin.c rdesktop-1.7.1-ds/xwin.c +--- rdesktop-1.7.1/xwin.c 2011-04-13 13:13:04.000000000 +0200 ++++ rdesktop-1.7.1-ds/xwin.c 2012-11-21 01:00:46.000000000 +0100 +@@ -21,6 +21,9 @@ + + #include + #include ++#ifdef HAVE_XINERAMA ++ #include ++#endif + #include + #include + #include +@@ -817,6 +820,71 @@ + #define LOUT24(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; } + #define LOUT32(o, x) { *(o++) = x; *(o++) = x >> 8; *(o++) = x >> 16; *(o++) = x >> 24; } + ++#ifdef HAVE_XINERAMA ++// IF XINERAMA LIBRARY ++ ++int g_last_wnd_pos_x; ++int g_last_wnd_pos_y; ++ ++void ++ScreenSize(XRectangle *screen) ++{ ++ int screens; ++ int event_base; ++ int error_base; ++ ++ if (XineramaQueryExtension(g_display, &event_base, &error_base)) ++ { ++ XineramaScreenInfo *screeninfo; ++ int i; ++ ++ /* Get the Xinerama screen infomation. */ ++ screeninfo = XineramaQueryScreens(g_display, &screens); ++ ++ /* Search for the appropriate screen. */ ++ i = 0; ++ while (!(screeninfo[i].x_org <= g_last_wnd_pos_x ++ && screeninfo[i].y_org <= g_last_wnd_pos_y ++ && screeninfo[i].x_org + screeninfo[i].width >= g_last_wnd_pos_x ++ && screeninfo[i].y_org + screeninfo[i].height >= g_last_wnd_pos_y )) ++ { ++ i++; ++ } ++ if (i >= screens) i = 0; ++ ++ /* Position according to the present screen. */ ++ screen->x = screeninfo[i].x_org; ++ screen->y = screeninfo[i].y_org; ++ screen->width = screeninfo[i].width; ++ screen->height = screeninfo[i].height; ++ ++ /* Free allocated memory. */ ++ XFree(screeninfo); ++ } ++ else ++ { ++ /* Xinerama is not in use, default to the XLib screensize call. */ ++ screen->x = 0; ++ screen->y = 0; ++ screen->width = WidthOfScreen(g_screen); ++ screen->height = HeightOfScreen(g_screen); ++ } ++} ++ ++#else ++// IF NO XINERAMA LIBRARY ++ ++void ++ScreenSize(XRectangle *screen) ++{ ++ screen->x = 0; ++ screen->y = 0; ++ screen->width = WidthOfScreen(g_screen); ++ screen->height = HeightOfScreen(g_screen); ++} ++ ++#endif ++ + static uint32 + translate_colour(uint32 colour) + { +@@ -1913,17 +1981,23 @@ + */ + if (g_fullscreen) + { +- g_width = WidthOfScreen(g_screen); +- g_height = HeightOfScreen(g_screen); ++ XRectangle screen; ++ ScreenSize(&screen); ++ ++ g_width = screen.width; ++ g_height = screen.height; + g_using_full_workarea = True; + } + else if (g_sizeopt < 0) + { ++ XRectangle screen; ++ ScreenSize(&screen); ++ + /* Percent of screen */ + if (-g_sizeopt >= 100) + g_using_full_workarea = True; +- g_height = HeightOfScreen(g_screen) * (-g_sizeopt) / 100; +- g_width = WidthOfScreen(g_screen) * (-g_sizeopt) / 100; ++ g_height = screen.height * (-g_sizeopt) / 100; ++ g_width = screen.width * (-g_sizeopt) / 100; + } + else if (g_sizeopt == 1) + { +@@ -2006,14 +2080,19 @@ + long input_mask, ic_input_mask; + XEvent xevent; + +- wndwidth = g_fullscreen ? WidthOfScreen(g_screen) : g_width; +- wndheight = g_fullscreen ? HeightOfScreen(g_screen) : g_height; ++ XRectangle screen; ++ ++ ScreenSize(&screen); ++ wndwidth = g_fullscreen ? screen.width : g_width; ++ wndheight = g_fullscreen ? screen.height : g_height; ++ g_xpos = g_fullscreen ? screen.x : g_xpos; ++ g_ypos = g_fullscreen ? screen.y : g_ypos; + + /* Handle -x-y portion of geometry string */ + if (g_xpos < 0 || (g_xpos == 0 && (g_pos & 2))) +- g_xpos = WidthOfScreen(g_screen) + g_xpos - g_width; ++ g_xpos = screen.width + g_xpos - g_width; + if (g_ypos < 0 || (g_ypos == 0 && (g_pos & 4))) +- g_ypos = HeightOfScreen(g_screen) + g_ypos - g_height; ++ g_ypos = screen.height + g_ypos - g_height; + + get_window_attribs(&attribs); + +@@ -2170,6 +2249,11 @@ + void + xwin_toggle_fullscreen(void) + { ++#ifdef HAVE_XINERAMA ++ Window root, parent, *children; ++ unsigned int nchildren; ++ XWindowAttributes win_attrib; ++#endif + Pixmap contents = 0; + + if (g_seamless_active) +@@ -2183,6 +2267,17 @@ + XCopyArea(g_display, g_wnd, contents, g_gc, 0, 0, g_width, g_height, 0, 0); + } + ++#ifdef HAVE_XINERAMA ++ /* Determine the parent window. */ ++ XQueryTree(g_display, g_wnd, &root, &parent, &children, &nchildren); ++ if (children != NULL) XFree(children); ++ ++ /* Find the present coordinates of the window. */ ++ XGetWindowAttributes(g_display, parent, &win_attrib); ++ g_last_wnd_pos_x = win_attrib.x + 1; ++ g_last_wnd_pos_y = win_attrib.y + 1; ++#endif ++ + ui_destroy_window(); + g_fullscreen = !g_fullscreen; + ui_create_window(); -- cgit v1.2.3