DTWSMADDWORKSPACEMODIFIEDCALLBACK(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

✨ NAME ✨

DtWsmAddWorkspaceModifiedCallback β€” literally β€œadd a callback to be called when any workspace is changed,” bestie. That’s the whole name, folded in right here so you don’t have to squint at the header line. πŸ’…


🌸 SYNOPSIS 🌸

#include &<Dt/Wsm.h>
DtWsmCBContext DtWsmAddWorkspaceModifiedCallback(
Widget widget,
DtWsmWsModifiedProc ws_change,
Pointer client_data);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here’s the tea: DtWsmAddWorkspaceModifiedCallback works with the XCDE workspace manager, dtwm(1), and registers a function to be called when a workspace is added, deleted, or modified. Not me being obsessed with workspace events or anything 😭.

  • widget β€” a realized widget. Like, actually realized.
  • ws_change β€” the procedure to be called when a workspace is modified.
  • client_data β€” points to arbitrary client data to be passed back to ws_change.

The header defines the DtWsmWsModifiedProc callback prototype as follows:

typedef void (*DtWsmWsModifiedProc)(Widget widget,
        Atom aWorkspace,
        DtWsmWsReason reason,
        Pointer client_data);

🧚 Callback prototype, decoded 🧚

  • widget β€” the ID of the widget to be registered with the callback.
  • aWorkspace β€” the name of the new current workspace (converted to an X atom). Iconic.
  • reason β€” a type of modification; the options are right below.
  • client_data β€” points to the client data to be registered with the callback.

The reason argument is a type of modification:

  • DtWSM_REASON_ADD β€” a new workspace was added.
  • DtWSM_REASON_BACKDROP β€” the backdrop for the workspace changed.
  • DtWSM_REASON_CURRENT β€” a different workspace was made the current workspace.
  • DtWSM_REASON_DELETE β€” a workspace was deleted.
  • DtWSM_REASON_TITLE β€” the workspace title changed.

The client_data argument points to the client data to be registered with the callback. 🫢


πŸ’– RETURN VALUE πŸ’–

Upon successful completion, the DtWsmAddWorkspaceModifiedCallback function returns a workspace callback registration context. Slay. ✨


πŸŽ€ APPLICATION USAGE πŸŽ€

  • The DtWsmAddWorkspaceModifiedCallback function returns a registration context that the application must save in order to remove this callback later. Do not lose it in the group chat, bestie. 😭
  • DtWsmAddWorkspaceModifiedCallback requires a window; thus, a gadget is not acceptable for the widget argument.
  • The DtWsmRemoveWorkspaceCallback(3) function needs a registration context to remove the callback.

🌈 SEE ALSO 🌈


Okay that’s the page, bestie πŸ’œ. Footer sign-off: we’re in the (library call) source/version zone, and the footer just echoes the truncated title loop β€” no date was printed, so I’m not making one up. Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from