IsTopLevel() may return true not only for wxTLW: this fixes crash when opening a menu

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-07-25 23:34:37 +00:00
parent 082006f3ab
commit 3cd2f0bdee
2 changed files with 7 additions and 5 deletions

View File

@@ -256,6 +256,10 @@ wxMSW:
- support for alpha channel in toolbar bitmaps (Jurgen Doornik) - support for alpha channel in toolbar bitmaps (Jurgen Doornik)
- wxFileDialog can now be moved and centered (Randall Fox) - wxFileDialog can now be moved and centered (Randall Fox)
wxUniv/X11:
- fixed fatal crash when opening a menu
wxWinCE: wxWinCE:
- added automatized but customizable handling of native SmartPhone menus - added automatized but customizable handling of native SmartPhone menus

View File

@@ -446,16 +446,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
if (event->update.utype == GR_UPDATE_SIZE) if (event->update.utype == GR_UPDATE_SIZE)
#endif #endif
{ {
if (win->IsTopLevel()) wxTopLevelWindow *tlw = wxDynamicCast(win, wxTopLevelWindow);
if ( tlw )
{ {
wxTopLevelWindow *tlw = (wxTopLevelWindow*) win;
tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event), tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event),
XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) ); XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) );
} }
if (win->IsTopLevel() && win->IsShown()) if ( tlw && tlw->IsShown() )
{ {
wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win;
tlw->SetNeedResizeInIdle(); tlw->SetNeedResizeInIdle();
} }
else else
@@ -467,7 +466,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
} }
} }
return FALSE; return FALSE;
break;
} }
#if !wxUSE_NANOX #if !wxUSE_NANOX
case PropertyNotify: case PropertyNotify: