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



Michal Maruška writes:
|(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 don't think this is a bug - query-pointer aims to return the pointer
position associated with the current event. If the current event has no
position it queries the server once then caches that value until the
next event (or until warp-cursor is called)

it's not possible for sawfish to automatically cache the position
passed to warp-cursor since the X server may move the cursor somewhere
else, or not at all

|
|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).

I think the best solution here is for the code calling warp-cursor to
remember that it did so when necessary

|
|(btw. why -cursor and -pointer ?)

no reason, it should probably be warp-pointer instead, but it's too
late now..

	John




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