Changed the way ApplicationShells are used: now wxMotif
creates one ApplicationShell per display, and makes top level windows popup childs of the ApplicationShell. Removed a couple of unused variables from wxApp. Replaced some calls to wxGetDisplay with XtDisplay(widget) or event.xany.display, and some others with wxGlobalDisplay (the latter changes are just eyecandy). Used wxFlushEvents where appropriate. Fixed (hopefully) wxFindAcceleratorText and wxFindAccelerator; for now the new version is still disabled, awaiting further testing. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -305,8 +305,8 @@ bool wxDialog::Show( bool show )
|
||||
else
|
||||
XtUnmanageChild((Widget)m_mainWidget) ;
|
||||
|
||||
XFlush(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()));
|
||||
XSync(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()), FALSE);
|
||||
XFlush(XtDisplay((Widget)m_mainWidget));
|
||||
XSync(XtDisplay((Widget)m_mainWidget), FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -319,6 +319,9 @@ int wxDialog::ShowModal()
|
||||
|
||||
Show(TRUE);
|
||||
|
||||
// after the event loop ran, the widget might already have been destroyed
|
||||
WXDisplay* display = (WXDisplay*)XtDisplay( (Widget)m_mainWidget );
|
||||
|
||||
if (m_modalShowing)
|
||||
return 0;
|
||||
m_eventLoop = new wxEventLoop;
|
||||
@@ -329,12 +332,7 @@ int wxDialog::ShowModal()
|
||||
m_eventLoop->Run();
|
||||
|
||||
// Now process all events in case they get sent to a destroyed dialog
|
||||
XSync(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()), FALSE);
|
||||
while (m_eventLoop->Pending())
|
||||
{
|
||||
XFlush(XtDisplay((Widget) wxTheApp->GetTopLevelWidget()));
|
||||
m_eventLoop->Dispatch();
|
||||
}
|
||||
wxFlushEvents( display );
|
||||
|
||||
delete m_eventLoop;
|
||||
m_eventLoop = NULL;
|
||||
|
Reference in New Issue
Block a user