X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8601b2e15bf924d4be6b7843064028e514a71ec8..b72aa48cdeca3530ffb6ac5af438835d58bf79d9:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 493e7d51c3..9fa7e4d83f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -386,7 +386,9 @@ void wxWindowX11::SetFocus() if (wxWindowIsVisible(xwindow)) { - XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime ); + wxLogTrace( _T("focus"), _T("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName()); + // XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime ); + XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime ); m_needsInputFocus = FALSE; } else @@ -1220,6 +1222,9 @@ void wxWindowX11::OnSysColourChanged(wxSysColourChangedEvent& event) } } +// See handler for InFocus case in app.cpp for details. +wxWindow* g_GettingFocus = NULL; + void wxWindowX11::OnInternalIdle() { // Update invalidated regions. @@ -1232,8 +1237,17 @@ void wxWindowX11::OnInternalIdle() // Set the input focus if couldn't do it before if (m_needsInputFocus) { +#if 0 + wxString msg; + msg.Printf("Setting focus for %s from OnInternalIdle\n", GetClassInfo()->GetClassName()); + printf(msg.c_str()); +#endif SetFocus(); + // If it couldn't set the focus now, there's + // no point in trying again. + m_needsInputFocus = FALSE; } + g_GettingFocus = NULL; } // ----------------------------------------------------------------------------