// Can't remember what this was about... but I think it's necessary.
- if (USE_INVISIBLE_RESIZE)
+ if (wxUSE_INVISIBLE_RESIZE)
{
if (pos.x > -1)
XtVaSetValues(dialogShell, XmNx, pos.x,
// Positioning of the dialog doesn't work properly unless the dialog
// is managed, so we manage without mapping to the screen.
// To show, we map the shell (actually it's parent).
- if (!USE_INVISIBLE_RESIZE)
+ if (!wxUSE_INVISIBLE_RESIZE)
XtVaSetValues(shell, XmNmappedWhenManaged, FALSE, NULL);
- if (!USE_INVISIBLE_RESIZE)
+ if (!wxUSE_INVISIBLE_RESIZE)
{
XtManageChild(dialogShell);
SetSize(pos.x, pos.y, size.x, size.y);
wxDialog::~wxDialog()
{
m_modalShowing = FALSE;
- if (!USE_INVISIBLE_RESIZE && m_mainWidget)
+ if (!wxUSE_INVISIBLE_RESIZE && m_mainWidget)
{
XtUnmapWidget((Widget) m_mainWidget);
}
// Now process all events, because otherwise
// this might remain on the screen.
- XSync(XtDisplay(XtParent((Widget) m_mainWidget)), FALSE);
+ Display* display;
+ if (m_mainWidget)
+ display = XtDisplay((Widget) m_mainWidget);
+ else
+ display = (Display*) wxGetDisplay();
+
+ XSync(display, FALSE);
XEvent event;
while (XtAppPending((XtAppContext) wxTheApp->GetAppContext())) {
- XFlush(XtDisplay((Widget) XtParent((Widget) m_mainWidget)));
+ XFlush(display);
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
XtDispatchEvent(&event);
}
if (show)
{
- if (!USE_INVISIBLE_RESIZE)
+ if (!wxUSE_INVISIBLE_RESIZE)
XtMapWidget(XtParent((Widget) m_mainWidget));
else
XtManageChild((Widget) m_mainWidget) ;
}
else
{
- if (!USE_INVISIBLE_RESIZE)
+ if (!wxUSE_INVISIBLE_RESIZE)
XtUnmapWidget(XtParent((Widget) m_mainWidget));
else
XtUnmanageChild((Widget) m_mainWidget) ;