[clfswm-cvs] r277 - in clfswm: . src
Philippe Brochard
pbrochard at common-lisp.net
Fri Jul 16 21:38:06 UTC 2010
Author: pbrochard
Date: Fri Jul 16 17:38:05 2010
New Revision: 277
Log:
clfswm-util.lisp (mouse-click-to-focus-generic): Use find-child-under-mouse instead of the window passed by xlib:process-event.
Modified:
clfswm/ChangeLog
clfswm/src/clfswm-util.lisp
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Fri Jul 16 17:38:05 2010
@@ -2,6 +2,8 @@
* src/clfswm-util.lisp (identify-key): Add a timeout in
xlib:process-event.
+ (mouse-click-to-focus-generic): Use find-child-under-mouse instead
+ of the window passed by xlib:process-event.
* src/xlib-util.lisp (move-window, resize-window)
(wait-mouse-button-release): Add a timeout in xlib:process-event.
Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp (original)
+++ clfswm/src/clfswm-util.lisp Fri Jul 16 17:38:05 2010
@@ -553,31 +553,35 @@
"Focus the current frame or focus the current window parent
mouse-fun is #'move-frame or #'resize-frame"
(let* ((to-replay t)
- (child window)
- (parent (find-parent-frame child *current-root*))
+ (child (find-child-under-mouse root-x root-y))
+ (parent (find-parent-frame child))
(root-p (or (equal window *root*)
(and (frame-p *current-root*)
(equal child (frame-window *current-root*))))))
- (when (or (not root-p) *create-frame-on-root*)
- (unless parent
- (if root-p
- (progn
- (setf child (create-frame)
- parent *current-root*
- mouse-fn #'resize-frame)
- (place-frame child parent root-x root-y 10 10)
- (map-window (frame-window child))
- (pushnew child (frame-child *current-root*)))
- (setf child (find-frame-window window *current-root*)
- parent (find-parent-frame child *current-root*)))
- (when child
+ (labels ((add-new-frame ()
+ (setf child (create-frame)
+ parent *current-root*
+ mouse-fn #'resize-frame)
+ (place-frame child parent root-x root-y 10 10)
+ (map-window (frame-window child))
+ (pushnew child (frame-child *current-root*))))
+ (when (or (not root-p) *create-frame-on-root*)
+ (unless parent
+ (if root-p
+ (add-new-frame)
+ (progn
+ (unless (equal (type-of child) 'frame)
+ (setf child (find-frame-window child *current-root*)))
+ (setf parent (find-parent-frame child)))))
+ (when (and child parent (focus-all-children child parent))
+ (when (show-all-children)
+ (setf to-replay nil)))
+ (when (equal (type-of child) 'frame)
(funcall mouse-fn child parent root-x root-y)))
- (when (and child parent (focus-all-children child parent))
- (when (show-all-children)
- (setf to-replay nil))))
- (if to-replay
- (replay-button-event)
- (stop-button-event))))
+ (if to-replay
+ (replay-button-event)
+ (stop-button-event)))))
+
(defun mouse-click-to-focus-and-move (window root-x root-y)
"Move and focus the current frame or focus the current window parent.
More information about the clfswm-cvs
mailing list