X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2c0dabfa61fc435265f3dc71122592d359f0119..6cc687bfee071b5328f9e48d1708795287006bb7:/src/x11/toplevel.cpp diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index d1a58623b7..eb297ec92d 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -452,13 +452,29 @@ void wxTopLevelWindowX11::DoGetClientSize( int *width, int *height ) const *height = m_height; } +void wxTopLevelWindowX11::DoGetSize( int *width, int *height ) const +{ + // TODO add non-client size + + if (width) + *width = m_width; + if (height) + *height = m_height; +} + void wxTopLevelWindowX11::DoSetClientSize(int width, int height) { - // wxLogDebug("DoSetClientSize: %s (%ld) %dx%d", GetClassInfo()->GetClassName(), GetId(), width, height); - + int old_width = m_width; + int old_height = m_height; + m_width = width; m_height = height; + if (m_width == old_width && m_height == old_height) + return; + + // wxLogDebug("DoSetClientSize: %s (%ld) %dx%d", GetClassInfo()->GetClassName(), GetId(), width, height); + #if !wxUSE_NANOX XSizeHints size_hints; size_hints.flags = PSize; @@ -472,7 +488,10 @@ void wxTopLevelWindowX11::DoSetClientSize(int width, int height) void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int sizeFlags) { - // wxLogDebug("DoSetSize: %s (%ld) %d, %d %dx%d", GetClassInfo()->GetClassName(), GetId(), x, y, width, height); + int old_x = m_x; + int old_y = m_y; + int old_width = m_width; + int old_height = m_height; if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) m_x = x; @@ -485,7 +504,12 @@ void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int siz if (height != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) m_height = height; + + if (m_x == old_x && m_y == old_y && m_width == old_width && m_height == old_height) + return; + // wxLogDebug("DoSetSize: %s (%ld) %d, %d %dx%d", GetClassInfo()->GetClassName(), GetId(), x, y, width, height); + #if !wxUSE_NANOX XSizeHints size_hints; size_hints.flags = 0;