diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index c37533c8dd..551f542019 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -1234,7 +1234,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, *descent = YDEV2LOGREL(m_mglFont->descent); if ( externalLeading ) *externalLeading = YDEV2LOGREL(m_mglFont->leading); - + if ( theFont != NULL ) wxConstCast(this, wxDC)->SetFont(oldFont); } diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 09f69f1dd7..55dfa75291 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -626,6 +626,8 @@ bool wxWindowMGL::Create(wxWindow *parent, void wxWindowMGL::SetFocus() { + if ( gs_focusedWindow == this ) return; + if ( gs_focusedWindow ) gs_focusedWindow->KillFocus(); @@ -658,7 +660,7 @@ void wxWindowMGL::SetFocus() wxFocusEvent event(wxEVT_SET_FOCUS, GetId()); event.SetEventObject(this); - AddPendingEvent(event); + GetEventHandler()->ProcessEvent(event); } void wxWindowMGL::KillFocus() @@ -679,7 +681,7 @@ void wxWindowMGL::KillFocus() wxFocusEvent event(wxEVT_KILL_FOCUS, GetId()); event.SetEventObject(this); - AddPendingEvent(event); + GetEventHandler()->ProcessEvent(event); } // ----------------------------------------------------------------------------