diff -NarU5 wmx-7.orig/Config.h wm2-wmx-trunk/wmx/Config.h --- wmx-7.orig/Config.h 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/Config.h 2009-01-19 13:49:50.000000000 -0500 @@ -146,10 +146,18 @@ // if False, behaviour will be as in wm2 (stretching the background // image only). #define CONFIG_RESIZE_UPDATE True +// If USE_COMPOSITE is true, wmx will enable composite redirects for +// all windows if the Composite extension is present. This should +// make no difference at all to the appearance or behaviour of wmx, +// but it may make it substantially faster with modern video cards +// that optimise rendering more than old-fashioned window operations. + +#define CONFIG_USE_COMPOSITE True + // If RAISELOWER_ON_CLICK is True, clicking on the title of the // topmost window will lower instead of raising it (patch due to // Kazushi (Jam) Marukawa) #define CONFIG_RAISELOWER_ON_CLICK False @@ -253,14 +261,12 @@ // at all, define it to CONFIG_NO_BUTTON. #define CONFIG_NO_BUTTON 999 #define CONFIG_CLIENTMENU_BUTTON Button1 #define CONFIG_COMMANDMENU_BUTTON Button2 #define CONFIG_CIRCULATE_BUTTON Button3 // switch window, when over frame -#define CONFIG_PREVCHANNEL_BUTTON CONFIG_NO_BUTTON // flip channel, when over frame -#define CONFIG_NEXTCHANNEL_BUTTON CONFIG_NO_BUTTON -//#define CONFIG_PREVCHANNEL_BUTTON CONFIG_NO_BUTTON -//#define CONFIG_NEXTCHANNEL_BUTTON CONFIG_NO_BUTTON +#define CONFIG_PREVCHANNEL_BUTTON Button5 // flip channel, when over frame +#define CONFIG_NEXTCHANNEL_BUTTON Button4 // flip channel, when over frame // ============================== // Section III. Colours and fonts // ============================== diff -NarU5 wmx-7.orig/configure wm2-wmx-trunk/wmx/configure --- wmx-7.orig/configure 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/configure 2009-01-19 11:57:15.000000000 -0500 @@ -3018,10 +3018,87 @@ fi +{ echo "$as_me:$LINENO: checking for XCompositeQueryExtension in -lXcomposite" >&5 +echo $ECHO_N "checking for XCompositeQueryExtension in -lXcomposite... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xcomposite_XCompositeQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXcomposite $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XCompositeQueryExtension (); +int +main () +{ +return XCompositeQueryExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_Xcomposite_XCompositeQueryExtension=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xcomposite_XCompositeQueryExtension=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&6; } +if test $ac_cv_lib_Xcomposite_XCompositeQueryExtension = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBXCOMPOSITE 1 +_ACEOF + + LIBS="-lXcomposite $LIBS" + +else + + echo "Warning: Xcomposite library not found" + echo "Please either install the Xcomposite library and headers, or ensure you have CONFIG_USE_COMPOSITE set to False in Config.h" + +fi + + + { echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5 echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6; } if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else diff -NarU5 wmx-7.orig/configure.in wm2-wmx-trunk/wmx/configure.in --- wmx-7.orig/configure.in 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/configure.in 2009-01-19 11:57:15.000000000 -0500 @@ -37,10 +37,16 @@ AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [], [ echo "Warning: Xpm library not found" echo "Please either install the Xpm library and headers, or ensure you have CONFIG_USE_PIXMAPS set to False in Config.h" ]) +dnl Composite is necessary if CONFIG_USE_COMPOSITE +AC_CHECK_LIB(Xcomposite, XCompositeQueryExtension, [], [ + echo "Warning: Xcomposite library not found" + echo "Please either install the Xcomposite library and headers, or ensure you have CONFIG_USE_COMPOSITE set to False in Config.h" + ]) + dnl SM and ICE are necessary if CONFIG_USE_SESSION_MANAGER AC_CHECK_LIB(SM, SmcOpenConnection) AC_CHECK_LIB(ICE, IceConnectionNumber) dnl Freetype: actually only needed if CONFIG_USE_XFT diff -NarU5 wmx-7.orig/Makefile.in wm2-wmx-trunk/wmx/Makefile.in --- wmx-7.orig/Makefile.in 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/Makefile.in 2009-01-19 14:12:30.000000000 -0500 @@ -43,10 +43,15 @@ cp wmx @bindir@/wmx -chmod 0755 @bindir@/wmx -chown root:wheel @bindir@/wmx -rm -f @bindir@/wmx.old +install-rpm: + mkdir -p $(DESTDIR)/usr/bin/ + cp wmx $(DESTDIR)/usr/bin/wmx + + # DO NOT DELETE -- make depend depends on it Border.o: Border.C Border.h General.h Config.h Rotated.h Client.h \ Manager.h listmacro.h background.xpm Buttons.o: Buttons.C Manager.h General.h Config.h listmacro.h Client.h \ Border.h Rotated.h Menu.h diff -NarU5 wmx-7.orig/Manager.C wm2-wmx-trunk/wmx/Manager.C --- wmx-7.orig/Manager.C 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/Manager.C 2009-01-19 13:49:50.000000000 -0500 @@ -13,10 +13,14 @@ #include <sys/wait.h> #include "Cursors.h" #include <X11/cursorfont.h> +#ifdef CONFIG_USE_COMPOSITE +#include <X11/extensions/Xcomposite.h> +#endif + Atom Atoms::wm_state; Atom Atoms::wm_changeState; Atom Atoms::wm_protocols; Atom Atoms::wm_delete; Atom Atoms::wm_takeFocus; @@ -242,10 +246,21 @@ if (!m_display) fatal("can't open display"); m_shell = (char *)getenv("SHELL"); if (!m_shell) m_shell = NewString("/bin/sh"); +#ifdef CONFIG_USE_COMPOSITE + int ev, er; + if (XCompositeQueryExtension(m_display, &ev, &er)) { + fprintf(stderr, "\n Enabling composite extension.\n"); + for (int i = 0; i < m_screensTotal; ++i) { + XCompositeRedirectSubwindows(m_display, RootWindow(m_display, i), + CompositeRedirectAutomatic); + } + } +#endif + // find out what the Alt keycode and thus modifier mask are int kpk = 0; int kmin = 0; int kmax = 0; XDisplayKeycodes(m_display, &kmin, &kmax); diff -NarU5 wmx-7.orig/Menu.C wm2-wmx-trunk/wmx/Menu.C --- wmx-7.orig/Menu.C 2009-01-09 06:18:03.000000000 -0500 +++ wm2-wmx-trunk/wmx/Menu.C 2009-01-19 14:12:30.000000000 -0500 @@ -54,10 +54,14 @@ tokstr = 0; FcPattern *pattern = FcPatternCreate(); FcPatternAddString(pattern, FC_FAMILY, (FcChar8 *)fi); FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); + +#ifndef FC_WEIGHT_REGULAR +#define FC_WEIGHT_REGULAR FC_WEIGHT_MEDIUM +#endif FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_REGULAR); FcPatternAddInteger(pattern, FC_PIXEL_SIZE, CONFIG_MENU_FONT_SIZE); FcConfigSubstitute(FcConfigGetCurrent(), pattern, FcMatchPattern); FcResult result = FcResultMatch;