DTWSMGETWORKSPACESOCCUPIED(3)

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

πŸ¦‹ DtWsmGetWorkspacesOccupied β€” like, the library call one, bestie πŸ¦‹

okay so we're in the <Dt/Wsm.h> cinematic universe today, and this little icon is from the DtWsmGetWor...cesOccupied(library call) manual, page DtWsmGetWorkspacesOccupied(3). stay with me, it's actually so good.


✨ NAME ✨

DtWsmGetWorkspacesOccupied β€” get the workspaces in which a window resides πŸ’…

no cap, that's literally the whole vibe: you got a window, you wanna know which workspaces it's living in, this function is the one who tells you.


🌸 SYNOPSIS 🌸

#include <Dt/Wsm.h>
Status DtWsmGetWorkspacesOccupied(
Display *display,
Window window,
Atom **ppaWorkspaces,
int *pNumWs);

look at those four parameters. main character energy, honestly. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

so the DtWsmGetWorkspacesOccupied function works with the XCDE workspace manager, dtwm(1), and it returns the list of workspaces in which this window resides. each element of that list? it's the name of a workspace β€” but converted to an X atom, periodt. ✨

let's do the cast, one by one, because they all matter:

  • display β€” the X display. that's it, that's the whole thing. it's the display, bestie. πŸ–₯️
  • window β€” the window of interest. the one you're being nosy about. πŸ™ˆ
  • *ppaWorkspaces β€” the address of a pointer that receives the pointer to a list of workspace names (converted to X atoms). yes, a pointer to a pointer, it's giving inception but make it X11. πŸŒ€
  • pNumWs β€” the address of an integer that receives the number of elements in the list of workspaces returned in *ppaWorkspaces. so you know how many you got. iconic. πŸ‘‘

🌈 RETURN VALUE 🌈

upon successful completion, the DtWsmGetWorkspacesOccupied function returns Success, and the workspace manager returns in *ppaWorkspaces a list of atoms identifying the occupied workspaces, and returns in pNumWs the number of occupied workspaces. slay. πŸ’š

otherwise? it returns a value not equal to Success. that's the whole else branch, and honestly, she said what she said. πŸ’€


🧚 APPLICATION USAGE 🧚

if the DtWsmGetWorkspacesOccupied function is not successful, that failure may be due to a memory allocation error, or failure to find the correct workspace information (that is, the XCDE workspace manager, dtwm(1), is not running). so lowkey check that dtwm is actually alive before you spiral, okay? 😭

⚠️ important one, don't skip it: the application must use XtFree(3) to free data returned in *ppaWorkspaces. your girl does not want you leaking memory. that's not the aesthetic. 🫢

πŸ“ SEE ALSO πŸ“


that's the whole page, bestie, nothing skipped. this lil beauty lives in the DtWsmGetWor...cesOccupied(library call) manual, and the footer that shipped with it is that same DtWsmGetWor...cesOccupied(library call) line β€” no date on this one, so consider this your cute little sign-off. go free your atoms with XtFree(3) and hydrate. πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from