Fix a TLW sizing issue with Wayland

Don't include the size of client side decorations when changing the
size of a GtkWindow, as GTK will add in the decoration size itself.
See #22141
This commit is contained in:
Paul Cornett
2022-03-14 09:40:06 -07:00
parent 1c5e66a12c
commit 7ce4e521c5

View File

@@ -1221,11 +1221,8 @@ void wxTopLevelWindowGTK::DoMoveWindow(int WXUNUSED(x), int WXUNUSED(y), int WXU
void wxTopLevelWindowGTK::GTKDoGetSize(int *width, int *height) const void wxTopLevelWindowGTK::GTKDoGetSize(int *width, int *height) const
{ {
wxSize size(m_width, m_height); wxSize size(m_width, m_height);
if (!HasClientDecor(m_widget)) size.x -= m_decorSize.left + m_decorSize.right;
{ size.y -= m_decorSize.top + m_decorSize.bottom;
size.x -= m_decorSize.left + m_decorSize.right;
size.y -= m_decorSize.top + m_decorSize.bottom;
}
if (size.x < 0) size.x = 0; if (size.x < 0) size.x = 0;
if (size.y < 0) size.y = 0; if (size.y < 0) size.y = 0;
if (width) *width = size.x; if (width) *width = size.x;