[comp.windows.x.motif] Motif window decorations under olwm

slc1290@hare.udev.cdc.com (steve chesney x4662) (05/03/91)

Our application is written with Motif 1.1 and makes heavy use of Dialog Boxes
(in Dialog Shells); each of these has a title (set by the XmNtitle resource
on the Dialog Shell).  When we run under the Open Look Window Manager (on a
Sun 4 with Open Windows 2) these dialog boxes appear with no window decoration.
This means the title is not shown along with no resize handles, etc. 

Under mwm and twm, the window decorations, including title, do appear.  What
can I do so that they will also show under olwm?

-- 

Steve Chesney       Control Data Corporation      slc1290@hare.udev.cdc.com

nazgul@alfalfa.com (Information Junkie) (05/06/91)

> Under mwm and twm, the window decorations, including title, do appear.  What
> can I do so that they will also show under olwm?

I wish I knew.  I also was unable to find out why (when I use a windowId as
an icon instead of a pixmap) I can't get icon labels.  You will also find that
olwm doesn't keep dialogs on top and doesn't unmap them when you iconize.  I
find it helpful to think of olwm as kind of a stripped down uwm that happens
to have borders.

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

edmark@ISI.COM (Ron O. Edmark) (05/07/91)

> 
> > Under mwm and twm, the window decorations, including title, do appear.  What
> > can I do so that they will also show under olwm?
> 
> I wish I knew.  I also was unable to find out why (when I use a windowId as
> an icon instead of a pixmap) I can't get icon labels.  You will also find that
> olwm doesn't keep dialogs on top and doesn't unmap them when you iconize.  I
> find it helpful to think of olwm as kind of a stripped down uwm that happens
> to have borders.
> 

We are having the same problem in our application.  We found that if we 
parented our popup dialogs with our unmapped application shell we would get
window decorations but if we used the toplevel shells of our mapped windows
the decorations would go away.

A closer look at olwm reveals that it is looking at an  _OL_WIN_ATTR window
property to set the decorations (see pages 70-72 of OLIT Widget Set
Programmer's Guide).  I was going to set the "menu_type" atom to
_OL_MENU_LIMITED for all of our popups but I have been working on a bigger
problem.  None of our option menus work correctly they popup but then pop right
back down.

    +---------------------------------------------------------------------+
    | Ron Edmark                          User Interface Group            |
    | Tel:        (408) 980-1500 x282     Integrated Systems, Inc.        |
    | Internet:   edmark@isi.com          3260 Jay St.                    |
    | Voice mail: (408) 980-1590 x282     Santa Clara, CA 95054           |
    +---------------------------------------------------------------------+

dfc@Inference.COM (Deborah Catalano) (05/09/91)

   > 
   > > Under mwm and twm, the window decorations, including title, do appear.  What
   > > can I do so that they will also show under olwm?
   > 
   A closer look at olwm reveals that it is looking at an  _OL_WIN_ATTR window
   property to set the decorations (see pages 70-72 of OLIT Widget Set
   Programmer's Guide).  I was going to set the "menu_type" atom to
   _OL_MENU_LIMITED for all of our popups but I have been working on a bigger
   problem.  None of our option menus work correctly they popup but then pop right
   back down.

I have finally solved this problem for our application.  I had to set the _OL_WA_WIN_TYPE
property to _OL_WT_OTHER (which tells the window manager not to add anything) then
add the decorations myself.  The following code pieces are from my application:


#include <X11/Xatom.h>
#include <X11/Protocols.h>
#include <Xol/OlClients.h>  
OLWinAttr   *wmWinAttr;
Atom    wmWinAttrAtom;
Atom    wmWtCmd;
Atom    wmWtOther;
long    wmMenuLimited;
Atom    wmDecorAdd;
Atom    wmDecorResize;
Atom    wmDecorHeader;
Atom	wmProtocols;

  ..../* toplevel has been created and 
	display has been opened successfully */

  wmProtocols = XInternAtom(display, "WM_PROTOCOLS", True);

  if (wmProtocols == None) {
    wmWinAttr = NULL;
    wmWinAttrAtom = None;
    wmWtOther = None;
    wmWtCmd = None;
    wmMenuLimited = 0;
    wmDecorAdd = None;
    wmDecorResize = None;
    wmDecorHeader = None;
  }
  else {
    wmWinAttrAtom = XInternAtom(display, "_OL_WIN_ATTR", True);
    wmWtOther = XInternAtom(display, "_OL_WT_OTHER", True);
    wmWtCmd = XInternAtom(display, "_OL_WT_CMD", True);
    wmWinAttr = (OLWinAttr *) malloc(sizeof(OLWinAttr));
    wmWinAttr->win_type = wmWtOther;
    wmDecorAdd = XInternAtom(display, "_OL_DECOR_ADD", True);
    wmDecorResize = XInternAtom(display, "_OL_DECOR_RESIZE", True);
    wmDecorHeader = XInternAtom(display, "_OL_DECOR_HEADER", True);
  }


  ..... /* a dialog box "dbx" has been created ... */

  Atom protocols[2];


    if (!XmIsMotifWMRunning(toplevel)) {
      XChangeProperty(display, XtWindow(XtParent(dbx)), wmWinAttrAtom, XA_ATOM, 
		      32, PropModeReplace, (unsigned char *)wmWinAttr, OLWinAttrNum32s);
      protocols[0] = wmDecorResize;
      protocols[1] = wmDecorHeader;
      XChangeProperty(display, XtWindow(XtParent(dbx->widget)), wmDecorAdd,
	              XA_ATOM, 32, PropModeReplace, (unsigned char *) protocols, 2);
    }





This works great for me except the titles are not quite right.  The title is in
the title area of the dialog box, but I have to resize the box (i.e., widen it) 
to see it.

Hope this helps!

Debbie
-----------------------------------------------------------------------------
Debbie Catalano                              catalano@inference.com
Inference Corporation                        213-322-5004 x194

"I'm a member of the LA X User's Group, not the LAX User's Group!"
-----------------------------------------------------------------------------