diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index d7b55ae685..2430773c43 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -199,7 +199,7 @@ public: bool GTKHandleFocusIn(); bool GTKHandleFocusOut(); void GTKHandleFocusOutNoDeferring(); - static void GTKHandleDeferredFocusOut(); + void GTKHandleDeferredFocusOut(); // Called when m_widget becomes realized. Derived classes must call the // base class method if they override it. diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index b6182ede53..1f1c6244ec 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3828,7 +3828,7 @@ bool wxWindowGTK::GTKShowFromOnIdle() void wxWindowGTK::OnInternalIdle() { if ( gs_deferredFocusOut ) - GTKHandleDeferredFocusOut(); + gs_deferredFocusOut->GTKHandleDeferredFocusOut(); // Check if we have to show window now if (GTKShowFromOnIdle()) return; @@ -4348,7 +4348,7 @@ bool wxWindowGTK::GTKHandleFocusIn() // otherwise we need to send focus-out first wxASSERT_MSG ( gs_deferredFocusOut != this, "GTKHandleFocusIn(GTKFocus_Normal) called even though focus changed back to itself - derived class should handle this" ); - GTKHandleDeferredFocusOut(); + gs_deferredFocusOut->GTKHandleDeferredFocusOut(); } @@ -4459,20 +4459,18 @@ void wxWindowGTK::GTKHandleFocusOutNoDeferring() GTKProcessEvent( event ); } -/*static*/ void wxWindowGTK::GTKHandleDeferredFocusOut() { // NB: See GTKHandleFocusOut() for explanation. This function is called // from either GTKHandleFocusIn() or OnInternalIdle() to process - // deferred event. - wxWindowGTK *win = gs_deferredFocusOut; + // deferred event for this window. gs_deferredFocusOut = NULL; wxLogTrace(TRACE_FOCUS, "processing deferred focus_out event for %s(%p, %s)", - win->GetClassInfo()->GetClassName(), win, win->GetLabel()); + GetClassInfo()->GetClassName(), this, GetLabel()); - win->GTKHandleFocusOutNoDeferring(); + GTKHandleFocusOutNoDeferring(); } void wxWindowGTK::SetFocus()