[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] Implement drag-and-drop for windows
From: |
Raffael Mancini |
Subject: |
[STUMP] Implement drag-and-drop for windows |
Date: |
Wed, 03 Jun 2009 20:36:51 +0200 |
Hi,
I'm trying to implement drag-and-drop of windows between frames. For
this I'm editing the group-button-press for tile-group.
My current version looks like this (copied mostly from float-group):
[in tile-group.lisp]
(defmethod group-button-press ((group tile-group) x y (where window))
(declare (ignore x y))
(when (eq *mouse-focus-policy* :click)
(focus-all where)
(update-all-mode-lines))
(when *drag-and-drop-windows*
(let ((screen (group-screen group)))
(multiple-value-bind (relx rely) (xlib:query-pointer
(window-parent where))
(labels ((move-window-event-handler (&rest event-slots &key
event-key &allow-other-keys)
(case event-key
(:button-release
;; Pull window from "click" to frame from "release"
(pull-window where (find-frame group x y))
:done)
(:motion-notify
(with-slots (parent) where
(xlib:with-state (parent)
(setf (xlib:drawable-x parent) (- (getf
event-slots :x) relx)
(xlib:drawable-y parent) (- (getf
event-slots :y) rely))))
t)
(t
nil)
(otherwise
:done))))
(xlib:grab-pointer (screen-root screen)
'(:button-release :pointer-motion))
(unwind-protect
(loop for ev = (xlib:process-event *display*
:handler
#'move-window-event-handler
:timeout nil
:discard-p t)
until (eq ev :done))
(ungrab-pointer)))))))
Somehow, the :button-release event never gets triggered or does not get
caught by process-event. This works in float-group though. Does anyone
know why?
Greetings!
Raffael
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [STUMP] Implement drag-and-drop for windows,
Raffael Mancini <=