X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8601b2e15bf924d4be6b7843064028e514a71ec8..aed08d7967af9365edd61723ca9fff977ca744c2:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 493e7d51c3..9f980f69f5 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -147,7 +147,7 @@ bool wxWindowX11::Create(wxWindow *parent, wxWindowID id, m_foregroundColour = *wxBLACK; m_foregroundColour.CalcPixel( (WXColormap) cm ); - Window xparent = (Window) parent->GetClientWindow(); + Window xparent = (Window) parent->GetClientAreaWindow(); // Add window's own scrollbars to main window, not to client window if (parent->GetInsertIntoMain()) @@ -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 @@ -600,7 +602,7 @@ void wxWindowX11::ScrollWindow(int dx, int dy, const wxRect *rect) m_clearRegion.Intersect( 0, 0, cw, ch ); } - Window xwindow = (Window) GetClientWindow(); + Window xwindow = (Window) GetClientAreaWindow(); wxCHECK_RET( xwindow, wxT("invalid window") ); @@ -1127,7 +1129,7 @@ void wxWindowX11::SendEraseEvents() if (!GetEventHandler()->ProcessEvent(erase_event) ) { Display *xdisplay = wxGlobalDisplay(); - Window xwindow = (Window) GetClientWindow(); + Window xwindow = (Window) GetClientAreaWindow(); XSetForeground( xdisplay, g_eraseGC, m_backgroundColour.GetPixel() ); wxRegionIterator upd( m_clearRegion ); @@ -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; } // ---------------------------------------------------------------------------- @@ -1313,7 +1327,7 @@ WXWindow wxWindowX11::GetMainWindow() const return m_mainWindow; } -WXWindow wxWindowX11::GetClientWindow() const +WXWindow wxWindowX11::GetClientAreaWindow() const { return m_clientWindow; }