Solaris Common Desktop Environment: Programmer's Guide

Identifying Workspaces Containing the Application Windows

The function DtWsmGetWorkspacesOccupied() returns a list of the workspaces in which a specified application window resides. In occupy.c, the procedure ShowWorkspaceOccupancy() calls this function. Based on the results of this call, ShowWorkspaceOccupancy() changes the appearance of the toggle buttons that represent the workspaces. A check mark appears on every toggle button in whose workspace the application window resides.

To Identify Workspaces That Contain the Application Window

    Use DtWsmGetWorkspacesOccupied().

    rval = DtWsmGetWorkspacesOccupied(XtDisplay(toplevel)
                XtWindow(toplevel), &paWsIn, &numWsIn);

    where:

    • XtDisplay(toplevel) is the X display.

    • XtWindow(toplevel) is the window to be searched for in the workspaces.

    • paWsIn is the address of a pointer to a list of workspace names that have been converted to X atoms.

    • numWsIn is the address of an integer into which the number of workspaces in the list is placed.

    After this call, loops are set up to compare the list of workspaces (found in the procedure SetUpWorkspaceButtons() by DtWsmGetWorkspaceList()) with the list of workspaces in which the application window was found to reside. The toggle button resource XmNset is set to True for each toggle button that represents a workspace in which the application window resides.