|
>>An ISV asked me if there is any easy way to tell if CDE is running on a
>>system? They want to be able to make a check in thier code for this.
What part of CDE? The login manager? the session manager? the window
manager? Lots of this is customizable. Here's a code snippet used by
the Sysman apps to figure out if the system is running dtwm vs mwm.
/*
* Function:
* IsCDEWMRunning - returns true of dtwm is running. This is
* a hack for now cause there is no CDE equivalent
* to XmIsMotifWMRunning.
* Inputs:
*
* Outputs:
*
* Returns:
* true is dtwm is running.
* Notes:
* The check below relies on the DtWsmGetCurrentWorkspace function.
* This is only a hueristic since some other wm might
* emulate dtwm but it's good enough for our purposes.
*/
#if AM_PROTO_OK
Boolean IsCDEWMRunning(Widget toplevel)
#else
Boolean IsCDEWMRunning(toplevel)
Widget toplevel;
#endif /* AM_PROTO_OK */
{
Status status;
Atom workspace;
status = DtWsmGetCurrentWorkspace(XtDisplay(toplevel),
RootWindowOfScreen(DefaultScreenOfDisplay(XtDisplay(toplevel))),
&workspace);
return(status == Success);
|