diff --git a/include/wx/x11/privx.h b/include/wx/x11/privx.h index ef445f3ba3..412e64e26c 100644 --- a/include/wx/x11/privx.h +++ b/include/wx/x11/privx.h @@ -66,9 +66,6 @@ void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); // For debugging wxString wxGetXEventName(XEvent& event); -// Is the window visible? -bool wxWindowIsVisible(Window win); - #if wxUSE_NANOX #define XEventGetWindow(event) event->general.wid #define XEventGetType(event) event->general.type diff --git a/src/x11/utils.cpp b/src/x11/utils.cpp index ffc6805717..fa01d86848 100644 --- a/src/x11/utils.cpp +++ b/src/x11/utils.cpp @@ -395,10 +395,3 @@ wxString wxGetXEventName(XEvent& event) #endif } -bool wxWindowIsVisible(Window win) -{ - XWindowAttributes wa; - XGetWindowAttributes(wxGlobalDisplay(), win, &wa); - - return (wa.map_state == IsViewable); -} diff --git a/src/x11/window.cpp b/src/x11/window.cpp index e9692b8600..3b569bf98f 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -397,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 );