X11workbench Toolkit  1.0
ClientMessage Atoms

Variables

Atom aRESIZE_NOTIFY
 notification of window re-size via ClientMessage More...
 
Atom aDESTROY_NOTIFY
 notify parent that child is being destroyed More...
 
Atom aQUERY_CLOSE
 query if it's ok to close (and optionally destroy yourself if ok) a window More...
 
Atom aRECALC_LAYOUT
 notify window that it should re-calculate things like scrollbars and viewports More...
 
Atom aSET_FOCUS
 dialog focus messages More...
 

Detailed Description

Atoms used for XClientMessageEvent notifications
Includes details on the various message parameters

See also
Mouse Pointer Event Handling, aWB_POINTER

Variable Documentation

◆ aDESTROY_NOTIFY

Atom aDESTROY_NOTIFY

notify parent that child is being destroyed

RESERVED - not yet implemented TODO document DESTROY_NOTIFY format here

Definition at line 233 of file window_helper.c.

◆ aQUERY_CLOSE

Atom aQUERY_CLOSE

query if it's ok to close (and optionally destroy yourself if ok) a window

QUERY_CLOSE message format (relative to XEvent.xclient)

type == ClientMessage
message_type == aQUERY_CLOSE
format == 32 (always)
data.l[0] contains a non-zero value if the window should destroy its private data NOW; 0 otherwise

Window callbacks should check for this and return '0' when it's ok to destroy the window, a positive value if it's NOT ok, or a negative value on error.

Whenever data.l[0] contains a non-zero value, and it's ok to close the window, the window event handler should destroy all of its private data, zero out data element '0' for the window data (if it pointed to the private data), and call WBUnregisterWindowCallback() for itself. The window will be destroyed by the sender as soon as the callback returns.

If the callback returns a non-zero value, it should not destroy any of its own private data. The sender will assume that it's not ok to close the window and will try to leave everything 'as-is'.

Generally, you should return 0 from your event handler if it is ok to close the window, 1 if NOT ok to close, and '-1' on error.

Definition at line 312 of file window_helper.c.

◆ aRECALC_LAYOUT

Atom aRECALC_LAYOUT

notify window that it should re-calculate things like scrollbars and viewports

RECALC_LAYOUT message format (relative to XEvent.xclient)

type == ClientMessage
message_type == aRECALC_LAYOUT
format == 32 (always)

A window that has a viewport and scrollbars, using a text object or other construct that supports this ClientMessage atom, should check for this message and recalculate viewports and scrollbar positions whenever it is received. If scroll positions have changed, you should invalidate the entire window rectangle so that it can be re-painted. However, you should not paint the window synchronously. You should rely on asynchronous processing of Expose events.

In some cases, default handling of 'recalc layout' functionality may cause aRESIZE_NOTIFY client message events to be dispatched. Care should be taken to NOT cause an infinite loop or infinite recursion due to the handling of these events.

See also
aRESIZE_NOTIFY

Definition at line 336 of file window_helper.c.

◆ aRESIZE_NOTIFY

Atom aRESIZE_NOTIFY

notification of window re-size via ClientMessage

RESIZE_NOTIFY message format (relative to XEvent.xclient)

type == ClientMessage
message_type == aRESIZE_NOTIFY
format == 32 (always)
data.l[0] new 'left' client rectangle coordinate
data.l[1] new 'top' client rectangle coordinate
data.l[2] new 'right' client rectangle coordinate
data.l[3] new 'bottom' client rectangle coordinate

The return value is ignored. It is typically sent via a direct call to the message callback function. Since it is merely a notification message, it does not need to be handled. The specified coordinates are in 'client' coordinates relative to the upper left corner of the client area, which is always (0,0).

Definition at line 224 of file window_helper.c.

◆ aSET_FOCUS

Atom aSET_FOCUS

dialog focus messages

SET_FOCUS message format (relative to XEvent.xclient)

type == ClientMessage
message_type == aSET_FOCUS
format == 32 (always)
data.l[0] is the window ID to set focus to (None for default)
This message is typically sent to the application (.window = None)

By posting a SET_FOCUS message to the application, you can ASYNCHRONOUSLY fix focus-related problems, such as the window manager trying to set focus to the application window while a modal dialog is visible.
When sent to a frame window, you are requesting that it set the focus to the appropriate window, similar to aDLG_FOCUS
Assigning 'data.l[0]' to 'None' tells a frame window to set focus to the default. When the event is sent to the application, a value of 'None' is meaningless.

Definition at line 383 of file window_helper.c.