Fixed XGetWindowAttributes so 'mapped' is reported

correctly. About box now pops up, but is a mess.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-02-26 14:51:08 +00:00
parent 16d865f756
commit ff6b424a2e
3 changed files with 20 additions and 1 deletions

View File

@@ -180,8 +180,10 @@ void wxApp::CleanUp()
int wxEntryStart( int& argc, char *argv[] ) int wxEntryStart( int& argc, char *argv[] )
{ {
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
#if !wxUSE_NANOX
// install the X error handler // install the X error handler
gs_pfnXErrorHandler = XSetErrorHandler( wxXErrorHandler ); gs_pfnXErrorHandler = XSetErrorHandler( wxXErrorHandler );
#endif
#endif // __WXDEBUG__ #endif // __WXDEBUG__
wxString displayName; wxString displayName;

View File

@@ -155,6 +155,8 @@ Status XGetWindowAttributes(Display* display, Window w,
XWindowAttributes* window_attributes) XWindowAttributes* window_attributes)
{ {
GR_WINDOW_INFO info; GR_WINDOW_INFO info;
Window parent = 0;
GrFlush();
GrGetWindowInfo(w, & info); GrGetWindowInfo(w, & info);
window_attributes->x = info.x; window_attributes->x = info.x;
@@ -180,12 +182,25 @@ Status XGetWindowAttributes(Display* display, Window w,
window_attributes->override_redirect = FALSE; window_attributes->override_redirect = FALSE;
window_attributes->screen = NULL; window_attributes->screen = NULL;
/* We need to check if any parents are unmapped,
* or we will report a window as mapped when it is not.
*/
parent = info.parent;
while (parent)
{
GrGetWindowInfo(parent, & info);
if (info.mapped == 0)
window_attributes->map_state = IsUnmapped;
parent = info.parent;
}
return 1; return 1;
} }
static XErrorHandler* g_ErrorHandler = NULL; static XErrorHandler* g_ErrorHandler = NULL;
static void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep) void DefaultNanoXErrorHandler(GR_EVENT_ERROR* ep)
{ {
if (g_ErrorHandler) if (g_ErrorHandler)
{ {

View File

@@ -1062,7 +1062,9 @@ void wxWindowX11::OnInternalIdle()
// Set the input focus if couldn't do it before // Set the input focus if couldn't do it before
if (m_needsInputFocus) if (m_needsInputFocus)
{
SetFocus(); SetFocus();
}
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------