warp-pointer & query-pointer (while we have pointer grab)



This code illustrates the problem:

(bind-keys global-keymap
 "H-7" (lambda () (warp-cursor 100 100) (display-message (format #f "%s" (query-pointer 't)))))


The position reported is not (100 . 100), b/c processing of the pointer events
is frozen. So the warp-cursor will take place only when we call allow-events (or
ungrab).  Note, that the code must be bound to a key. You cannot simply execute
the lambda (from sawfish-client).


I think, that a proper solution, given that we have the grab, is to keep the
position in a variable (i.e.  warp-cursor updates and query-pointer reads the
variable when we have a grab).

(btw. why -cursor and -pointer ?)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]