Sawfish
Line 53: Line 53:
   
 
{{yes}} The bug is really in Mathematica but unfortunately we cannot fix it there and have to settle for this. The diff appears to be broken so I had to apply it by hand. Formatting could be improved by adding newlines to break long lisp expressions. [[User:Tkorvola|Tkorvola]] 19:11, 9 March 2009 (UTC)
 
{{yes}} The bug is really in Mathematica but unfortunately we cannot fix it there and have to settle for this. The diff appears to be broken so I had to apply it by hand. Formatting could be improved by adding newlines to break long lisp expressions. [[User:Tkorvola|Tkorvola]] 19:11, 9 March 2009 (UTC)
  +
  +
* {{yes}} commited [[User:Flashrider|Flashrider [Christopher Bratusek]]] 08:52, 2 May 2009 (UTC)

Revision as of 08:52, 2 May 2009

Browse all patches

Author

Martin Mares, mj@ucw.cz

Synopsis

When an application sets the WM_CLASS property in a way that it contains only the application name, but no class, Sawfish catches a bad argument signal and leaves the window undecorated. This happens for example with version 7.0 of Mathematica. I have hunted the problem down to two calls of aref on the string array representing WM_CLASS. The fix is simple: always check that the array has at least two elements when asking for the 2nd one.

Patch

Index: lisp/sawfish/wm/ext/match-window.jl
===================================================================
--- lisp/sawfish/wm/ext/match-window.jl (revision 4402)
+++ lisp/sawfish/wm/ext/match-window.jl (working copy)
@@ -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)
Index: lisp/sawfish/wm/windows.jl
===================================================================
--- lisp/sawfish/wm/windows.jl  (revision 4402)
+++ lisp/sawfish/wm/windows.jl  (working copy)
@@ -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

Community's reasons for inclusion or rejection

When voting anonymously please write your name, so that it can be associated with your posts on the mailing list. If you are logged in you can sign yourself by typing four tilda characters: ~~~~.

  • Please vote with: Yes vote: yes., No vote: no., Try vote: let's try in experimental., Wtf vote: pondering. or Suspend wait for next release.

Yes vote: yes. Martin Mares (author's vote). It fixes an annoying bug. While it is not clear that the fix is complete, it definitely helps in all cases known to me.

Yes vote: yes. The bug is really in Mathematica but unfortunately we cannot fix it there and have to settle for this. The diff appears to be broken so I had to apply it by hand. Formatting could be improved by adding newlines to break long lisp expressions. Tkorvola 19:11, 9 March 2009 (UTC)