You can monitor workspace changes by using either or both of the following functions:
DtWsmAddCurrentWorkspaceCallback() registers an application callback to be called whenever the Workspace Manager is switched to a new workspace. See the DtWsmAddCurrentWorkspaceCallback(3) man page for more information.
DtWsmWorkspaceModifiedCallback() registers an application callback to be called whenever a workspace is added, deleted, or changed. See the DtWsmWorkspaceModifiedCallback(3) man page for more information.
Use DtWsmAddCurrentWorkspaceCallback().
In the demo program wsinfo.c, this function is called after the top-level widget is realized.
DtWsmAddCurrentWorkspaceCallback (toplevel, wschangecb, NULL);
where
toplevel is the application's top level widget.
wschangecb() is the name of the function to be called.
NULL is the parameter for client data to be passed to the callback. In this case, no data is passed.
Use DtWsmWorkspaceModifiedCallback().
DtWsmWorkspaceModifiedCallback toplevel, wschangecb, NULL);
where:
toplevel is the application's top-level widget.
wschangecb() is the name of the function to be called.
NULL is the parameter for client data to be passed to the callback. In this case, no data is passed.