From b90fe3230bbee136c2a575c48eb7b6e58e00a7c3 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Wed, 21 Jan 2009 16:08:13 +0000 Subject: [PATCH] patch and buildreq for libXcomposite --- wmx-7-cfg.patch | 15 --- wmx-7-composite.patch | 227 ++++++++++++++++++++++++++++++++++++++++++ wmx.spec | 18 ++-- 3 files changed, 239 insertions(+), 21 deletions(-) create mode 100644 wmx-7-composite.patch diff --git a/wmx-7-cfg.patch b/wmx-7-cfg.patch index 54daec3..b6ce74b 100644 --- a/wmx-7-cfg.patch +++ b/wmx-7-cfg.patch @@ -40,21 +40,6 @@ diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h // modifier is pressed; they're keysyms as defined in // and -@@ -253,12 +253,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 Button4 // flip channel, when over frame -+#define CONFIG_NEXTCHANNEL_BUTTON Button5 - //#define CONFIG_PREVCHANNEL_BUTTON CONFIG_NO_BUTTON - //#define CONFIG_NEXTCHANNEL_BUTTON CONFIG_NO_BUTTON - - - // ============================== @@ -329,11 +329,11 @@ #define CONFIG_MENU_BORDERS "black" diff --git a/wmx-7-composite.patch b/wmx-7-composite.patch new file mode 100644 index 0000000..fa9520f --- /dev/null +++ b/wmx-7-composite.patch @@ -0,0 +1,227 @@ +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 + + #include "Cursors.h" + #include + ++#ifdef CONFIG_USE_COMPOSITE ++#include ++#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; diff --git a/wmx.spec b/wmx.spec index 842a23e..d5e3237 100644 --- a/wmx.spec +++ b/wmx.spec @@ -1,6 +1,6 @@ Name: wmx Version: 7 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A really simple window manager for X License: BSD Group: User Interface/X @@ -11,9 +11,10 @@ Source2: background.xpm Source3: wmx.desktop Source4: Xclients.wmx.sh Source5: xnodecor.c -Patch0: wmx-7-cfg.patch +Patch0: wmx-7-composite.patch +Patch1: wmx-7-cfg.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: xorg-x11-proto-devel libX11-devel libXpm-devel libXext-devel libXaw-devel libXt-devel freetype-devel libXft-devel +BuildRequires: xorg-x11-proto-devel libX11-devel libXpm-devel libXext-devel libXaw-devel libXt-devel libXcomposite-devel freetype-devel libXft-devel %description A really simple window manager for X, based on wm2, with a minimal set of @@ -24,6 +25,7 @@ configurable options. %setup -q -a 1 %{__install} -p -m 0644 %{SOURCE2} . %patch0 -p1 +%patch1 -p1 %build %configure --x-libraries=%{_libdir} --x-includes=%{_includedir}/X11 @@ -51,10 +53,14 @@ configurable options. %{_sysconfdir}/X11/xinit/Xclients.d/* %changelog -* Tue Jan 13 2009 Gabriel Somlo 7-2 +* Mon Jan 19 2009 Gabriel Somlo 7-3 +- applied patch for use of compositing offscreen storage to speed up rendering +- added buildreq for libxcomposite-devel + +* Tue Jan 13 2009 Gabriel Somlo 7-2 - re-enabled scroll-wheel-cycles-channels feature -* Sat Jan 10 2009 Gabriel Somlo 7-1 +* Sat Jan 10 2009 Gabriel Somlo 7-1 - update to 7 * Tue Feb 19 2008 Fedora Release Engineering - 6pl1-18 @@ -118,7 +124,7 @@ configurable options. - spec file fixes as per P. Lemenkov and I. Vazquez - default menu entries now go in /usr/share/wmx/menu - example wmx .xsession file added to doc -- gave up on using /usr/X11R6/bin -- using bindir instead +- gave up on using /usr/X11R6/bin -- using bindir instead * Wed Dec 14 2005 Gabriel Somlo 6pl1-2 - increased bump-distance parameter for easier placement at edge of screen