Next: , Previous: , Up: Miscellaneous Functions   [Contents][Index]


20.2 Grab Functions

Function: grab-server

Prevent any other clients from accessing the X server.

Function: ungrab-server

After a call to grab-server this will allow other clients to access the X server again.

Note that calls to grab-server and ungrab-server nest.

Macro: with-server-grabbed &rest forms

Evaluate forms with the server grabbed. Releases the grab afterwards.

Function: call-with-server-ungrabbed thunk

Return the result of calling the zero-parameter function thunk. If the server is currently grabbed, ungrab it first, restoring the original grab status after the call to thunk returns.

Function: server-grabbed-p

Returns t if the X server is currently grabbed.

Function: grab-pointer #!optional window cursor ptr-sync kbd-sync confine-to

Grab the mouse pointer and direct all pointer events to window object window. If cursor is defined and a cursor object, display this while the pointer is grabbed.

If window is a window object corresponding to a visible window, the grab will be made on its frame.

If window is an integer, it specifies the window ID of the grab window.

Otherwise the grab will be made on the root window. This includes window corresponding to a non-viewable window.

Confine-to, if non-nil, is a visible window to confine the pointer to. It is interpreted similarly to the rules for window, except that the “otherwise” case is to not confine the pointer.

If the window id of a non-viewable window was specified for either window of confine-to, the grab will be made on the root window without confining the pointer.

If ptr-sync or kbd-sync is non-nil, the pointer or keyboard will be frozen, i.e., the device will not produce events until either the grab is released or events are re-enabled using allow-events.

Returns non-nil if the grab succeeded.

Function: ungrab-pointer

Release the grab on the mouse pointer.

Function: grab-keyboard #!optional window ptr-sync kbd-sync

Grab the keyboard and direct all keyboard events to window object window.

If window is a window object corresponding to a visible window, the grab will be made on its frame.

If window is an integer, it specifies the window ID of the grab window.

Otherwise the grab will be made on the root window. This includes window corresponding to a non-viewable window.

If ptr-sync or kbd-sync is non-nil, the pointer or keyboard will be frozen, i.e., the device will not produce events until either the grab is released or events are re-enabled using allow-events.

Returns non-nil if the grab succeeded.

Function: ungrab-keyboard

Release the grab on the keyboard.

Function: call-with-keyboard-grabbed thunk

Call the zero-parameter function thunk with the keyboard grabbed. If unable to grab the keyboard then thunk won’t be called.


Next: , Previous: , Up: Miscellaneous Functions   [Contents][Index]