[clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-12-g5e8514a

Philippe Brochard pbrochard at common-lisp.net
Tue Jan 3 21:45:55 UTC 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager".

The branch, master has been updated
       via  5e8514a2cde78233d5d956de63a8e359ebecba3f (commit)
      from  5b3e106b3a935888b50718bf9dd6b1321454540c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5e8514a2cde78233d5d956de63a8e359ebecba3f
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date:   Tue Jan 3 22:45:43 2012 +0100

    src/xlib-util.lisp (handle-event): Fix a clisp/new-clx error when sometimes window slot of event-slots is a pixmap instead of a window.

diff --git a/ChangeLog b/ChangeLog
index 5c2c983..a3b890b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-03  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/xlib-util.lisp (handle-event): Fix a clisp/new-clx error
+	when sometimes window slot of event-slots is a pixmap instead of a
+	window.
+
 2011-12-26  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-query.lisp: Fill the history list with a non-nil
diff --git a/src/clfswm.lisp b/src/clfswm.lisp
index 23a3bdd..97ce8a9 100644
--- a/src/clfswm.lisp
+++ b/src/clfswm.lisp
@@ -155,7 +155,7 @@
   (loop
      (call-hook *loop-hook*)
      (process-timers)
-     (with-xlib-protect
+     (with-xlib-protect ()
        (when (xlib:event-listen *display* *loop-timeout*)
 	 (xlib:process-event *display* :handler #'handle-event))
        (xlib:display-finish-output *display*))))
diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp
index 0b4ba6c..93be3b6 100644
--- a/src/xlib-util.lisp
+++ b/src/xlib-util.lisp
@@ -63,7 +63,7 @@ Window types are in +WINDOW-TYPES+.")
   "Alist mapping NETWM window types to keywords.")
 
 
-(defmacro with-xlib-protect (&body body)
+(defmacro with-xlib-protect (() &body body)
   "Prevent Xlib errors"
   `(handler-case
        (with-simple-restart (top-level "Return to clfswm's top level")
@@ -171,8 +171,30 @@ Expand in handle-event-fun-main-mode-key-press"
 
 
 
+;;; Workaround for pixmap error taken from STUMPWM - thanks:
+;; XXX: In both the clisp and sbcl clx libraries, sometimes what
+;; should be a window will be a pixmap instead. In this case, we
+;; need to manually translate it to a window to avoid breakage
+;; in stumpwm. So far the only slot that seems to be affected is
+;; the :window slot for configure-request and reparent-notify
+;; events. It appears as though the hash table of XIDs and clx
+;; structures gets out of sync with X or perhaps X assigns a
+;; duplicate ID for a pixmap and a window.
+(defun make-xlib-window (xobject)
+  "For some reason the clx xid cache screws up returns pixmaps when
+they should be windows. So use this function to make a window out of them."
+  #+clisp (make-instance 'xlib:window :id (slot-value xobject 'xlib::id) :display *display*)
+  #+(or sbcl ecl openmcl) (xlib::make-window :id (slot-value xobject 'xlib::id) :display *display*)
+  #-(or sbcl clisp ecl openmcl)
+  (error 'not-implemented))
+
+
 (defun handle-event (&rest event-slots &key event-key &allow-other-keys)
-  (with-xlib-protect
+  (with-xlib-protect ()
+    (let ((win (getf event-slots :window)))
+      (when (and win (not (xlib:window-p win)))
+        (dbg "Pixmap Workaround! Should be a window: " win)
+        (setf (getf event-slots :window) (make-xlib-window win))))
     (if (fboundp event-key)
 	(apply event-key event-slots)
 	#+:event-debug (pushnew (list *current-event-mode* event-key) *unhandled-events* :test #'equal))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    6 ++++++
 src/clfswm.lisp    |    2 +-
 src/xlib-util.lisp |   26 ++++++++++++++++++++++++--
 3 files changed, 31 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CLFSWM - A(nother) Common Lisp FullScreen Window Manager




More information about the clfswm-cvs mailing list