From 31b81622d3952abdc2d59f0509436f7c0b5fd19c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Feb 2011 12:30:43 +0000 Subject: [PATCH] Remove X11-specific wxWindowIsVisible() from common Unix file. XGetWindowAttributes() used in this function resulted in link problems under Fedora 14 because we don't explicitly link with libX11. Instead of doing this, simply get rid of this function as it seems to be used in exactly one place in wxX11 code only anyhow. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/x11/privx.h | 3 --- src/x11/utils.cpp | 7 ------- src/x11/window.cpp | 5 ++++- 3 files changed, 4 insertions(+), 11 deletions(-) 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 ); -- 2.45.2