X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ff6b424a2e66adde9357ed87eb3a9b9448173806..ae1daed0739bf3c60b5bff4fbda823be2ee67872:/src/x11/window.cpp diff --git a/src/x11/window.cpp b/src/x11/window.cpp index a83a67877c..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