X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be82fa69894de6a44094e8f9fdceed610fcb3dc3..10c08696053f48fa999349285365c77aba620afc:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index a04296c7f9..3b569bf98f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -47,7 +47,6 @@ #include "wx/layout.h" #include "wx/menuitem.h" #include "wx/module.h" - #include "wx/unix/utilsx11.h" #endif #include "wx/fontutil.h" @@ -57,6 +56,8 @@ #include "wx/dnd.h" #endif +#include "wx/unix/utilsx11.h" + #include "wx/x11/private.h" #include "X11/Xutil.h" @@ -396,7 +397,10 @@ void wxWindowX11::SetFocus() } #endif - if (wxWindowIsVisible(xwindow)) + XWindowAttributes wa; + XGetWindowAttributes(wxGlobalDisplay(), xwindow, &wa); + + if (wa.map_state == IsViewable) { wxLogTrace( wxT("focus"), wxT("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName()); // XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime ); @@ -1317,10 +1321,7 @@ void wxWindowX11::OnInternalIdle() // Update invalidated regions. Update(); - // This calls the UI-update mechanism (querying windows for - // menu/toolbar/control state information) - if (wxUpdateUIEvent::CanUpdate((wxWindow*) this) && IsShownOnScreen()) - UpdateWindowUI(wxUPDATE_UI_FROMIDLE); + wxWindowBase::OnInternalIdle(); // Set the input focus if couldn't do it before if (m_needsInputFocus)