From 3cd2f0bdee7cfaac783455aa25cb617b9d601f17 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Jul 2004 23:34:37 +0000 Subject: [PATCH] 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 --- docs/changes.txt | 4 ++++ src/x11/app.cpp | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 968b0f03d4..1f42a61bf9 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -256,6 +256,10 @@ wxMSW: - support for alpha channel in toolbar bitmaps (Jurgen Doornik) - wxFileDialog can now be moved and centered (Randall Fox) +wxUniv/X11: + +- fixed fatal crash when opening a menu + wxWinCE: - added automatized but customizable handling of native SmartPhone menus diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 9a5fff8ef2..5d1ab3726c 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -446,16 +446,15 @@ bool wxApp::ProcessXEvent(WXEvent* _event) if (event->update.utype == GR_UPDATE_SIZE) #endif { - if (win->IsTopLevel()) + wxTopLevelWindow *tlw = wxDynamicCast(win, wxTopLevelWindow); + if ( tlw ) { - wxTopLevelWindow *tlw = (wxTopLevelWindow*) win; tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event), XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) ); } - if (win->IsTopLevel() && win->IsShown()) + if ( tlw && tlw->IsShown() ) { - wxTopLevelWindowX11 *tlw = (wxTopLevelWindowX11 *) win; tlw->SetNeedResizeInIdle(); } else @@ -467,7 +466,6 @@ bool wxApp::ProcessXEvent(WXEvent* _event) } } return FALSE; - break; } #if !wxUSE_NANOX case PropertyNotify: -- 2.45.2