sawfish r4469 - in trunk: . lisp/sawfish/wm lisp/sawfish/wm/ext man



Author: chrisb
Date: Sun Apr  5 14:06:00 2009
New Revision: 4469
URL: http://svn.gnome.org/viewvc/sawfish?rev=4469&view=rev

Log:
2009-04-05  Christopher Bratusek <zanghar freenet de>
        * lisp/sawfish/wm/ext/match-window.jl
        * lisp/sawfish/wm/windows.jl: Make Sawfish more error-tolerant if an app has an icomplete WM_CLASS

Modified:
   trunk/CONTRIBUTING
   trunk/ChangeLog
   trunk/lisp/sawfish/wm/ext/match-window.jl
   trunk/lisp/sawfish/wm/windows.jl
   trunk/man/news.texi

Modified: trunk/CONTRIBUTING
==============================================================================
--- trunk/CONTRIBUTING	(original)
+++ trunk/CONTRIBUTING	Sun Apr  5 14:06:00 2009
@@ -85,6 +85,7 @@
  - Ian Dall for update spec-file patch
  - Jonathan Sambrook for Maximize fullscreen xinerama patch
  - Mark Schreiber for move-window-"direction" focus patch
+ - Martin Mares for Avoid errors on windows with no class patch
  - Michael Järmann specfile/glib issue/imlib issue
  - Nathan Froyd for updated tab-system
  - Philippe-Pierre for typo fix

Modified: trunk/lisp/sawfish/wm/ext/match-window.jl
==============================================================================
--- trunk/lisp/sawfish/wm/ext/match-window.jl	(original)
+++ trunk/lisp/sawfish/wm/ext/match-window.jl	Sun Apr  5 14:06:00 2009
@@ -243,7 +243,7 @@
     (let ((prop-cache '()))
 
       ;; Get the X property P of window W, uses a cache, will
-      ;; reformat properties with a match-window-formatter property 
+      ;; reformat properties with a match-window-formatter property
       (define (get-prop p)
 	(let
 	    ((tem (assq p prop-cache)))
@@ -312,7 +312,7 @@
 
   (define-match-window-formatter 'WM_CLASS
    (lambda (vec)
-     (format nil "%s/%s" (aref vec 1) (aref vec 0))))
+     (format nil "%s/%s" (and (> (length vec) 1) (aref vec 1)) (aref vec 0))))
 
   (define-match-window-formatter 'WM_COMMAND
    (lambda (vec)

Modified: trunk/lisp/sawfish/wm/windows.jl
==============================================================================
--- trunk/lisp/sawfish/wm/windows.jl	(original)
+++ trunk/lisp/sawfish/wm/windows.jl	Sun Apr  5 14:06:00 2009
@@ -201,7 +201,7 @@
     "Return the class that window W belongs to, as a string. Returns `nil' if W
 has no associated class."
     (let ((prop (get-x-text-property w 'WM_CLASS)))
-      (and prop (aref prop 1))))
+      (and prop (> (length prop) 1) (aref prop 1))))
 
   (define (get-window-wm-protocols w)
     "Return a list of symbols defining the X11 window manager protocols
@@ -469,7 +469,7 @@
                        (t (list prop)))
                  fun)
            prop-changes)))
-  
+
   (add-hook 'property-notify-hook
 	    (lambda (w prop state)
 	      (mapc (lambda (cell)
@@ -478,7 +478,7 @@
 		    prop-changes)))
 
   (define state-changes '())
-  
+
   (define (call-after-state-changed states fun)
     "Arrange for function FUN to be called with arguments (WINDOW
 CHANGED-STATES) when one of the states defined by the list of symbols
@@ -486,7 +486,7 @@
     (setq state-changes (cons (cons (if (listp states)
 					states
 				      (list states)) fun) state-changes)))
-  
+
   (add-hook
    'window-state-change-hook
    (lambda (w states)

Modified: trunk/man/news.texi
==============================================================================
--- trunk/man/news.texi	(original)
+++ trunk/man/news.texi	Sun Apr  5 14:06:00 2009
@@ -51,13 +51,15 @@
 
 @item Make "make uninstall" work again [Christopher Bratusek]
 
- item Iconify before repyfying (as requested by WM_HINTS) [Ian Zimmerman]
+ item Iconify before repyfying (as requested by WM_HINTS) [Ian Zimmerman/Teika]
 
 @item First create $data/applications, then install the desktop file [Christopher Bratusek]
 
 @item Fixed default animation outline coordinates [Christopher Bratusek]
 
 @item Don't ignore datarootdir setting [Christopher Bratusek]
+
+ item Make Sawfish more error-tolerant if an app has an icomplete WM_CLASS [Martin Mares]
 @end itemize
 
 @item New features:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]