- // This patch comes from Torsten Liermann lier@lier1.muc.de
- if (XmIsMotifWMRunning( (Widget) m_frameShell ))
- {
- int decor = 0;
- if (style & wxRESIZE_BORDER)
- decor |= MWM_DECOR_RESIZEH;
- if (style & wxSYSTEM_MENU)
- decor |= MWM_DECOR_MENU;
- if ((style & wxCAPTION) ||
- (style & wxTINY_CAPTION_HORIZ) ||
- (style & wxTINY_CAPTION_VERT))
- decor |= MWM_DECOR_TITLE;
- if (style & wxTHICK_FRAME)
- decor |= MWM_DECOR_BORDER;
- if (style & wxTHICK_FRAME)
- decor |= MWM_DECOR_BORDER;
- if (style & wxMINIMIZE_BOX)
- decor |= MWM_DECOR_MINIMIZE;
- if (style & wxMAXIMIZE_BOX)
- decor |= MWM_DECOR_MAXIMIZE;
- XtVaSetValues((Widget) m_frameShell,XmNmwmDecorations,decor,NULL);
- }
- // This allows non-Motif window managers to support at least the
- // no-decorations case.
- else
- {
- if (style == 0)
- XtVaSetValues((Widget) m_frameShell,XmNoverrideRedirect,TRUE,NULL);
- }
- XtRealizeWidget((Widget) m_frameShell);
-
- // Intercept CLOSE messages from the window manager
- Atom WM_DELETE_WINDOW = XmInternAtom(XtDisplay((Widget) m_frameShell), "WM_DELETE_WINDOW", False);
-#if (XmREVISION > 1 || XmVERSION > 1)
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (XtCallbackProc) wxCloseFrameCallback, (XtPointer)this);
-#else
-#if XmREVISION == 1
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (XtCallbackProc) wxCloseFrameCallback, (caddr_t)this);
-#else
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (void (*)())wxCloseFrameCallback, (caddr_t)this);
-#endif
-#endif
-
- ChangeBackgroundColour();
-
- PreResize();
-
- wxSizeEvent sizeEvent(wxSize(width, height), GetId());
- sizeEvent.SetEventObject(this);
-
- GetEventHandler()->ProcessEvent(sizeEvent);
-
- return TRUE;