X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d2cef1c694eb0c34ae4b9c9bd7ab04e3255301d..6a0fab3a3ae4d9b7372a25e81faadeb842b9ba6f:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index cb7c133691..270bb56364 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -251,7 +251,17 @@ void wxWindowX11::SetFocus() Window xwindow = (Window) GetMainWindow(); wxCHECK_RET( xwindow, wxT("invalid window") ); - + + wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") ); + +#if 0 + if (GetName() == "scrollBar") + { + char *crash = NULL; + *crash = 0; + } +#endif + if (wxWindowIsVisible(xwindow)) { XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime ); @@ -562,8 +572,8 @@ void wxWindowX11::ScrollWindow(int dx, int dy, const wxRect *rect) else { wxRect rect; - if (dx < 0) rect.x = cw+dx; else rect.x = s_x; - if (dy < 0) rect.y = ch+dy; else rect.y = s_y; + if (dx < 0) rect.x = cw+dx + offset.x; else rect.x = s_x; + if (dy < 0) rect.y = ch+dy + offset.y; else rect.y = s_y; if (dy != 0) rect.width = cw; else rect.width = abs(dx); if (dx != 0) rect.height = ch; else rect.height = abs(dy); @@ -960,6 +970,7 @@ void wxWindowX11::Update() { if (!m_updateRegion.IsEmpty()) { + // wxLogDebug("wxWindowX11::Update: %s", GetClassInfo()->GetClassName()); // Actually send erase events. SendEraseEvents(); @@ -987,7 +998,7 @@ void wxWindowX11::SendEraseEvents() wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); - + if (!GetEventHandler()->ProcessEvent(erase_event)) { Window xwindow = (Window) GetMainWindow(); @@ -1022,9 +1033,8 @@ void wxWindowX11::SendPaintEvents() wxPaintEvent paint_event( GetId() ); paint_event.SetEventObject( this ); GetEventHandler()->ProcessEvent( paint_event ); - - m_updateRegion.Clear(); + m_updateRegion.Clear(); m_clipPaintRegion = FALSE; } @@ -1062,7 +1072,9 @@ void wxWindowX11::OnInternalIdle() // Set the input focus if couldn't do it before if (m_needsInputFocus) + { SetFocus(); + } } // ----------------------------------------------------------------------------