X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e88be8c942cb93035f4220b54595c23eb9f0df9a..6a0fab3a3ae4d9b7372a25e81faadeb842b9ba6f:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 05a8a767f9..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); @@ -636,7 +646,7 @@ void wxWindowX11::DoGetSize(int *x, int *y) const wxCHECK_RET( xwindow, wxT("invalid window") ); - XSync(wxGlobalDisplay(), False); + // XSync(wxGlobalDisplay(), False); XWindowAttributes attr; Status status = XGetWindowAttributes( wxGlobalDisplay(), xwindow, &attr ); @@ -654,7 +664,7 @@ void wxWindowX11::DoGetPosition(int *x, int *y) const Window window = (Window) m_mainWidget; if (window) { - XSync(wxGlobalDisplay(), False); + // XSync(wxGlobalDisplay(), False); XWindowAttributes attr; Status status = XGetWindowAttributes(wxGlobalDisplay(), window, & attr); wxASSERT(status); @@ -708,7 +718,7 @@ void wxWindowX11::DoGetClientSize(int *x, int *y) const if (window) { - XSync(wxGlobalDisplay(), False); // Is this really a good idea? + // XSync(wxGlobalDisplay(), False); // Is this really a good idea? XWindowAttributes attr; Status status = XGetWindowAttributes( wxGlobalDisplay(), window, &attr ); wxASSERT(status); @@ -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(); + } } // ----------------------------------------------------------------------------