[wmx/f16] update to latest svn checkout

Gabriel L. Somlo somlo at fedoraproject.org
Mon Jan 9 21:28:00 UTC 2012


commit 48f9768cab9c3188c9e166810327422f1c8c16a4
Author: Gabriel L. Somlo <somlo at hedwig.ini.cmu.edu>
Date:   Mon Jan 9 16:27:58 2012 -0500

    update to latest svn checkout

 .gitignore              |    1 +
 sources                 |    2 +-
 wmx-7-20120109svn.patch |  612 +++++++++++++++++++++++++++++++++++++++++++++++
 wmx-7-cfg.patch         |   27 ++-
 wmx-7-composite.patch   |  227 ------------------
 wmx.spec                |   20 +-
 xnodecor.c              |  141 -----------
 7 files changed, 647 insertions(+), 383 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9394757..f7ed618 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ wmx-defaults-1.tar.gz
 wmx-7.tar.gz
 /wmx-7.tar.gz
 /wmx-defaults-1.tar.gz
+/wmx-defaults-2.tar.gz
diff --git a/sources b/sources
index 2fbb285..00e81f9 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
 e8eda438f5dda09d11ba7de1dcf9e501  wmx-7.tar.gz
-a5f221d36884276cbf331414d4f2a761  wmx-defaults-1.tar.gz
+70892929426891facc252520784d9840  wmx-defaults-2.tar.gz
diff --git a/wmx-7-20120109svn.patch b/wmx-7-20120109svn.patch
new file mode 100644
index 0000000..9883625
--- /dev/null
+++ b/wmx-7-20120109svn.patch
@@ -0,0 +1,612 @@
+diff -NarU5 wmx-7/Channel.C SVN/wm2-2012-01-09/trunk/wmx/Channel.C
+--- wmx-7/Channel.C	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Channel.C	2012-01-09 11:05:39.676384280 -0500
+@@ -16,96 +16,102 @@
+     { " ### ", "#   #", "#   #", " ### ", "#   #", "#   #", " ### " },
+     { " ### ", "#   #", "#   #", " ####", "    #", "   # ", " ##  " }
+ };
+ 
+ 
+-void WindowManager::flipChannel(Boolean statusOnly, Boolean flipDown,
+-				Boolean quickFlip, Client *push)
++Window WindowManager::createNumberWindow(int screen, const char *colour)
+ {
+-    int x, y, i, sc;
+-    if (!CONFIG_CHANNEL_SURF) return;
+-
+-    for (sc = 0; sc < screensTotal(); sc++)
+-    {
+-	if (!m_channelWindow[sc]) {
+-
+-	XColor nearest, ideal;
+-
+-	    if (!XAllocNamedColor(display(), DefaultColormap(display(), sc),
+-			      CONFIG_CHANNEL_NUMBER, &nearest, &ideal)) {
++    XColor nearest, ideal;
++            
++    if (!XAllocNamedColor(display(), DefaultColormap(display(), screen),
++                          colour, &nearest, &ideal)) {
+ 	    
+-		if (!XAllocNamedColor(display(), DefaultColormap(display(), sc),
+-				  "black", &nearest, &ideal)) {
++        if (!XAllocNamedColor(display(), DefaultColormap(display(), screen),
++                              "black", &nearest, &ideal)) {
+ 		
+-		fatal("Couldn't allocate green or black");
+-	    }
+-	}
+-
+-	XSetWindowAttributes wa;
+-	wa.background_pixel = nearest.pixel;
+-	wa.override_redirect = True;
+-	
+-	    m_channelWindow[sc] = XCreateWindow
+-		(display(), mroot(sc),
+-		 0, 0, 1, 1, 0, CopyFromParent, CopyFromParent,
+-	     CopyFromParent, CWOverrideRedirect | CWBackPixel, &wa);
+-	}
++            fatal("Couldn't allocate requested numeral colour or black");
++        }
+     }
++            
++    XSetWindowAttributes wa;
++    wa.background_pixel = nearest.pixel;
++    wa.override_redirect = True;
++	
++    Window w = XCreateWindow
++        (display(), mroot(screen),
++         0, 0, 1, 1, 0, CopyFromParent, CopyFromParent,
++         CopyFromParent, CWOverrideRedirect | CWBackPixel, &wa);
+ 
+-    int nextChannel;
++    return w;
++}
+ 
+-    if (statusOnly) nextChannel = m_currentChannel;
+-    else {
+-	if (!flipDown) {
+-	    nextChannel = m_currentChannel + 1;
+-	    if (nextChannel > m_channels) nextChannel = 1;
+-	} else {
+-	    nextChannel = m_currentChannel - 1;
+-	    if (nextChannel < 1) nextChannel = m_channels;
+-	}
+-    }
+ 
++int WindowManager::shapeNumberWindow(Window w, int n, int minDigits)
++{
++    int i, x, y;
+     XRectangle r;
+     Boolean first = True;
+     char number[7];
+-    sprintf(number, "%d", nextChannel);
++    sprintf(number, "%0*d", minDigits, n);
+ 
+     for (i = 0; i < (int)strlen(number); ++i) {
+ 	for (y = 0; y < 7; ++y) {
+ 	    for (x = 0; x < 5; ++x) {
+ 		if (numerals[number[i]-'0'][y][x] != ' ') {
+-/*		    
+-		    r.x = i * 110 + x * 20; r.y = y * 20;
+-		    r.width = r.height = 20;
+- */      
++
+                     r.x = 10 + (i * 6 + x) * CONFIG_CHANNEL_NUMBER_SIZE;
+                     r.y = y * CONFIG_CHANNEL_NUMBER_SIZE;
+                     r.width = r.height = CONFIG_CHANNEL_NUMBER_SIZE;
+-                    for(sc = 0; sc < screensTotal(); sc++)
+-                    {
++
+ 		    XShapeCombineRectangles
+-                          (display(), m_channelWindow[sc], ShapeBounding,
++                          (display(), w, ShapeBounding,
+                            0, 0, &r, 1, first ? ShapeSet : ShapeUnion,
+                            YXBanded);
+-                    }
++
+ 		    first = False;
+ 		}
+ 	    }
+ 	}
+     }
+ 
+-    for(sc = 0; sc < screensTotal(); sc++) {
+-/*
+-        XMoveResizeWindow(display(), m_channelWindow[sc],
+-			  DisplayWidth(display(), sc) - 30 -
+-		      110 * strlen(number), 30, 500, 160);
+- */
++    return (5 * CONFIG_CHANNEL_NUMBER_SIZE + 10) * strlen(number);
++}
++    
++    
++void WindowManager::flipChannel(Boolean statusOnly, Boolean flipDown,
++				Boolean quickFlip, Client *push)
++{
++    int wid, i, sc;
++    if (!CONFIG_CHANNEL_SURF) return;
++
++    for (sc = 0; sc < screensTotal(); sc++) {
++	if (!m_channelWindow[sc]) {
++            m_channelWindow[sc] = createNumberWindow(sc, CONFIG_CHANNEL_NUMBER);
++	}
++    }
++
++    int nextChannel;
++
++    if (statusOnly) nextChannel = m_currentChannel;
++    else {
++	if (!flipDown) {
++	    nextChannel = m_currentChannel + 1;
++	    if (nextChannel > m_channels) nextChannel = 1;
++	} else {
++	    nextChannel = m_currentChannel - 1;
++	    if (nextChannel < 1) nextChannel = m_channels;
++	}
++    }
++
++    for (sc = 0; sc < screensTotal(); sc++) {
++
++        wid = shapeNumberWindow(m_channelWindow[sc], nextChannel, 1);
+ 
+         XMoveResizeWindow(display(), m_channelWindow[sc],
+-                          DisplayWidth(display(), sc) - 30 -
+-                          (5 * CONFIG_CHANNEL_NUMBER_SIZE + 10) *
+-                          strlen(number), 30, 500, 160);
++                          DisplayWidth(display(), sc) - 30 - wid,
++                          30, 500, 160);
++
+ 	XMapRaised(display(), m_channelWindow[sc]);
+     }
+ 
+     if (!statusOnly) {
+ 
+@@ -228,5 +234,38 @@
+     if (m_channels <= channel) {
+         m_channels = channel + 1;
+         netwmUpdateChannelList();
+     }
+ }
++
++void
++WindowManager::updateClock()
++{
++    time_t t;
++    struct tm *lt;
++
++    fprintf(stderr, "updateClock\n");
++
++    time(&t);
++    lt = localtime(&t);
++    
++    if (!m_clockWindow[0]) {
++        m_clockWindow[0] = createNumberWindow(0, CONFIG_CLOCK_NUMBER);
++        m_clockWindow[1] = createNumberWindow(0, CONFIG_CLOCK_NUMBER);
++    }
++
++    shapeNumberWindow(m_clockWindow[0], lt->tm_hour, 2);
++    shapeNumberWindow(m_clockWindow[1], lt->tm_min, 2);
++    
++    XMoveResizeWindow(display(), m_clockWindow[0],
++                      30, 30, 500, 160);
++    
++    XMoveResizeWindow(display(), m_clockWindow[1],
++                      30, 9 * CONFIG_CHANNEL_NUMBER_SIZE + 30, 500, 160);
++
++    XMapWindow(display(), m_clockWindow[0]);
++    XLowerWindow(display(), m_clockWindow[0]);
++
++    XMapWindow(display(), m_clockWindow[1]);
++    XLowerWindow(display(), m_clockWindow[1]);
++}
++
+diff -NarU5 wmx-7/Config.h SVN/wm2-2012-01-09/trunk/wmx/Config.h
+--- wmx-7/Config.h	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Config.h	2012-01-09 11:05:39.679384449 -0500
+@@ -77,12 +77,11 @@
+ // Spawn a temporary new shell between the wm and each new process?
+ #define CONFIG_EXEC_USING_SHELL   False
+ 
+ // What to run to get a new window (from the "New" menu option)
+ #define CONFIG_NEW_WINDOW_LABEL "New"
+-#define CONFIG_NEW_WINDOW_COMMAND "xterm"
+-//#define CONFIG_NEW_WINDOW_COMMAND "/home/ccannam/.wmx/terminal"
++#define CONFIG_NEW_WINDOW_COMMAND "x-terminal-emulator"
+ #define CONFIG_NEW_WINDOW_COMMAND_OPTIONS 0
+ // or, for example,
+ //#define CONFIG_NEW_WINDOW_COMMAND_OPTIONS "-ls","-sb","-sl","1024",0
+ // alternatively,
+ #define CONFIG_DISABLE_NEW_WINDOW_COMMAND (DynamicConfig::config.disableNew())
+@@ -146,10 +145,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 +260,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
+ // ==============================
+@@ -321,10 +326,11 @@
+ #define CONFIG_TAB_BACKGROUND     (DynamicConfig::config.tabBackground())
+ #define CONFIG_FRAME_BACKGROUND   (DynamicConfig::config.frameBackground())
+ #define CONFIG_BUTTON_BACKGROUND  (DynamicConfig::config.frameBackground())
+ #define CONFIG_BORDERS            "black"
+ #define CONFIG_CHANNEL_NUMBER	  "green"
++#define CONFIG_CLOCK_NUMBER       "gray90"
+ 
+ #define CONFIG_MENU_FOREGROUND    (DynamicConfig::config.tabForeground())
+ #define CONFIG_MENU_BACKGROUND    (DynamicConfig::config.tabBackground())
+ #define CONFIG_MENU_BORDERS       "black"
+ 
+@@ -361,14 +367,14 @@
+ #define CONFIG_USE_CHANNEL_MENU   False
+ 
+ // FLIP_DELAY is the length of time the big green number stays in the
+ // top-right when flipping channels, before the windows reappear.
+ // QUICK_FLIP_DELAY is the equivalent figure used when flipping with
+-// the Alt-Fn keys.  Milliseconds.
++// the Alt-Fn keys or mouse wheel.  Milliseconds.
+ 
+ #define CONFIG_FLIP_DELAY         1000
+-#define CONFIG_QUICK_FLIP_DELAY   200
++#define CONFIG_QUICK_FLIP_DELAY   500
+ 
+ // Set MAD_FEEDBACK for skeletal representations of windows when
+ // flicking through the client menu and changing channels.  The DELAY
+ // is how long skeletal feedback has to persist before wmx decides to
+ // post the entire window contents instead; if it's negative, the
+@@ -377,30 +383,36 @@
+ // delay of 0ms.
+ 
+ #define CONFIG_MAD_FEEDBACK       (DynamicConfig::config.useFeedback())
+ #define CONFIG_FEEDBACK_DELAY     (DynamicConfig::config.feedbackDelay())
+ 
+-// Groups are fun. you can bind a bunch of windows to a number key
+-// and when you press CONFIG_ALT_KEY_MASK and the number key
+-// all the windows of that group are raised.
+-
+ // Position of the geometry window:
+ // X < 0 left, X > 0 right,  X = 0 center
+ // Y < 0 top,  Y > 0 bottom, Y = 0 center
+ #define CONFIG_GEOMETRY_X_POS     0
+ #define CONFIG_GEOMETRY_Y_POS     0
+ 
++// Groups are fun. you can bind a bunch of windows to a number key
++// and when you press CONFIG_ALT_KEY_MASK and the number key
++// all the windows of that group are raised.
++
+ // You bind a window to a group by pressing the 
+ // CONFIG_ALT_KEY_MASK + CONFIG_GROUP_ADD + a number key
+ 
+ // if you press CONFIG_ALT_KEY_MASK + CONFIG_GROUP_REMOVE_ALL
+ // + a number key that group is cleared of all windows.
+ 
+ #define CONFIG_GROUPS             True
+ #define CONFIG_GROUP_ADD          ControlMask  
+ #define CONFIG_GROUP_REMOVE_ALL   ShiftMask
+ 
++// Set CLOCK if you want wmx to display a clock permanently in the
++// background at top-left of screen 0.  Use CONFIG_CLOCK_NUMBER
++// to control the colour of the clock digits.
++
++#define CONFIG_CLOCK              False
++
+ // This lets you choose whether to keep the regular wmx
+ // mouse button behaviour, or go w/ the GNOME-described one.
+ // If this is True, the left mouse button (button1) lets you 
+ // select 1 or more gmc 'icons' and drag them around etc,
+ // the right mouse button (button3) pops up the GNOME 
+diff -NarU5 wmx-7/configure SVN/wm2-2012-01-09/trunk/wmx/configure
+--- wmx-7/configure	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/configure	2012-01-09 11:05:39.668383824 -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/configure.in SVN/wm2-2012-01-09/trunk/wmx/configure.in
+--- wmx-7/configure.in	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/configure.in	2012-01-09 11:05:39.674384166 -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/Events.C SVN/wm2-2012-01-09/trunk/wmx/Events.C
+--- wmx-7/Events.C	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Events.C	2012-01-09 11:05:39.672384052 -0500
+@@ -142,15 +142,23 @@
+ 
+     if (!m_signalled) {
+ 
+     waiting:
+ 
+-	if (m_channelChangeTime > 0) {
++	if (m_channelChangeTime > 0 || CONFIG_CLOCK) {
++
+ 	    Time t = timestamp(True);
+-	    if (t >= m_channelChangeTime) {
++
++	    if (m_channelChangeTime > 0 && t >= m_channelChangeTime) {
+ 		instateChannel();
+ 	    }
++
++            if (CONFIG_CLOCK && (m_clockUpdateTime == CurrentTime ||
++                                 t >= m_clockUpdateTime + 60000)) {
++                m_clockUpdateTime = t;
++                updateClock();
++            }
+ 	}
+ 
+ 	if (QLength(m_display) > 0) {
+ 	    XNextEvent(m_display, e);
+ 	    return;
+diff -NarU5 wmx-7/Makefile.in SVN/wm2-2012-01-09/trunk/wmx/Makefile.in
+--- wmx-7/Makefile.in	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Makefile.in	2012-01-09 11:05:39.670383938 -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/Manager.C SVN/wm2-2012-01-09/trunk/wmx/Manager.C
+--- wmx-7/Manager.C	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Manager.C	2012-01-09 11:05:39.678384393 -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;
+@@ -285,10 +289,12 @@
+ 
+     m_channels = 2;
+     m_currentChannel = 1;
+     m_channelChangeTime = 0;
+     m_channelWindow = 0;
++    m_clockWindow = 0;
++    m_clockUpdateTime = CurrentTime;
+ 
+     Atoms::wm_state      = XInternAtom(m_display, "WM_STATE",            False);
+     Atoms::wm_changeState= XInternAtom(m_display, "WM_CHANGE_STATE",     False);
+     Atoms::wm_protocols  = XInternAtom(m_display, "WM_PROTOCOLS",        False);
+     Atoms::wm_delete     = XInternAtom(m_display, "WM_DELETE_WINDOW",    False);
+@@ -338,11 +344,22 @@
+ 
+     initialiseScreen();
+     if (m_screensTotal > 1) {
+         fprintf(stderr, "\n     Detected %d screens.", m_screensTotal);
+     }
+-    
++   
++#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
++ 
+     XSetSelectionOwner(m_display, Atoms::wmx_running,
+ 		       None, timestamp(True)); // used to have m_menuWindow
+     XSync(m_display, False);
+     m_initialising = False;
+     m_returnCode = 0;
+@@ -517,11 +534,12 @@
+   
+     m_root = (Window *) malloc(m_screensTotal * sizeof(Window));
+     m_defaultColormap = (Colormap *) malloc(m_screensTotal * sizeof(Colormap));
+ //    m_minimumColormaps = (int *) malloc(m_screensTotal * sizeof(int));
+     m_channelWindow = (Window *) malloc(m_screensTotal * sizeof(Window));
+-    
++    m_clockWindow = (Window *) malloc(2 * sizeof(Window));
++
+     for (i = 0 ; i < m_screensTotal ; i++) {
+ 
+         m_screenNumber = i;
+ 	m_channelWindow[i] = 0;
+ 
+@@ -570,10 +588,14 @@
+ 
+         XChangeWindowAttributes(m_display, m_root[i], CWCursor | CWEventMask, &attr);
+         XSync(m_display, False);
+     }
+ 
++    for (i = 0; i < 2; ++i) {
++        m_clockWindow[i] = 0;
++    }
++
+     m_screenNumber = 0;
+ }
+ 
+ 
+ unsigned long WindowManager::allocateColour(int screen, const char *name,
+diff -NarU5 wmx-7/Manager.h SVN/wm2-2012-01-09/trunk/wmx/Manager.h
+--- wmx-7/Manager.h	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Manager.h	2012-01-09 11:05:39.682384620 -0500
+@@ -150,16 +150,22 @@
+ 
+     int m_channels;
+     int m_currentChannel;	// from 1 to ...
+     void flipChannel(Boolean statusOnly, Boolean flipDown,
+ 		     Boolean quickFlip, Client *push); // bleah!
++    Window createNumberWindow(int screen, const char *colour);
++    int shapeNumberWindow(Window w, int number, int minDigits); // returns width in pixels
+     void instateChannel();
+     void createNewChannel();
+     void checkChannel(int);
+     Time m_channelChangeTime;
+     Window *m_channelWindow;
+ 
++    void updateClock();
++    Window *m_clockWindow;
++    Time m_clockUpdateTime;
++
+     Boolean m_looping;
+     int m_returnCode;
+ 
+     static Boolean m_initialising;
+     static int errorHandler(Display *, XErrorEvent *);
+diff -NarU5 wmx-7/Menu.C SVN/wm2-2012-01-09/trunk/wmx/Menu.C
+--- wmx-7/Menu.C	2009-01-09 06:18:03.000000000 -0500
++++ SVN/wm2-2012-01-09/trunk/wmx/Menu.C	2012-01-09 11:05:39.673384109 -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-7-cfg.patch b/wmx-7-cfg.patch
index b6ce74b..be40c73 100644
--- a/wmx-7-cfg.patch
+++ b/wmx-7-cfg.patch
@@ -1,7 +1,20 @@
 diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h
---- wmx-7.orig/Config.h	2009-01-09 06:18:03.000000000 -0500
-+++ wmx-7/Config.h	2009-01-13 13:23:31.000000000 -0500
-@@ -93,11 +93,11 @@
+--- wmx-7.orig/Config.h	2012-01-09 16:07:03.610039637 -0500
++++ wmx-7/Config.h	2012-01-09 16:07:46.408474496 -0500
+@@ -77,11 +77,11 @@
+ // Spawn a temporary new shell between the wm and each new process?
+ #define CONFIG_EXEC_USING_SHELL   False
+ 
+ // What to run to get a new window (from the "New" menu option)
+ #define CONFIG_NEW_WINDOW_LABEL "New"
+-#define CONFIG_NEW_WINDOW_COMMAND "x-terminal-emulator"
++#define CONFIG_NEW_WINDOW_COMMAND "/usr/bin/xterm"
+ #define CONFIG_NEW_WINDOW_COMMAND_OPTIONS 0
+ // or, for example,
+ //#define CONFIG_NEW_WINDOW_COMMAND_OPTIONS "-ls","-sb","-sl","1024",0
+ // alternatively,
+ #define CONFIG_DISABLE_NEW_WINDOW_COMMAND (DynamicConfig::config.disableNew())
+@@ -92,11 +92,11 @@
   
  // Directory under $HOME in which to look for commands for the
  // middle-button menu
@@ -14,7 +27,7 @@ diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h
  #define CONFIG_ADD_SCREEN_TO_COMMAND_MENU False
   
  // Focus possibilities.
-@@ -126,11 +126,11 @@
+@@ -125,11 +125,11 @@
  
  // Number of pixels off the screen you have to push a window
  // before the manager notices the window is off-screen (the higher
@@ -27,7 +40,7 @@ diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h
  // other window edges as well as the edges of the screen
  
  #define CONFIG_BUMP_EVERYWHERE    True
-@@ -185,11 +185,11 @@
+@@ -192,11 +192,11 @@
  
  // This is the key for wm controls: e.g. Alt/Left and Alt/Right to
  // flip channels, and Alt/Tab to switch windows.  (On my 105-key
@@ -40,7 +53,7 @@ diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h
  // modifier is pressed; they're keysyms as defined in <X11/keysym.h>
  // and <X11/keysymdef.h>
  
-@@ -329,11 +329,11 @@
+@@ -335,11 +335,11 @@
  #define CONFIG_MENU_BORDERS       "black"
  
  // Pixel width for the bit of frame to the left of the window and the
@@ -53,7 +66,7 @@ diff -NarU5 wmx-7.orig/Config.h wmx-7/Config.h
  // ========================
  // Section IV. Flashy stuff
  // ========================
-@@ -342,11 +342,11 @@
+@@ -348,11 +348,11 @@
  // in ./background.xpm; if USE_PIXMAP_MENUS is also True, the menus
  // will be too.  The latter screws up in palette-based visuals, but
  // should be okay in true-colour.
diff --git a/wmx.spec b/wmx.spec
index 3bdd964..8672162 100644
--- a/wmx.spec
+++ b/wmx.spec
@@ -1,18 +1,21 @@
+%define checkout 20120109svn
+
 Name: wmx
 Version: 7
-Release: 8%{?dist}
+Release: 9.%{checkout}%{?dist}
 Summary: A really simple window manager for X
 License: BSD
 Group: User Interface/X
 URL: http://www.all-day-breakfast.com/wmx/
 Source0: http://www.all-day-breakfast.com/wmx/%{name}-%{version}.tar.gz
-Source1: wmx-defaults-1.tar.gz
+Source1: wmx-defaults-2.tar.gz
 Source2: background.xpm
 Source3: wmx.desktop
 Source4: Xclients.wmx.sh
-Source5: xnodecor.c
-Patch0: wmx-7-composite.patch
+Patch0: wmx-7-20120109svn.patch
 Patch1: wmx-7-cfg.patch
+#wmx's 'New' button is hardcoded to start an xterm, better make sure we have it:
+Requires: xterm
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: xorg-x11-proto-devel libX11-devel libXpm-devel libXext-devel libXaw-devel libXt-devel libXcomposite-devel freetype-devel libXft-devel
 
@@ -30,14 +33,12 @@ configurable options.
 %build
 %configure --x-libraries=%{_libdir} --x-includes=%{_includedir}/X11 LIBS=-lfontconfig
 %{__make} %{?_smp_mflags}
-%{__cc} -o xnodecor %{SOURCE5} -Werror -lX11
 
 %install
 %{__rm} -rf %{buildroot}
 %{__install} -D -m 0755 wmx %{buildroot}%{_bindir}/wmx
-%{__install} -D -m 0755 xnodecor %{buildroot}%{_bindir}/xnodecor
 %{__install} -d -m 0755 %{buildroot}%{_datadir}/%{name}
-%{__install} -m 0755 wmx-defaults-1/* %{buildroot}%{_datadir}/%{name}
+%{__install} -m 0755 wmx-defaults-2/* %{buildroot}%{_datadir}/%{name}
 %{__chmod} 0644 %{buildroot}%{_datadir}/%{name}/startup
 %{__install} -D -m 0644 %{SOURCE3} %{buildroot}%{_datadir}/xsessions/wmx.desktop
 %{__install} -D -m 0755 %{SOURCE4} %{buildroot}%{_sysconfdir}/X11/xinit/Xclients.d/Xclients.wmx.sh
@@ -54,6 +55,11 @@ configurable options.
 %{_sysconfdir}/X11/xinit/Xclients.d/*
 
 %changelog
+* Mon Jan 09 2012 Gabriel Somlo <somlo at cmu.edu> 7-9.20120109svn
+- upgrade to latest svn checkout
+- updated defaults
+- dropped xnodecor
+
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 7-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list