revert updating GTK size hints when window decorations change, it messes up min size set by a sizer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -145,8 +145,6 @@ private:
|
|||||||
|
|
||||||
// is the frame currently grabbed explicitly by the application?
|
// is the frame currently grabbed explicitly by the application?
|
||||||
bool m_grabbed;
|
bool m_grabbed;
|
||||||
|
|
||||||
wxSize m_sizeIncHint;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_GTK_TOPLEVEL_H_
|
#endif // _WX_GTK_TOPLEVEL_H_
|
||||||
|
@@ -939,8 +939,6 @@ void wxTopLevelWindowGTK::DoSetSizeHints( int minW, int minH,
|
|||||||
int incW, int incH )
|
int incW, int incH )
|
||||||
{
|
{
|
||||||
wxTopLevelWindowBase::DoSetSizeHints( minW, minH, maxW, maxH, incW, incH );
|
wxTopLevelWindowBase::DoSetSizeHints( minW, minH, maxW, maxH, incW, incH );
|
||||||
m_sizeIncHint.x = incW;
|
|
||||||
m_sizeIncHint.y = incH;
|
|
||||||
|
|
||||||
const wxSize minSize = GetMinSize();
|
const wxSize minSize = GetMinSize();
|
||||||
const wxSize maxSize = GetMaxSize();
|
const wxSize maxSize = GetMaxSize();
|
||||||
@@ -982,23 +980,32 @@ void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)
|
|||||||
{
|
{
|
||||||
const wxSize diff = decorSize - m_decorSize;
|
const wxSize diff = decorSize - m_decorSize;
|
||||||
m_decorSize = decorSize;
|
m_decorSize = decorSize;
|
||||||
SetSizeHints(GetMinSize(), GetMaxSize(), m_sizeIncHint);
|
bool resized = false;
|
||||||
if (m_deferShow)
|
if (m_deferShow)
|
||||||
{
|
{
|
||||||
// keep overall size unchanged by shrinking m_widget
|
// keep overall size unchanged by shrinking m_widget
|
||||||
int w, h;
|
int w, h;
|
||||||
GTKDoGetSize(&w, &h);
|
GTKDoGetSize(&w, &h);
|
||||||
gtk_window_resize(GTK_WINDOW(m_widget), w, h);
|
// but not if size would be less than minimum, it won't take effect
|
||||||
|
const wxSize minSize = GetMinSize();
|
||||||
|
if (w >= minSize.x && h >= minSize.y)
|
||||||
|
{
|
||||||
|
gtk_window_resize(GTK_WINDOW(m_widget), w, h);
|
||||||
|
resized = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
if (!resized)
|
||||||
{
|
{
|
||||||
// adjust overall size to match change in frame extents
|
// adjust overall size to match change in frame extents
|
||||||
m_width += diff.x;
|
m_width += diff.x;
|
||||||
m_height += diff.y;
|
m_height += diff.y;
|
||||||
if (m_width < 0) m_width = 0;
|
if (m_width < 0) m_width = 0;
|
||||||
if (m_height < 0) m_height = 0;
|
if (m_height < 0) m_height = 0;
|
||||||
m_oldClientWidth = 0;
|
if (!m_deferShow)
|
||||||
gtk_widget_queue_resize(m_wxwindow);
|
{
|
||||||
|
m_oldClientWidth = 0;
|
||||||
|
gtk_widget_queue_resize(m_wxwindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_deferShow)
|
if (m_deferShow)
|
||||||
|
Reference in New Issue
Block a user