From pbrochard at common-lisp.net Wed Dec 14 21:05:46 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 14 Dec 2011 13:05:46 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-8-g3a1cb00 Message-ID: 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 3a1cb00e971dfcd21d716795e71729af22f99e71 (commit) from 51b0a027b1e29efb046d40f4962095fdbb3d2fe8 (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 3a1cb00e971dfcd21d716795e71729af22f99e71 Author: Philippe Brochard Date: Wed Dec 14 22:05:37 2011 +0100 src/clfswm-util.lisp (update-menus): Set a default value for searching .desktop files when XDG_DATA_DIRS is not set. diff --git a/ChangeLog b/ChangeLog index a3e8984..a3bbf34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-12-14 Philippe Brochard + + * src/clfswm-util.lisp (update-menus): Set a default value for + searching .desktop files when XDG_DATA_DIRS is not set. + 2011-10-15 Philippe Brochard * src/clfswm-internal.lisp (place-window-from-hints): Use diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 615f123..c5b0909 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -1318,7 +1318,8 @@ For window: set current child to window or its parent according to window-parent (let ((count 0) (found (make-hash-table :test #'equal))) (dolist (dir (remove-duplicates - (split-string (getenv "XDG_DATA_DIRS") #\:) :test #'string-equal)) + (split-string (or (getenv "XDG_DATA_DIRS") "/usr/local/share/:/usr/share/") + #\:) :test #'string-equal)) (dolist (desktop (directory (concatenate 'string dir "/applications/**/*.desktop"))) (unless (gethash (file-namestring desktop) found) (setf (gethash (file-namestring desktop) found) t) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ src/clfswm-util.lisp | 3 ++- 2 files changed, 7 insertions(+), 1 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Wed Dec 14 21:31:09 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 14 Dec 2011 13:31:09 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-9-g50f809f Message-ID: 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 50f809fd65c495b2216993f66a984bf6f4a8c5de (commit) from 3a1cb00e971dfcd21d716795e71729af22f99e71 (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 50f809fd65c495b2216993f66a984bf6f4a8c5de Author: Philippe Brochard Date: Wed Dec 14 22:31:02 2011 +0100 src/clfswm-util.lisp (um-create-xdg-section-list): Add at least the 'Utility menu entry. src/config.lisp (*xdg-section-list*): moved to config.lisp. diff --git a/ChangeLog b/ChangeLog index a3bbf34..4ea4b32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-12-14 Philippe Brochard + * src/clfswm-util.lisp (um-create-xdg-section-list): Add at least + the 'Utility menu entry. + + * src/config.lisp (*xdg-section-list*): moved to config.lisp. + * src/clfswm-util.lisp (update-menus): Set a default value for searching .desktop files when XDG_DATA_DIRS is not set. diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index c5b0909..280f733 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -1263,15 +1263,11 @@ For window: set current child to window or its parent according to window-parent ;;; Standard menu functions - Based on the XDG specifications -(defconfig *xdg-section-list* (append '(TextEditor FileManager WebBrowser) - '(AudioVideo Audio Video Development Education Game Graphics Network Office Settings System Utility) - '(TerminalEmulator Archlinux Screensaver)) - 'Menu "Standard menu sections") - - (defun um-create-xdg-section-list (menu) (dolist (section *xdg-section-list*) - (add-sub-menu menu :next section (format nil "~A" section) menu))) + (add-sub-menu menu :next section (format nil "~A" section) menu)) + (unless (find-toplevel-menu 'Utility menu) + (add-sub-menu menu :next 'Utility (format nil "~A" 'Utility) menu))) (defun um-find-submenu (menu section-list) (let ((acc nil)) diff --git a/src/config.lisp b/src/config.lisp index b656b68..85d828b 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -37,6 +37,16 @@ Example: :mod-2 for num_lock, :lock for Caps_lock...") +;;; Standard menu entry based on the XDG specifications +(defconfig *xdg-section-list* (append + '(TextEditor FileManager WebBrowser) + '(AudioVideo Audio Video Development Education Game Graphics Network + Office Settings System Utility) + '(TerminalEmulator Screensaver)) + 'Menu "Standard menu sections") + + + (defun-equal-wm-class equal-wm-class-rox-pinboard "ROX-Pinboard") (defun-equal-wm-class equal-wm-class-xvkbd "xvkbd") ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ src/clfswm-util.lisp | 10 +++------- src/config.lisp | 10 ++++++++++ 3 files changed, 18 insertions(+), 7 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Thu Dec 22 21:34:24 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Thu, 22 Dec 2011 13:34:24 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch fix-type-error created. R-1106-10-g1990938 Message-ID: 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, fix-type-error has been created at 1990938dd3f3e2c2574609341ce5d912adebbbe1 (commit) - Log ----------------------------------------------------------------- commit 1990938dd3f3e2c2574609341ce5d912adebbbe1 Author: Philippe Brochard Date: Thu Dec 22 22:32:46 2011 +0100 src/xlib-util.lisp: add an xlib:drawable-* wrapper to prevent and debug xlib type errors in some CLX versions. diff --git a/ChangeLog b/ChangeLog index 4ea4b32..f39750b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-12-22 Philippe Brochard + + * src/xlib-util.lisp: add an xlib:drawable-* wrapper to prevent + and debug xlib type errors in some CLX versions. + 2011-12-14 Philippe Brochard * src/clfswm-util.lisp (um-create-xdg-section-list): Add at least diff --git a/src/clfswm-expose-mode.lisp b/src/clfswm-expose-mode.lisp index 33c3e8f..5039b2d 100644 --- a/src/clfswm-expose-mode.lisp +++ b/src/clfswm-expose-mode.lisp @@ -89,7 +89,7 @@ ,(format nil "Select child '~A' (~A)" (number->string n) n) (let ((child (nth ,n *expose-windows-list*))) (when child - (xlib:warp-pointer *root* (xlib:drawable-x (first child)) (xlib:drawable-y (first child))) + (xlib:warp-pointer *root* (x-drawable-x (first child)) (x-drawable-y (first child))) (setf *expose-selected-child* (fourth child)) (when *expose-valid-on-key* (valid-expose-mode))))) diff --git a/src/clfswm-info.lisp b/src/clfswm-info.lisp index 438e4b3..0d0b36b 100644 --- a/src/clfswm-info.lisp +++ b/src/clfswm-info.lisp @@ -51,10 +51,10 @@ (defun find-info-item-from-mouse (root-x root-y info) - (if (< (xlib:drawable-x (info-window info)) root-x - (+ (xlib:drawable-x (info-window info)) - (xlib:drawable-width (info-window info)))) - (truncate (/ (- (+ (- root-y (xlib:drawable-y (info-window info))) + (if (< (x-drawable-x (info-window info)) root-x + (+ (x-drawable-x (info-window info)) + (x-drawable-width (info-window info)))) + (truncate (/ (- (+ (- root-y (x-drawable-y (info-window info))) (xlib:max-char-ascent (info-font info)) (info-y info)) (info-ilh info)) (info-ilh info))) nil)) @@ -135,8 +135,8 @@ "Move one line down" (incf-info-selected-item info 1) (when (> (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) - (xlib:drawable-height (info-window info)))) + (+ (x-drawable-y (info-window info)) + (x-drawable-height (info-window info)))) (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Up") @@ -144,7 +144,7 @@ "Move one line up" (decf-info-selected-item info 1) (when (< (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) + (+ (x-drawable-y (info-window info)) (info-ilh info))) (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0))) (draw-info-window info))) @@ -169,7 +169,7 @@ (defun info-end-line (info) "Move to last line" (setf (info-x info) 0 - (info-y info) (- (* (length (info-list info)) (info-ilh info)) (xlib:drawable-height (info-window info)))) + (info-y info) (- (* (length (info-list info)) (info-ilh info)) (x-drawable-height (info-window info)))) (setf *info-selected-item* (1- (or (length (info-list info)) 1))) (draw-info-window info))) (define-info-key ("Page_Down") @@ -177,8 +177,8 @@ "Move ten lines down" (incf-info-selected-item info 10) (when (> (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) - (xlib:drawable-height (info-window info)))) + (+ (x-drawable-y (info-window info)) + (x-drawable-height (info-window info)))) (setf (info-y info) (min (+ (info-y info) (* (info-ilh info) 10)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Page_Up") @@ -186,7 +186,7 @@ "Move ten lines up" (decf-info-selected-item info 10) (when (< (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) + (+ (x-drawable-y (info-window info)) (info-ilh info))) (setf (info-y info) (max (- (info-y info) (* (info-ilh info) 10)) 0))) (draw-info-window info)))) diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index 86759f7..e3a6c03 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -91,8 +91,8 @@ (defun in-window (window x y) (and (xlib:window-p window) - (<= (xlib:drawable-x window) x (+ (xlib:drawable-x window) (xlib:drawable-width window))) - (<= (xlib:drawable-y window) y (+ (xlib:drawable-y window) (xlib:drawable-height window))))) + (<= (x-drawable-x window) x (+ (x-drawable-x window) (x-drawable-width window))) + (<= (x-drawable-y window) y (+ (x-drawable-y window) (x-drawable-height window))))) (defgeneric in-child (child x y)) @@ -239,37 +239,37 @@ (defgeneric child-x (child)) (defmethod child-x ((child xlib:window)) - (xlib:drawable-x child)) + (x-drawable-x child)) (defmethod child-x ((child frame)) (frame-rx child)) (defgeneric child-y (child)) (defmethod child-y ((child xlib:window)) - (xlib:drawable-y child)) + (x-drawable-y child)) (defmethod child-y ((child frame)) (frame-ry child)) (defgeneric child-width (child)) (defmethod child-width ((child xlib:window)) - (xlib:drawable-width child)) + (x-drawable-width child)) (defmethod child-width ((child frame)) (frame-rw child)) (defgeneric child-height (child)) (defmethod child-height ((child xlib:window)) - (xlib:drawable-height child)) + (x-drawable-height child)) (defmethod child-height ((child frame)) (frame-rh child)) (defgeneric child-x2 (child)) (defmethod child-x2 ((child xlib:window)) - (+ (xlib:drawable-x child) (xlib:drawable-width child))) + (+ (x-drawable-x child) (x-drawable-width child))) (defmethod child-x2 ((child frame)) (+ (frame-rx child) (frame-rw child))) (defgeneric child-y2 (child)) (defmethod child-y2 ((child xlib:window)) - (+ (xlib:drawable-y child) (xlib:drawable-height child))) + (+ (x-drawable-y child) (x-drawable-height child))) (defmethod child-y2 ((child frame)) (+ (frame-ry child) (frame-rh child))) @@ -278,8 +278,8 @@ (defgeneric child-center (child)) (defmethod child-center ((child xlib:window)) - (values (+ (xlib:drawable-x child) (/ (xlib:drawable-width child) 2)) - (+ (xlib:drawable-y child) (/ (xlib:drawable-height child) 2)))) + (values (+ (x-drawable-x child) (/ (x-drawable-width child) 2)) + (+ (x-drawable-y child) (/ (x-drawable-height child) 2)))) (defmethod child-center ((child frame)) (values (+ (frame-rx child) (/ (frame-rw child) 2)) @@ -303,16 +303,16 @@ (defgeneric adj-border-wh (value child)) (defmethod adj-border-xy (v (child xlib:window)) - (+ v (xlib:drawable-border-width child))) + (+ v (x-drawable-border-width child))) (defmethod adj-border-xy (v (child frame)) - (+ v (xlib:drawable-border-width (frame-window child)))) + (+ v (x-drawable-border-width (frame-window child)))) (defmethod adj-border-wh (v (child xlib:window)) - (- v (* (xlib:drawable-border-width child) 2))) + (- v (* (x-drawable-border-width child) 2))) (defmethod adj-border-wh (v (child frame)) - (- v (* (xlib:drawable-border-width (frame-window child)) 2))) + (- v (* (x-drawable-border-width (frame-window child)) 2))) (declaim (inline anti-adj-border-xy anti-adj-border-wh)) @@ -320,16 +320,16 @@ (defgeneric anti-adj-border-wh (value child)) (defmethod anti-adj-border-xy (v (child xlib:window)) - (- v (xlib:drawable-border-width child))) + (- v (x-drawable-border-width child))) (defmethod anti-adj-border-xy (v (child frame)) - (- v (xlib:drawable-border-width (frame-window child)))) + (- v (x-drawable-border-width (frame-window child)))) (defmethod anti-adj-border-wh (v (child xlib:window)) - (+ v (* (xlib:drawable-border-width child) 2))) + (+ v (* (x-drawable-border-width child) 2))) (defmethod anti-adj-border-wh (v (child frame)) - (+ v (* (xlib:drawable-border-width (frame-window child)) 2))) + (+ v (* (x-drawable-border-width (frame-window child)) 2))) @@ -514,10 +514,10 @@ "Place a frame from real (pixel) coordinates" (when (and (frame-p frame) (frame-p parent)) (with-slots (window x y w h) frame - (setf (xlib:drawable-x window) prx - (xlib:drawable-y window) pry - (xlib:drawable-width window) prw - (xlib:drawable-height window) prh + (setf (x-drawable-x window) prx + (x-drawable-y window) pry + (x-drawable-width window) prw + (x-drawable-height window) prh x (x-px->fl prx parent) y (y-px->fl pry parent) w (w-px->fl prw parent) @@ -684,8 +684,8 @@ (funcall it child parent) (no-layout child parent)) (get-fullscreen-size)) - (values (xlib:drawable-x child) (xlib:drawable-y child) - (xlib:drawable-width child) (xlib:drawable-height child))))) + (values (x-drawable-x child) (x-drawable-y child) + (x-drawable-width child) (x-drawable-height child))))) @@ -698,30 +698,30 @@ (multiple-value-bind (nx ny nw nh) (get-parent-layout window parent) (setf nw (max nw 1) nh (max nh 1)) - (let ((change (or (/= (xlib:drawable-x window) nx) - (/= (xlib:drawable-y window) ny) - (/= (xlib:drawable-width window) nw) - (/= (xlib:drawable-height window) nh)))) + (let ((change (or (/= (x-drawable-x window) nx) + (/= (x-drawable-y window) ny) + (/= (x-drawable-width window) nw) + (/= (x-drawable-height window) nh)))) (when change - (setf (xlib:drawable-x window) nx - (xlib:drawable-y window) ny - (xlib:drawable-width window) nw - (xlib:drawable-height window) nh)) + (setf (x-drawable-x window) nx + (x-drawable-y window) ny + (x-drawable-width window) nw + (x-drawable-height window) nh)) change)))) (defmethod adapt-child-to-parent ((frame frame) parent) (declare (ignore parent)) (with-slots (rx ry rw rh window) frame - (let ((change (or (/= (xlib:drawable-x window) rx) - (/= (xlib:drawable-y window) ry) - (/= (xlib:drawable-width window) rw) - (/= (xlib:drawable-height window) rh)))) + (let ((change (or (/= (x-drawable-x window) rx) + (/= (x-drawable-y window) ry) + (/= (x-drawable-width window) rw) + (/= (x-drawable-height window) rh)))) (when change - (setf (xlib:drawable-x window) rx - (xlib:drawable-y window) ry - (xlib:drawable-width window) rw - (xlib:drawable-height window) rh)) + (setf (x-drawable-x window) rx + (x-drawable-y window) ry + (x-drawable-width window) rw + (x-drawable-height window) rh)) change))) (defmethod adapt-child-to-parent (child parent) @@ -850,15 +850,15 @@ (child-rect-child rect))) (frame (frame-window (child-rect-child rect)))))) (when window - (let ((change (or (/= (xlib:drawable-x window) (child-rect-x rect)) - (/= (xlib:drawable-y window) (child-rect-y rect)) - (/= (xlib:drawable-width window) (child-rect-w rect)) - (/= (xlib:drawable-height window) (child-rect-h rect))))) + (let ((change (or (/= (x-drawable-x window) (child-rect-x rect)) + (/= (x-drawable-y window) (child-rect-y rect)) + (/= (x-drawable-width window) (child-rect-w rect)) + (/= (x-drawable-height window) (child-rect-h rect))))) (when change - (setf (xlib:drawable-x window) (child-rect-x rect) - (xlib:drawable-y window) (child-rect-y rect) - (xlib:drawable-width window) (child-rect-w rect) - (xlib:drawable-height window) (child-rect-h rect))) + (setf (x-drawable-x window) (child-rect-x rect) + (x-drawable-y window) (child-rect-y rect) + (x-drawable-width window) (child-rect-w rect) + (x-drawable-height window) (child-rect-h rect))) change)))) @@ -1197,17 +1197,17 @@ Warning:frame window and gc are freeed." (let* ((hints (xlib:wm-normal-hints window)) (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0)) (min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0)) - (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (xlib:drawable-width *root*))) - (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (xlib:drawable-height *root*))) + (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (x-drawable-width *root*))) + (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (x-drawable-height *root*))) (rwidth (or (and hints (or (xlib:wm-size-hints-width hints) (xlib:wm-size-hints-base-width hints))) - (xlib:drawable-width window))) + (x-drawable-width window))) (rheight (or (and hints (or (xlib:wm-size-hints-height hints) (xlib:wm-size-hints-base-height hints))) - (xlib:drawable-height window)))) - (setf (xlib:drawable-width window) (min (max min-width rwidth *default-window-width*) max-width) - (xlib:drawable-height window) (min (max min-height rheight *default-window-height*) max-height)) - (with-placement (*unmanaged-window-placement* x y (xlib:drawable-width window) (xlib:drawable-height window)) - (setf (xlib:drawable-x window) x - (xlib:drawable-y window) y)) + (x-drawable-height window)))) + (setf (x-drawable-width window) (min (max min-width rwidth *default-window-width*) max-width) + (x-drawable-height window) (min (max min-height rheight *default-window-height*) max-height)) + (with-placement (*unmanaged-window-placement* x y (x-drawable-width window) (x-drawable-height window)) + (setf (x-drawable-x window) x + (x-drawable-y window) y)) (xlib:display-finish-output *display*))) @@ -1229,7 +1229,7 @@ windows), this function dresses the window up and gets it ready to be managed." (setf (xlib:window-event-mask window) *window-events*) (set-window-state window +normal-state+) - (setf (xlib:drawable-border-width window) (case (window-type window) + (setf (x-drawable-border-width window) (case (window-type window) (:normal *border-size*) (:maxsize *border-size*) (:transient *border-size*) diff --git a/src/clfswm-pack.lisp b/src/clfswm-pack.lisp index e635809..16434b7 100644 --- a/src/clfswm-pack.lisp +++ b/src/clfswm-pack.lisp @@ -235,10 +235,10 @@ (labels ((readjust-all-frames-fl-size (parent) (dolist (child (frame-child parent)) (when (frame-p child) - (setf (frame-x child) (x-px->fl (xlib:drawable-x (frame-window child)) parent) - (frame-y child) (y-px->fl (xlib:drawable-y (frame-window child)) parent) - (frame-w child) (w-px->fl (anti-adj-border-wh (xlib:drawable-width (frame-window child)) parent) parent) - (frame-h child) (h-px->fl (anti-adj-border-wh (xlib:drawable-height (frame-window child)) parent) parent)))))) + (setf (frame-x child) (x-px->fl (x-drawable-x (frame-window child)) parent) + (frame-y child) (y-px->fl (x-drawable-y (frame-window child)) parent) + (frame-w child) (w-px->fl (anti-adj-border-wh (x-drawable-width (frame-window child)) parent) parent) + (frame-h child) (h-px->fl (anti-adj-border-wh (x-drawable-height (frame-window child)) parent) parent)))))) (defun move-frame-constrained (frame parent orig-x orig-y) (when (and frame parent (not (child-equal-p frame *current-root*))) (hide-all-children frame) @@ -250,32 +250,32 @@ (lambda () (let ((move-x t) (move-y t)) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent)) + (setf (frame-x frame) (x-px->fl (x-drawable-x window) parent) + (frame-y frame) (y-px->fl (x-drawable-y window) parent)) (multiple-value-bind (x y) (xlib:query-pointer *root*) (when (> x lx) (let ((x-found (x-fl->px (find-edge-right frame parent) parent))) (when (< (abs (- x-found (window-x2 window))) *snap-size*) - (setf (xlib:drawable-x window) (- x-found (adj-border-xy (xlib:drawable-width window) window)) - (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (setf (x-drawable-x window) (- x-found (adj-border-xy (x-drawable-width window) window)) + (frame-x frame) (x-px->fl (x-drawable-x window) parent) move-x nil)))) (when (< x lx) (let ((x-found (x-fl->px (find-edge-left frame parent) parent))) - (when (< (abs (- x-found (xlib:drawable-x window))) *snap-size*) - (setf (xlib:drawable-x window) (adj-border-xy x-found window) - (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (when (< (abs (- x-found (x-drawable-x window))) *snap-size*) + (setf (x-drawable-x window) (adj-border-xy x-found window) + (frame-x frame) (x-px->fl (x-drawable-x window) parent) move-x nil)))) (when (> y ly) (let ((y-found (y-fl->px (find-edge-down frame parent) parent))) (when (< (abs (- y-found (window-y2 window))) *snap-size*) - (setf (xlib:drawable-y window) (- y-found (adj-border-xy (xlib:drawable-height window) window)) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent) + (setf (x-drawable-y window) (- y-found (adj-border-xy (x-drawable-height window) window)) + (frame-y frame) (y-px->fl (x-drawable-y window) parent) move-y nil)))) (when (< y ly) (let ((y-found (y-fl->px (find-edge-up frame parent) parent))) - (when (< (abs (- y-found (xlib:drawable-y window))) *snap-size*) - (setf (xlib:drawable-y window) (adj-border-xy y-found window) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent) + (when (< (abs (- y-found (x-drawable-y window))) *snap-size*) + (setf (x-drawable-y window) (adj-border-xy y-found window) + (frame-y frame) (y-px->fl (x-drawable-y window) parent) move-y nil)))) (display-frame-info frame) (when move-x (setf lx x)) @@ -296,21 +296,21 @@ (let ((resize-w t) (resize-h t)) (multiple-value-bind (x y) (xlib:query-pointer *root*) - (setf (frame-w frame) (w-px->fl (anti-adj-border-wh (xlib:drawable-width window) parent) parent) - (frame-h frame) (h-px->fl (anti-adj-border-wh (xlib:drawable-height window) parent) parent)) + (setf (frame-w frame) (w-px->fl (anti-adj-border-wh (x-drawable-width window) parent) parent) + (frame-h frame) (h-px->fl (anti-adj-border-wh (x-drawable-height window) parent) parent)) (when (> x lx) (let ((x-found (x-fl->px (find-edge-right frame parent) parent))) (when (< (abs (- x-found (window-x2 window))) *snap-size*) - (setf (xlib:drawable-width window) (+ (xlib:drawable-width window) + (setf (x-drawable-width window) (+ (x-drawable-width window) (- x-found (adj-border-xy (window-x2 window) parent))) - (frame-w frame) (w-px->fl (anti-adj-border-wh (xlib:drawable-width window) parent) parent) + (frame-w frame) (w-px->fl (anti-adj-border-wh (x-drawable-width window) parent) parent) resize-w nil)))) (when (> y ly) (let ((y-found (y-fl->px (find-edge-down frame parent) parent))) (when (< (abs (- y-found (window-y2 window))) *snap-size*) - (setf (xlib:drawable-height window) (+ (xlib:drawable-height window) + (setf (x-drawable-height window) (+ (x-drawable-height window) (- y-found (adj-border-xy (window-y2 window) parent))) - (frame-h frame) (h-px->fl (anti-adj-border-wh (xlib:drawable-height window) parent) parent) + (frame-h frame) (h-px->fl (anti-adj-border-wh (x-drawable-height window) parent) parent) resize-h nil)))) (display-frame-info frame) (when resize-w (setf lx x)) diff --git a/src/clfswm-placement.lisp b/src/clfswm-placement.lisp index c4167a5..4c4ccb0 100644 --- a/src/clfswm-placement.lisp +++ b/src/clfswm-placement.lisp @@ -107,10 +107,10 @@ ;;; (defun current-child-coord () (typecase *current-child* - (xlib:window (values (xlib:drawable-x *current-child*) - (xlib:drawable-y *current-child*) - (xlib:drawable-width *current-child*) - (xlib:drawable-height *current-child*))) + (xlib:window (values (x-drawable-x *current-child*) + (x-drawable-y *current-child*) + (x-drawable-width *current-child*) + (x-drawable-height *current-child*))) (frame (values (frame-rx *current-child*) (frame-ry *current-child*) (frame-rw *current-child*) diff --git a/src/clfswm-query.lisp b/src/clfswm-query.lisp index 4be8394..281a547 100644 --- a/src/clfswm-query.lisp +++ b/src/clfswm-query.lisp @@ -102,7 +102,7 @@ (defun query-print-string () - (let ((dec (min 0 (- (- (xlib:drawable-width *query-window*) 10) + (let ((dec (min 0 (- (- (x-drawable-width *query-window*) 10) (+ 10 (* *query-pos* (xlib:max-char-width *query-font*))))))) (clear-pixmap-buffer *query-window* *query-gc*) (setf (xlib:gcontext-foreground *query-gc*) (get-color *query-message-color*)) diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 280f733..e24f7f6 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -568,8 +568,8 @@ (hide-all-children frame) (with-slots (window) frame (move-window window orig-x orig-y #'display-frame-info (list frame)) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))) + (setf (frame-x frame) (x-px->fl (x-drawable-x window) parent) + (frame-y frame) (y-px->fl (x-drawable-y window) parent))) (show-all-children))) (defun resize-frame (frame parent orig-x orig-y) @@ -577,8 +577,8 @@ (hide-all-children frame) (with-slots (window) frame (resize-window window orig-x orig-y #'display-frame-info (list frame)) - (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) - (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))) + (setf (frame-w frame) (w-px->fl (x-drawable-width window) parent) + (frame-h frame) (h-px->fl (x-drawable-height window) parent))) (show-all-children))) @@ -982,8 +982,8 @@ For window: set current child to window or its parent according to window-parent "Force the current window to move in the frame (Useful only for unmanaged windows)" (with-current-window (let ((parent (find-parent-frame window))) - (setf (xlib:drawable-x window) (frame-rx parent) - (xlib:drawable-y window) (frame-ry parent)) + (setf (x-drawable-x window) (frame-rx parent) + (x-drawable-y window) (frame-ry parent)) (xlib:display-finish-output *display*))) (leave-second-mode)) @@ -992,12 +992,12 @@ For window: set current child to window or its parent according to window-parent "Force the current window to move in the center of the frame (Useful only for unmanaged windows)" (with-current-window (let ((parent (find-parent-frame window))) - (setf (xlib:drawable-x window) (truncate (+ (frame-rx parent) + (setf (x-drawable-x window) (truncate (+ (frame-rx parent) (/ (- (frame-rw parent) - (xlib:drawable-width window)) 2))) - (xlib:drawable-y window) (truncate (+ (frame-ry parent) + (x-drawable-width window)) 2))) + (x-drawable-y window) (truncate (+ (frame-ry parent) (/ (- (frame-rh parent) - (xlib:drawable-height window)) 2)))) + (x-drawable-height window)) 2)))) (xlib:display-finish-output *display*))) (leave-second-mode)) diff --git a/src/clfswm.lisp b/src/clfswm.lisp index 4e42f2e..fe5c68b 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -51,22 +51,22 @@ (has-bw (mask) (= 16 (logand mask 16))) (has-stackmode (mask) (= 64 (logand mask 64))) (adjust-from-request () - (when (has-x value-mask) (setf (xlib:drawable-x window) x)) - (when (has-y value-mask) (setf (xlib:drawable-y window) y)) - (when (has-h value-mask) (setf (xlib:drawable-height window) height)) - (when (has-w value-mask) (setf (xlib:drawable-width window) width)))) + (when (has-x value-mask) (setf (x-drawable-x window) x)) + (when (has-y value-mask) (setf (x-drawable-y window) y)) + (when (has-h value-mask) (setf (x-drawable-height window) height)) + (when (has-w value-mask) (setf (x-drawable-width window) width)))) (xlib:with-state (window) (when (has-bw value-mask) - (setf (xlib:drawable-border-width window) border-width)) + (setf (x-drawable-border-width window) border-width)) (if (find-child window *current-root*) (let ((parent (find-parent-frame window *current-root*))) (if (and parent (managed-window-p window parent)) (adapt-child-to-parent window parent) (adjust-from-request))) (adjust-from-request)) - (send-configuration-notify window (xlib:drawable-x window) (xlib:drawable-y window) - (xlib:drawable-width window) (xlib:drawable-height window) - (xlib:drawable-border-width window)) + (send-configuration-notify window (x-drawable-x window) (x-drawable-y window) + (x-drawable-width window) (x-drawable-height window) + (x-drawable-border-width window)) (when (has-stackmode value-mask) (case stack-mode (:above @@ -139,7 +139,7 @@ (cond ;; ignore asynchronous window errors ((and asynchronous - (find error-key '(xlib:window-error xlib:drawable-error xlib:match-error))) + (find error-key '(xlib:window-error x-drawable-error xlib:match-error))) (format t "Ignoring XLib asynchronous error: ~s~%" error-key)) ((eq error-key 'xlib:access-error) (write-line "Another window manager is running.") diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp index e93ca16..eb1b04c 100644 --- a/src/xlib-util.lisp +++ b/src/xlib-util.lisp @@ -86,10 +86,10 @@ Window types are in +WINDOW-TYPES+.") (declaim (inline window-x2 window-y2)) (defun window-x2 (window) - (+ (xlib:drawable-x window) (xlib:drawable-width window))) + (+ (x-drawable-x window) (x-drawable-width window))) (defun window-y2 (window) - (+ (xlib:drawable-y window) (xlib:drawable-height window))) + (+ (x-drawable-y window) (x-drawable-height window))) @@ -216,7 +216,6 @@ Expand in handle-event-fun-main-mode-key-press" (defsetf window-state set-window-state) - (defun window-hidden-p (window) (eql (window-state window) +iconic-state+)) @@ -320,7 +319,7 @@ Expand in handle-event-fun-main-mode-key-press" ;; (xlib:get-property window property-atom ;; :transform (when atom-list-p ;; (lambda (id) -;; (xlib:atom-name (xlib:drawable-display window) id))))) +;; (xlib:atom-name (x-drawable-display window) id))))) ;; ;;(defun set-atoms-property (window atoms property-atom &key (mode :replace)) ;; "Sets the property designates by `property-atom'. ATOMS is a list of atom-id @@ -329,7 +328,7 @@ Expand in handle-event-fun-main-mode-key-press" ;; :mode mode ;; :transform (unless (integerp (car atoms)) ;; (lambda (atom-key) -;; (xlib:find-atom (xlib:drawable-display window) atom-key))))) +;; (xlib:find-atom (x-drawable-display window) atom-key))))) ;; ;; ;; @@ -537,11 +536,11 @@ Expand in handle-event-fun-main-mode-key-press" (multiple-value-bind (move-x move-y) (apply add-fn add-arg) (when move-x - (setf (xlib:drawable-x window) (+ root-x dx))) + (setf (x-drawable-x window) (+ root-x dx))) (when move-y - (setf (xlib:drawable-y window) (+ root-y dy)))) - (setf (xlib:drawable-x window) (+ root-x dx) - (xlib:drawable-y window) (+ root-y dy))))) + (setf (x-drawable-y window) (+ root-y dy)))) + (setf (x-drawable-x window) (+ root-x dx) + (x-drawable-y window) (+ root-y dy))))) (define-handler move-window-mode :key-release () (throw 'exit-move-window-mode nil)) @@ -553,8 +552,8 @@ Expand in handle-event-fun-main-mode-key-press" (setf window orig-window add-fn additional-fn add-arg additional-arg - dx (- (xlib:drawable-x window) orig-x) - dy (- (xlib:drawable-y window) orig-y) + dx (- (x-drawable-x window) orig-x) + dy (- (x-drawable-y window) orig-y) (xlib:window-border window) (get-color *color-move-window*)) (raise-window window) (let ((pointer-grabbed-p (xgrab-pointer-p))) @@ -579,11 +578,11 @@ Expand in handle-event-fun-main-mode-key-press" (multiple-value-bind (resize-w resize-h) (apply add-fn add-arg) (when resize-w - (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width))) + (setf (x-drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width))) (when resize-h - (setf (xlib:drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height)))) - (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width) - (xlib:drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height))))) + (setf (x-drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height)))) + (setf (x-drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width) + (x-drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height))))) (define-handler resize-window-mode :key-release () (throw 'exit-resize-window-mode nil)) @@ -599,8 +598,8 @@ Expand in handle-event-fun-main-mode-key-press" add-arg additional-arg o-x orig-x o-y orig-y - orig-width (xlib:drawable-width window) - orig-height (xlib:drawable-height window) + orig-width (x-drawable-width window) + orig-height (x-drawable-height window) min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0) min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0) max-width (or (and hints (xlib:wm-size-hints-max-width hints)) most-positive-fixnum) @@ -820,13 +819,13 @@ Expand in handle-event-fun-main-mode-key-press" (defun clear-pixmap-buffer (window gc) (rotatef (xlib:gcontext-foreground gc) (xlib:gcontext-background gc)) (xlib:draw-rectangle *pixmap-buffer* gc - 0 0 (xlib:drawable-width window) (xlib:drawable-height window) + 0 0 (x-drawable-width window) (x-drawable-height window) t) (rotatef (xlib:gcontext-foreground gc) (xlib:gcontext-background gc))) (defun copy-pixmap-buffer (window gc) (xlib:copy-area *pixmap-buffer* gc - 0 0 (xlib:drawable-width window) (xlib:drawable-height window) + 0 0 (x-drawable-width window) (x-drawable-height window) window 0 0)) @@ -845,3 +844,68 @@ Expand in handle-event-fun-main-mode-key-press" `(defun ,symbol (window) (when (xlib:window-p window) (string-equal (xlib:wm-name window) ,name)))) + + +;;; Drawable wrapper to prevent type error in some CLX versions +(declaim (inline x-drawable-x x-drawable-y + x-drawable-width x-drawable-height + x-drawable-border-width)) + +;; X +(defun x-drawable-x (window) + (xlib:drawable-x window)) + +(defun set-x-drawable-x (window x) + (if (typep x '(signed-byte 16)) + (setf (xlib:drawable-x window) x) + (dbg 'x-type-error window x (xlib:wm-name window)))) + +(defsetf x-drawable-x set-x-drawable-x) + +;; Y +(defun x-drawable-y (window) + (xlib:drawable-y window)) + +(defun set-x-drawable-y (window y) + (if (typep y '(signed-byte 16)) + (setf (xlib:drawable-y window) y) + (dbg 'y-type-error window y (xlib:wm-name window)))) + +(defsetf x-drawable-y set-x-drawable-y) + +;; Width +(defun x-drawable-width (window) + (xlib:drawable-width window)) + +(defun set-x-drawable-width (window width) + (if (typep width '(unsigned-byte 16)) + (setf (xlib:drawable-width window) width) + (dbg 'width-type-error window width (xlib:wm-name window)))) + +(defsetf x-drawable-width set-x-drawable-width) + +;; Height +(defun x-drawable-height (window) + (xlib:drawable-height window)) + +(defun set-x-drawable-height (window height) + (if (typep height '(unsigned-byte 16)) + (setf (xlib:drawable-height window) height) + (dbg 'height-type-error window height (xlib:wm-name window)))) + +(defsetf x-drawable-height set-x-drawable-height) + +;; Border +(defun x-drawable-border-width (window) + (xlib:drawable-border-width window)) + +(defun set-x-drawable-border-width (window border-width) + (if (typep border-width '(unsigned-byte 16)) + (setf (xlib:drawable-border-width window) border-width) + (dbg 'border-width-type-error window border-width (xlib:wm-name window)))) + +(defsetf x-drawable-border-width set-x-drawable-border-width) + + + + ----------------------------------------------------------------------- hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Sun Dec 25 22:27:27 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 25 Dec 2011 14:27:27 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-10-g913155a Message-ID: 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 913155a1338d632096e5269bdf48e03053dd9528 (commit) from 50f809fd65c495b2216993f66a984bf6f4a8c5de (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 913155a1338d632096e5269bdf48e03053dd9528 Author: Philippe Brochard Date: Sun Dec 25 23:27:11 2011 +0100 src/package.lisp (make-x-drawable): Drawable wrapper to prevent type error in some CLX versions. Replace xlib:drawable-* functions with x-drawable-* equivalents diff --git a/ChangeLog b/ChangeLog index 4ea4b32..98b9702 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-12-25 Philippe Brochard + + * src/package.lisp (make-x-drawable): Drawable wrapper to prevent + type error in some CLX versions. + Replace xlib:drawable-* functions with x-drawable-* equivalents + 2011-12-14 Philippe Brochard * src/clfswm-util.lisp (um-create-xdg-section-list): Add at least diff --git a/clfswm.asd b/clfswm.asd index 6f27c6d..c908b3f 100644 --- a/clfswm.asd +++ b/clfswm.asd @@ -70,7 +70,7 @@ (:file "clfswm-layout" :depends-on ("package" "clfswm-internal" "clfswm-util" "clfswm-info" "menu-def")) (:file "clfswm-pack" - :depends-on ("clfswm" "clfswm-util" "clfswm-second-mode" "clfswm-layout")) + :depends-on ("clfswm" "xlib-util" "clfswm-util" "clfswm-second-mode" "clfswm-layout")) (:file "clfswm-nw-hooks" :depends-on ("package" "clfswm-util" "clfswm-info" "clfswm-layout" "menu-def")) (:file "bindings" diff --git a/src/clfswm-expose-mode.lisp b/src/clfswm-expose-mode.lisp index 33c3e8f..5039b2d 100644 --- a/src/clfswm-expose-mode.lisp +++ b/src/clfswm-expose-mode.lisp @@ -89,7 +89,7 @@ ,(format nil "Select child '~A' (~A)" (number->string n) n) (let ((child (nth ,n *expose-windows-list*))) (when child - (xlib:warp-pointer *root* (xlib:drawable-x (first child)) (xlib:drawable-y (first child))) + (xlib:warp-pointer *root* (x-drawable-x (first child)) (x-drawable-y (first child))) (setf *expose-selected-child* (fourth child)) (when *expose-valid-on-key* (valid-expose-mode))))) diff --git a/src/clfswm-info.lisp b/src/clfswm-info.lisp index 438e4b3..0d0b36b 100644 --- a/src/clfswm-info.lisp +++ b/src/clfswm-info.lisp @@ -51,10 +51,10 @@ (defun find-info-item-from-mouse (root-x root-y info) - (if (< (xlib:drawable-x (info-window info)) root-x - (+ (xlib:drawable-x (info-window info)) - (xlib:drawable-width (info-window info)))) - (truncate (/ (- (+ (- root-y (xlib:drawable-y (info-window info))) + (if (< (x-drawable-x (info-window info)) root-x + (+ (x-drawable-x (info-window info)) + (x-drawable-width (info-window info)))) + (truncate (/ (- (+ (- root-y (x-drawable-y (info-window info))) (xlib:max-char-ascent (info-font info)) (info-y info)) (info-ilh info)) (info-ilh info))) nil)) @@ -135,8 +135,8 @@ "Move one line down" (incf-info-selected-item info 1) (when (> (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) - (xlib:drawable-height (info-window info)))) + (+ (x-drawable-y (info-window info)) + (x-drawable-height (info-window info)))) (setf (info-y info) (min (+ (info-y info) (info-ilh info)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Up") @@ -144,7 +144,7 @@ "Move one line up" (decf-info-selected-item info 1) (when (< (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) + (+ (x-drawable-y (info-window info)) (info-ilh info))) (setf (info-y info) (max (- (info-y info) (info-ilh info)) 0))) (draw-info-window info))) @@ -169,7 +169,7 @@ (defun info-end-line (info) "Move to last line" (setf (info-x info) 0 - (info-y info) (- (* (length (info-list info)) (info-ilh info)) (xlib:drawable-height (info-window info)))) + (info-y info) (- (* (length (info-list info)) (info-ilh info)) (x-drawable-height (info-window info)))) (setf *info-selected-item* (1- (or (length (info-list info)) 1))) (draw-info-window info))) (define-info-key ("Page_Down") @@ -177,8 +177,8 @@ "Move ten lines down" (incf-info-selected-item info 10) (when (> (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) - (xlib:drawable-height (info-window info)))) + (+ (x-drawable-y (info-window info)) + (x-drawable-height (info-window info)))) (setf (info-y info) (min (+ (info-y info) (* (info-ilh info) 10)) (info-max-y info)))) (draw-info-window info))) (define-info-key ("Page_Up") @@ -186,7 +186,7 @@ "Move ten lines up" (decf-info-selected-item info 10) (when (< (info-y-display-coords info *info-selected-item*) - (+ (xlib:drawable-y (info-window info)) + (+ (x-drawable-y (info-window info)) (info-ilh info))) (setf (info-y info) (max (- (info-y info) (* (info-ilh info) 10)) 0))) (draw-info-window info)))) diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index 86759f7..e3a6c03 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -91,8 +91,8 @@ (defun in-window (window x y) (and (xlib:window-p window) - (<= (xlib:drawable-x window) x (+ (xlib:drawable-x window) (xlib:drawable-width window))) - (<= (xlib:drawable-y window) y (+ (xlib:drawable-y window) (xlib:drawable-height window))))) + (<= (x-drawable-x window) x (+ (x-drawable-x window) (x-drawable-width window))) + (<= (x-drawable-y window) y (+ (x-drawable-y window) (x-drawable-height window))))) (defgeneric in-child (child x y)) @@ -239,37 +239,37 @@ (defgeneric child-x (child)) (defmethod child-x ((child xlib:window)) - (xlib:drawable-x child)) + (x-drawable-x child)) (defmethod child-x ((child frame)) (frame-rx child)) (defgeneric child-y (child)) (defmethod child-y ((child xlib:window)) - (xlib:drawable-y child)) + (x-drawable-y child)) (defmethod child-y ((child frame)) (frame-ry child)) (defgeneric child-width (child)) (defmethod child-width ((child xlib:window)) - (xlib:drawable-width child)) + (x-drawable-width child)) (defmethod child-width ((child frame)) (frame-rw child)) (defgeneric child-height (child)) (defmethod child-height ((child xlib:window)) - (xlib:drawable-height child)) + (x-drawable-height child)) (defmethod child-height ((child frame)) (frame-rh child)) (defgeneric child-x2 (child)) (defmethod child-x2 ((child xlib:window)) - (+ (xlib:drawable-x child) (xlib:drawable-width child))) + (+ (x-drawable-x child) (x-drawable-width child))) (defmethod child-x2 ((child frame)) (+ (frame-rx child) (frame-rw child))) (defgeneric child-y2 (child)) (defmethod child-y2 ((child xlib:window)) - (+ (xlib:drawable-y child) (xlib:drawable-height child))) + (+ (x-drawable-y child) (x-drawable-height child))) (defmethod child-y2 ((child frame)) (+ (frame-ry child) (frame-rh child))) @@ -278,8 +278,8 @@ (defgeneric child-center (child)) (defmethod child-center ((child xlib:window)) - (values (+ (xlib:drawable-x child) (/ (xlib:drawable-width child) 2)) - (+ (xlib:drawable-y child) (/ (xlib:drawable-height child) 2)))) + (values (+ (x-drawable-x child) (/ (x-drawable-width child) 2)) + (+ (x-drawable-y child) (/ (x-drawable-height child) 2)))) (defmethod child-center ((child frame)) (values (+ (frame-rx child) (/ (frame-rw child) 2)) @@ -303,16 +303,16 @@ (defgeneric adj-border-wh (value child)) (defmethod adj-border-xy (v (child xlib:window)) - (+ v (xlib:drawable-border-width child))) + (+ v (x-drawable-border-width child))) (defmethod adj-border-xy (v (child frame)) - (+ v (xlib:drawable-border-width (frame-window child)))) + (+ v (x-drawable-border-width (frame-window child)))) (defmethod adj-border-wh (v (child xlib:window)) - (- v (* (xlib:drawable-border-width child) 2))) + (- v (* (x-drawable-border-width child) 2))) (defmethod adj-border-wh (v (child frame)) - (- v (* (xlib:drawable-border-width (frame-window child)) 2))) + (- v (* (x-drawable-border-width (frame-window child)) 2))) (declaim (inline anti-adj-border-xy anti-adj-border-wh)) @@ -320,16 +320,16 @@ (defgeneric anti-adj-border-wh (value child)) (defmethod anti-adj-border-xy (v (child xlib:window)) - (- v (xlib:drawable-border-width child))) + (- v (x-drawable-border-width child))) (defmethod anti-adj-border-xy (v (child frame)) - (- v (xlib:drawable-border-width (frame-window child)))) + (- v (x-drawable-border-width (frame-window child)))) (defmethod anti-adj-border-wh (v (child xlib:window)) - (+ v (* (xlib:drawable-border-width child) 2))) + (+ v (* (x-drawable-border-width child) 2))) (defmethod anti-adj-border-wh (v (child frame)) - (+ v (* (xlib:drawable-border-width (frame-window child)) 2))) + (+ v (* (x-drawable-border-width (frame-window child)) 2))) @@ -514,10 +514,10 @@ "Place a frame from real (pixel) coordinates" (when (and (frame-p frame) (frame-p parent)) (with-slots (window x y w h) frame - (setf (xlib:drawable-x window) prx - (xlib:drawable-y window) pry - (xlib:drawable-width window) prw - (xlib:drawable-height window) prh + (setf (x-drawable-x window) prx + (x-drawable-y window) pry + (x-drawable-width window) prw + (x-drawable-height window) prh x (x-px->fl prx parent) y (y-px->fl pry parent) w (w-px->fl prw parent) @@ -684,8 +684,8 @@ (funcall it child parent) (no-layout child parent)) (get-fullscreen-size)) - (values (xlib:drawable-x child) (xlib:drawable-y child) - (xlib:drawable-width child) (xlib:drawable-height child))))) + (values (x-drawable-x child) (x-drawable-y child) + (x-drawable-width child) (x-drawable-height child))))) @@ -698,30 +698,30 @@ (multiple-value-bind (nx ny nw nh) (get-parent-layout window parent) (setf nw (max nw 1) nh (max nh 1)) - (let ((change (or (/= (xlib:drawable-x window) nx) - (/= (xlib:drawable-y window) ny) - (/= (xlib:drawable-width window) nw) - (/= (xlib:drawable-height window) nh)))) + (let ((change (or (/= (x-drawable-x window) nx) + (/= (x-drawable-y window) ny) + (/= (x-drawable-width window) nw) + (/= (x-drawable-height window) nh)))) (when change - (setf (xlib:drawable-x window) nx - (xlib:drawable-y window) ny - (xlib:drawable-width window) nw - (xlib:drawable-height window) nh)) + (setf (x-drawable-x window) nx + (x-drawable-y window) ny + (x-drawable-width window) nw + (x-drawable-height window) nh)) change)))) (defmethod adapt-child-to-parent ((frame frame) parent) (declare (ignore parent)) (with-slots (rx ry rw rh window) frame - (let ((change (or (/= (xlib:drawable-x window) rx) - (/= (xlib:drawable-y window) ry) - (/= (xlib:drawable-width window) rw) - (/= (xlib:drawable-height window) rh)))) + (let ((change (or (/= (x-drawable-x window) rx) + (/= (x-drawable-y window) ry) + (/= (x-drawable-width window) rw) + (/= (x-drawable-height window) rh)))) (when change - (setf (xlib:drawable-x window) rx - (xlib:drawable-y window) ry - (xlib:drawable-width window) rw - (xlib:drawable-height window) rh)) + (setf (x-drawable-x window) rx + (x-drawable-y window) ry + (x-drawable-width window) rw + (x-drawable-height window) rh)) change))) (defmethod adapt-child-to-parent (child parent) @@ -850,15 +850,15 @@ (child-rect-child rect))) (frame (frame-window (child-rect-child rect)))))) (when window - (let ((change (or (/= (xlib:drawable-x window) (child-rect-x rect)) - (/= (xlib:drawable-y window) (child-rect-y rect)) - (/= (xlib:drawable-width window) (child-rect-w rect)) - (/= (xlib:drawable-height window) (child-rect-h rect))))) + (let ((change (or (/= (x-drawable-x window) (child-rect-x rect)) + (/= (x-drawable-y window) (child-rect-y rect)) + (/= (x-drawable-width window) (child-rect-w rect)) + (/= (x-drawable-height window) (child-rect-h rect))))) (when change - (setf (xlib:drawable-x window) (child-rect-x rect) - (xlib:drawable-y window) (child-rect-y rect) - (xlib:drawable-width window) (child-rect-w rect) - (xlib:drawable-height window) (child-rect-h rect))) + (setf (x-drawable-x window) (child-rect-x rect) + (x-drawable-y window) (child-rect-y rect) + (x-drawable-width window) (child-rect-w rect) + (x-drawable-height window) (child-rect-h rect))) change)))) @@ -1197,17 +1197,17 @@ Warning:frame window and gc are freeed." (let* ((hints (xlib:wm-normal-hints window)) (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0)) (min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0)) - (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (xlib:drawable-width *root*))) - (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (xlib:drawable-height *root*))) + (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) (x-drawable-width *root*))) + (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) (x-drawable-height *root*))) (rwidth (or (and hints (or (xlib:wm-size-hints-width hints) (xlib:wm-size-hints-base-width hints))) - (xlib:drawable-width window))) + (x-drawable-width window))) (rheight (or (and hints (or (xlib:wm-size-hints-height hints) (xlib:wm-size-hints-base-height hints))) - (xlib:drawable-height window)))) - (setf (xlib:drawable-width window) (min (max min-width rwidth *default-window-width*) max-width) - (xlib:drawable-height window) (min (max min-height rheight *default-window-height*) max-height)) - (with-placement (*unmanaged-window-placement* x y (xlib:drawable-width window) (xlib:drawable-height window)) - (setf (xlib:drawable-x window) x - (xlib:drawable-y window) y)) + (x-drawable-height window)))) + (setf (x-drawable-width window) (min (max min-width rwidth *default-window-width*) max-width) + (x-drawable-height window) (min (max min-height rheight *default-window-height*) max-height)) + (with-placement (*unmanaged-window-placement* x y (x-drawable-width window) (x-drawable-height window)) + (setf (x-drawable-x window) x + (x-drawable-y window) y)) (xlib:display-finish-output *display*))) @@ -1229,7 +1229,7 @@ windows), this function dresses the window up and gets it ready to be managed." (setf (xlib:window-event-mask window) *window-events*) (set-window-state window +normal-state+) - (setf (xlib:drawable-border-width window) (case (window-type window) + (setf (x-drawable-border-width window) (case (window-type window) (:normal *border-size*) (:maxsize *border-size*) (:transient *border-size*) diff --git a/src/clfswm-pack.lisp b/src/clfswm-pack.lisp index e635809..16434b7 100644 --- a/src/clfswm-pack.lisp +++ b/src/clfswm-pack.lisp @@ -235,10 +235,10 @@ (labels ((readjust-all-frames-fl-size (parent) (dolist (child (frame-child parent)) (when (frame-p child) - (setf (frame-x child) (x-px->fl (xlib:drawable-x (frame-window child)) parent) - (frame-y child) (y-px->fl (xlib:drawable-y (frame-window child)) parent) - (frame-w child) (w-px->fl (anti-adj-border-wh (xlib:drawable-width (frame-window child)) parent) parent) - (frame-h child) (h-px->fl (anti-adj-border-wh (xlib:drawable-height (frame-window child)) parent) parent)))))) + (setf (frame-x child) (x-px->fl (x-drawable-x (frame-window child)) parent) + (frame-y child) (y-px->fl (x-drawable-y (frame-window child)) parent) + (frame-w child) (w-px->fl (anti-adj-border-wh (x-drawable-width (frame-window child)) parent) parent) + (frame-h child) (h-px->fl (anti-adj-border-wh (x-drawable-height (frame-window child)) parent) parent)))))) (defun move-frame-constrained (frame parent orig-x orig-y) (when (and frame parent (not (child-equal-p frame *current-root*))) (hide-all-children frame) @@ -250,32 +250,32 @@ (lambda () (let ((move-x t) (move-y t)) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent)) + (setf (frame-x frame) (x-px->fl (x-drawable-x window) parent) + (frame-y frame) (y-px->fl (x-drawable-y window) parent)) (multiple-value-bind (x y) (xlib:query-pointer *root*) (when (> x lx) (let ((x-found (x-fl->px (find-edge-right frame parent) parent))) (when (< (abs (- x-found (window-x2 window))) *snap-size*) - (setf (xlib:drawable-x window) (- x-found (adj-border-xy (xlib:drawable-width window) window)) - (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (setf (x-drawable-x window) (- x-found (adj-border-xy (x-drawable-width window) window)) + (frame-x frame) (x-px->fl (x-drawable-x window) parent) move-x nil)))) (when (< x lx) (let ((x-found (x-fl->px (find-edge-left frame parent) parent))) - (when (< (abs (- x-found (xlib:drawable-x window))) *snap-size*) - (setf (xlib:drawable-x window) (adj-border-xy x-found window) - (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (when (< (abs (- x-found (x-drawable-x window))) *snap-size*) + (setf (x-drawable-x window) (adj-border-xy x-found window) + (frame-x frame) (x-px->fl (x-drawable-x window) parent) move-x nil)))) (when (> y ly) (let ((y-found (y-fl->px (find-edge-down frame parent) parent))) (when (< (abs (- y-found (window-y2 window))) *snap-size*) - (setf (xlib:drawable-y window) (- y-found (adj-border-xy (xlib:drawable-height window) window)) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent) + (setf (x-drawable-y window) (- y-found (adj-border-xy (x-drawable-height window) window)) + (frame-y frame) (y-px->fl (x-drawable-y window) parent) move-y nil)))) (when (< y ly) (let ((y-found (y-fl->px (find-edge-up frame parent) parent))) - (when (< (abs (- y-found (xlib:drawable-y window))) *snap-size*) - (setf (xlib:drawable-y window) (adj-border-xy y-found window) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent) + (when (< (abs (- y-found (x-drawable-y window))) *snap-size*) + (setf (x-drawable-y window) (adj-border-xy y-found window) + (frame-y frame) (y-px->fl (x-drawable-y window) parent) move-y nil)))) (display-frame-info frame) (when move-x (setf lx x)) @@ -296,21 +296,21 @@ (let ((resize-w t) (resize-h t)) (multiple-value-bind (x y) (xlib:query-pointer *root*) - (setf (frame-w frame) (w-px->fl (anti-adj-border-wh (xlib:drawable-width window) parent) parent) - (frame-h frame) (h-px->fl (anti-adj-border-wh (xlib:drawable-height window) parent) parent)) + (setf (frame-w frame) (w-px->fl (anti-adj-border-wh (x-drawable-width window) parent) parent) + (frame-h frame) (h-px->fl (anti-adj-border-wh (x-drawable-height window) parent) parent)) (when (> x lx) (let ((x-found (x-fl->px (find-edge-right frame parent) parent))) (when (< (abs (- x-found (window-x2 window))) *snap-size*) - (setf (xlib:drawable-width window) (+ (xlib:drawable-width window) + (setf (x-drawable-width window) (+ (x-drawable-width window) (- x-found (adj-border-xy (window-x2 window) parent))) - (frame-w frame) (w-px->fl (anti-adj-border-wh (xlib:drawable-width window) parent) parent) + (frame-w frame) (w-px->fl (anti-adj-border-wh (x-drawable-width window) parent) parent) resize-w nil)))) (when (> y ly) (let ((y-found (y-fl->px (find-edge-down frame parent) parent))) (when (< (abs (- y-found (window-y2 window))) *snap-size*) - (setf (xlib:drawable-height window) (+ (xlib:drawable-height window) + (setf (x-drawable-height window) (+ (x-drawable-height window) (- y-found (adj-border-xy (window-y2 window) parent))) - (frame-h frame) (h-px->fl (anti-adj-border-wh (xlib:drawable-height window) parent) parent) + (frame-h frame) (h-px->fl (anti-adj-border-wh (x-drawable-height window) parent) parent) resize-h nil)))) (display-frame-info frame) (when resize-w (setf lx x)) diff --git a/src/clfswm-placement.lisp b/src/clfswm-placement.lisp index c4167a5..4c4ccb0 100644 --- a/src/clfswm-placement.lisp +++ b/src/clfswm-placement.lisp @@ -107,10 +107,10 @@ ;;; (defun current-child-coord () (typecase *current-child* - (xlib:window (values (xlib:drawable-x *current-child*) - (xlib:drawable-y *current-child*) - (xlib:drawable-width *current-child*) - (xlib:drawable-height *current-child*))) + (xlib:window (values (x-drawable-x *current-child*) + (x-drawable-y *current-child*) + (x-drawable-width *current-child*) + (x-drawable-height *current-child*))) (frame (values (frame-rx *current-child*) (frame-ry *current-child*) (frame-rw *current-child*) diff --git a/src/clfswm-query.lisp b/src/clfswm-query.lisp index 4be8394..281a547 100644 --- a/src/clfswm-query.lisp +++ b/src/clfswm-query.lisp @@ -102,7 +102,7 @@ (defun query-print-string () - (let ((dec (min 0 (- (- (xlib:drawable-width *query-window*) 10) + (let ((dec (min 0 (- (- (x-drawable-width *query-window*) 10) (+ 10 (* *query-pos* (xlib:max-char-width *query-font*))))))) (clear-pixmap-buffer *query-window* *query-gc*) (setf (xlib:gcontext-foreground *query-gc*) (get-color *query-message-color*)) diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 280f733..e24f7f6 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -568,8 +568,8 @@ (hide-all-children frame) (with-slots (window) frame (move-window window orig-x orig-y #'display-frame-info (list frame)) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))) + (setf (frame-x frame) (x-px->fl (x-drawable-x window) parent) + (frame-y frame) (y-px->fl (x-drawable-y window) parent))) (show-all-children))) (defun resize-frame (frame parent orig-x orig-y) @@ -577,8 +577,8 @@ (hide-all-children frame) (with-slots (window) frame (resize-window window orig-x orig-y #'display-frame-info (list frame)) - (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) - (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))) + (setf (frame-w frame) (w-px->fl (x-drawable-width window) parent) + (frame-h frame) (h-px->fl (x-drawable-height window) parent))) (show-all-children))) @@ -982,8 +982,8 @@ For window: set current child to window or its parent according to window-parent "Force the current window to move in the frame (Useful only for unmanaged windows)" (with-current-window (let ((parent (find-parent-frame window))) - (setf (xlib:drawable-x window) (frame-rx parent) - (xlib:drawable-y window) (frame-ry parent)) + (setf (x-drawable-x window) (frame-rx parent) + (x-drawable-y window) (frame-ry parent)) (xlib:display-finish-output *display*))) (leave-second-mode)) @@ -992,12 +992,12 @@ For window: set current child to window or its parent according to window-parent "Force the current window to move in the center of the frame (Useful only for unmanaged windows)" (with-current-window (let ((parent (find-parent-frame window))) - (setf (xlib:drawable-x window) (truncate (+ (frame-rx parent) + (setf (x-drawable-x window) (truncate (+ (frame-rx parent) (/ (- (frame-rw parent) - (xlib:drawable-width window)) 2))) - (xlib:drawable-y window) (truncate (+ (frame-ry parent) + (x-drawable-width window)) 2))) + (x-drawable-y window) (truncate (+ (frame-ry parent) (/ (- (frame-rh parent) - (xlib:drawable-height window)) 2)))) + (x-drawable-height window)) 2)))) (xlib:display-finish-output *display*))) (leave-second-mode)) diff --git a/src/clfswm.lisp b/src/clfswm.lisp index 4e42f2e..23a3bdd 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -51,22 +51,22 @@ (has-bw (mask) (= 16 (logand mask 16))) (has-stackmode (mask) (= 64 (logand mask 64))) (adjust-from-request () - (when (has-x value-mask) (setf (xlib:drawable-x window) x)) - (when (has-y value-mask) (setf (xlib:drawable-y window) y)) - (when (has-h value-mask) (setf (xlib:drawable-height window) height)) - (when (has-w value-mask) (setf (xlib:drawable-width window) width)))) + (when (has-x value-mask) (setf (x-drawable-x window) x)) + (when (has-y value-mask) (setf (x-drawable-y window) y)) + (when (has-h value-mask) (setf (x-drawable-height window) height)) + (when (has-w value-mask) (setf (x-drawable-width window) width)))) (xlib:with-state (window) (when (has-bw value-mask) - (setf (xlib:drawable-border-width window) border-width)) + (setf (x-drawable-border-width window) border-width)) (if (find-child window *current-root*) (let ((parent (find-parent-frame window *current-root*))) (if (and parent (managed-window-p window parent)) (adapt-child-to-parent window parent) (adjust-from-request))) (adjust-from-request)) - (send-configuration-notify window (xlib:drawable-x window) (xlib:drawable-y window) - (xlib:drawable-width window) (xlib:drawable-height window) - (xlib:drawable-border-width window)) + (send-configuration-notify window (x-drawable-x window) (x-drawable-y window) + (x-drawable-width window) (x-drawable-height window) + (x-drawable-border-width window)) (when (has-stackmode value-mask) (case stack-mode (:above diff --git a/src/package.lisp b/src/package.lisp index 297ff7a..f29bcd7 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -252,3 +252,28 @@ loading configuration file and before opening the display.") ;; (force-output)))))) + + +(defmacro make-x-drawable (argname type) + "Drawable wrapper to prevent type error in some CLX versions. +Replace xlib:drawable-* functions with x-drawable-* equivalents" + (let ((fun-symbol (symb 'x-drawable- argname)) + (set-symbol (symb 'set-x-drawable- argname)) + (xlib-equiv-symbol (symb-intern :xlib 'drawable- argname))) + `(progn + (declaim (inline ,fun-symbol)) + (defun ,fun-symbol (window) + (,xlib-equiv-symbol window)) + (defun ,set-symbol (window ,argname) + (if (typep ,argname ',type) + (setf (,xlib-equiv-symbol window) ,argname) + (dbg ',(symb 'drawable-type-error- argname) window ,argname (xlib:wm-name window)))) + (defsetf ,fun-symbol ,set-symbol)))) + + + +(make-x-drawable x (signed-byte 16)) +(make-x-drawable y (signed-byte 16)) +(make-x-drawable width (unsigned-byte 16)) +(make-x-drawable height (unsigned-byte 16)) +(make-x-drawable border-width (unsigned-byte 16)) diff --git a/src/tools.lisp b/src/tools.lisp index 48d5dad..5453182 100644 --- a/src/tools.lisp +++ b/src/tools.lisp @@ -40,7 +40,7 @@ :nfuncall :pfuncall :symbol-search - :symb + :symb :symb-intern :call-hook :add-hook :remove-hook @@ -210,7 +210,10 @@ (princ a s)))) (defun symb (&rest args) - (values (intern (apply #'mkstr args))))) + (values (intern (apply #'mkstr args)))) + + (defun symb-intern (package &rest args) + (values (intern (apply #'mkstr args) package)))) ;;;,----- diff --git a/src/xlib-util.lisp b/src/xlib-util.lisp index e93ca16..0b4ba6c 100644 --- a/src/xlib-util.lisp +++ b/src/xlib-util.lisp @@ -86,10 +86,10 @@ Window types are in +WINDOW-TYPES+.") (declaim (inline window-x2 window-y2)) (defun window-x2 (window) - (+ (xlib:drawable-x window) (xlib:drawable-width window))) + (+ (x-drawable-x window) (x-drawable-width window))) (defun window-y2 (window) - (+ (xlib:drawable-y window) (xlib:drawable-height window))) + (+ (x-drawable-y window) (x-drawable-height window))) @@ -537,11 +537,11 @@ Expand in handle-event-fun-main-mode-key-press" (multiple-value-bind (move-x move-y) (apply add-fn add-arg) (when move-x - (setf (xlib:drawable-x window) (+ root-x dx))) + (setf (x-drawable-x window) (+ root-x dx))) (when move-y - (setf (xlib:drawable-y window) (+ root-y dy)))) - (setf (xlib:drawable-x window) (+ root-x dx) - (xlib:drawable-y window) (+ root-y dy))))) + (setf (x-drawable-y window) (+ root-y dy)))) + (setf (x-drawable-x window) (+ root-x dx) + (x-drawable-y window) (+ root-y dy))))) (define-handler move-window-mode :key-release () (throw 'exit-move-window-mode nil)) @@ -553,8 +553,8 @@ Expand in handle-event-fun-main-mode-key-press" (setf window orig-window add-fn additional-fn add-arg additional-arg - dx (- (xlib:drawable-x window) orig-x) - dy (- (xlib:drawable-y window) orig-y) + dx (- (x-drawable-x window) orig-x) + dy (- (x-drawable-y window) orig-y) (xlib:window-border window) (get-color *color-move-window*)) (raise-window window) (let ((pointer-grabbed-p (xgrab-pointer-p))) @@ -579,11 +579,11 @@ Expand in handle-event-fun-main-mode-key-press" (multiple-value-bind (resize-w resize-h) (apply add-fn add-arg) (when resize-w - (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width))) + (setf (x-drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width))) (when resize-h - (setf (xlib:drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height)))) - (setf (xlib:drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width) - (xlib:drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height))))) + (setf (x-drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height)))) + (setf (x-drawable-width window) (min (max (+ orig-width (- root-x o-x)) 10 min-width) max-width) + (x-drawable-height window) (min (max (+ orig-height (- root-y o-y)) 10 min-height) max-height))))) (define-handler resize-window-mode :key-release () (throw 'exit-resize-window-mode nil)) @@ -599,8 +599,8 @@ Expand in handle-event-fun-main-mode-key-press" add-arg additional-arg o-x orig-x o-y orig-y - orig-width (xlib:drawable-width window) - orig-height (xlib:drawable-height window) + orig-width (x-drawable-width window) + orig-height (x-drawable-height window) min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0) min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0) max-width (or (and hints (xlib:wm-size-hints-max-width hints)) most-positive-fixnum) @@ -820,13 +820,13 @@ Expand in handle-event-fun-main-mode-key-press" (defun clear-pixmap-buffer (window gc) (rotatef (xlib:gcontext-foreground gc) (xlib:gcontext-background gc)) (xlib:draw-rectangle *pixmap-buffer* gc - 0 0 (xlib:drawable-width window) (xlib:drawable-height window) + 0 0 (x-drawable-width window) (x-drawable-height window) t) (rotatef (xlib:gcontext-foreground gc) (xlib:gcontext-background gc))) (defun copy-pixmap-buffer (window gc) (xlib:copy-area *pixmap-buffer* gc - 0 0 (xlib:drawable-width window) (xlib:drawable-height window) + 0 0 (x-drawable-width window) (x-drawable-height window) window 0 0)) @@ -845,3 +845,4 @@ Expand in handle-event-fun-main-mode-key-press" `(defun ,symbol (window) (when (xlib:window-p window) (string-equal (xlib:wm-name window) ,name)))) + ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++ clfswm.asd | 2 +- src/clfswm-expose-mode.lisp | 2 +- src/clfswm-info.lisp | 22 ++++---- src/clfswm-internal.lisp | 116 +++++++++++++++++++++--------------------- src/clfswm-pack.lisp | 44 ++++++++-------- src/clfswm-placement.lisp | 8 ++-- src/clfswm-query.lisp | 2 +- src/clfswm-util.lisp | 20 ++++---- src/clfswm.lisp | 16 +++--- src/package.lisp | 25 +++++++++ src/tools.lisp | 7 ++- src/xlib-util.lisp | 33 ++++++------ 13 files changed, 169 insertions(+), 134 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Sun Dec 25 22:32:00 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 25 Dec 2011 14:32:00 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch fix-type-error deleted. R-1106-10-g1990938 Message-ID: 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, fix-type-error has been deleted was 1990938dd3f3e2c2574609341ce5d912adebbbe1 ----------------------------------------------------------------------- 1990938dd3f3e2c2574609341ce5d912adebbbe1 src/xlib-util.lisp: add an xlib:drawable-* wrapper to prevent and debug xlib type errors in some CLX versions. ----------------------------------------------------------------------- hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Sun Dec 25 23:01:10 2011 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Sun, 25 Dec 2011 15:01:10 -0800 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1106-11-g5b3e106 Message-ID: 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 5b3e106b3a935888b50718bf9dd6b1321454540c (commit) from 913155a1338d632096e5269bdf48e03053dd9528 (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 5b3e106b3a935888b50718bf9dd6b1321454540c Author: Philippe Brochard Date: Mon Dec 26 00:01:05 2011 +0100 src/clfswm-query.lisp: Fill the history list with a non-nil value. diff --git a/ChangeLog b/ChangeLog index 98b9702..5c2c983 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-12-26 Philippe Brochard + + * src/clfswm-query.lisp: Fill the history list with a non-nil + value. + 2011-12-25 Philippe Brochard * src/package.lisp (make-x-drawable): Drawable wrapper to prevent diff --git a/src/clfswm-query.lisp b/src/clfswm-query.lisp index 281a547..a3d881a 100644 --- a/src/clfswm-query.lisp +++ b/src/clfswm-query.lisp @@ -30,7 +30,7 @@ (defparameter *query-font* nil) (defparameter *query-gc* nil) -(defparameter *query-history* nil) +(defparameter *query-history* (list "")) (defparameter *query-complet-list* nil) (defparameter *query-message* nil) @@ -79,7 +79,7 @@ (defun clear-query-history () "Clear the query-string history" - (setf *query-history* nil)) + (setf *query-history* (list ""))) ----------------------------------------------------------------------- Summary of changes: ChangeLog | 5 +++++ src/clfswm-query.lisp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager