X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f809133f9eb30d4746c71098bbc14c621b94ef0d..22fb32d5071b4a234cb600e50e59f971dd78d04a:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index cd6575da0c..4012874c15 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 ); @@ -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); @@ -771,6 +781,14 @@ void wxWindowX11::DoSetClientSize(int width, int height) wxCHECK_RET( xwindow, wxT("invalid window") ); + XWindowChanges windowChanges; + windowChanges.width = width; + windowChanges.height = height; + windowChanges.stack_mode = 0; + int valueMask = CWWidth | CWHeight; + + XConfigureWindow( wxGlobalDisplay(), xwindow, valueMask, &windowChanges ); +#if 0 XWindowAttributes attr; Status status = XGetWindowAttributes( wxGlobalDisplay(), xwindow, &attr ); wxCHECK_RET( status, wxT("invalid window attributes") ); @@ -787,6 +805,7 @@ void wxWindowX11::DoSetClientSize(int width, int height) new_h = height; DoMoveWindow( new_x, new_y, new_w, new_h ); +#endif } // For implementation purposes - sometimes decorations make the client area @@ -960,6 +979,7 @@ void wxWindowX11::Update() { if (!m_updateRegion.IsEmpty()) { + // wxLogDebug("wxWindowX11::Update: %s", GetClassInfo()->GetClassName()); // Actually send erase events. SendEraseEvents(); @@ -987,7 +1007,7 @@ void wxWindowX11::SendEraseEvents() wxEraseEvent erase_event( GetId(), &dc ); erase_event.SetEventObject( this ); - + if (!GetEventHandler()->ProcessEvent(erase_event)) { Window xwindow = (Window) GetMainWindow(); @@ -1022,9 +1042,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 +1081,9 @@ void wxWindowX11::OnInternalIdle() // Set the input focus if couldn't do it before if (m_needsInputFocus) + { SetFocus(); + } } // ----------------------------------------------------------------------------