git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45294
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- gboolean ret = FALSE;
-
// don't send the window a kill focus event if it thinks that it doesn't
// have focus already
if ( win->m_hasFocus )
{
// don't send the window a kill focus event if it thinks that it doesn't
// have focus already
if ( win->m_hasFocus )
{
+ // the event handler might delete the window when it loses focus, so
+ // check whether this is a custom window before calling it
+ const bool has_wxwindow = win->m_wxwindow != NULL;
+
win->m_hasFocus = false;
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
win->m_hasFocus = false;
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
(void)win->GTKProcessEvent( event );
(void)win->GTKProcessEvent( event );
+ // Disable default focus handling for custom windows
+ // since the default GTK+ handler issues a repaint
+ if ( has_wxwindow )
+ return TRUE;
- // Disable default focus handling for custom windows
- // since the default GTK+ handler issues a repaint
- if (win->m_wxwindow)
- return ret;
-
+ // continue with normal processing
+ if ( thisWindow->MacIsUserPane() )
+ result = noErr ;
+
if ( controlPart == kControlFocusNoPart )
{
#if wxUSE_CARET
if ( controlPart == kControlFocusNoPart )
{
#if wxUSE_CARET
event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ;
}
event.SetEventObject(thisWindow);
thisWindow->GetEventHandler()->ProcessEvent(event) ;
}
-
- if ( thisWindow->MacIsUserPane() )
- result = noErr ;