m_gdkFunc = 0;
if (style & wxRESIZE_BORDER)
m_gdkFunc = GDK_FUNC_RESIZE;
+ gtk_window_set_default_size(GTK_WINDOW(m_widget), m_width, m_height);
+ m_decorSize.Set(0, 0);
+ m_deferShow = false;
// don't allow sizing smaller than decorations
GdkGeometry geom;
}
}
- gtk_window_set_default_size(GTK_WINDOW(m_widget), m_width, m_height);
+ m_decorSize = GetCachedDecorSize();
+ int w, h;
+ GTKDoGetSize(&w, &h);
+ gtk_window_set_default_size(GTK_WINDOW(m_widget), w, h);
return true;
}
void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)
{
+ if (!IsMaximized() && !IsFullScreen())
+ GetCachedDecorSize() = decorSize;
if (m_decorSize != decorSize)
{
const wxSize diff = decorSize - m_decorSize;
}
}
+wxSize& wxTopLevelWindowGTK::GetCachedDecorSize()
+{
+ static wxSize size[8];
+
+ int index = 0;
+ // title bar
+ if (m_gdkDecor & (GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE | GDK_DECOR_TITLE))
+ index = 1;
+ // border
+ if (m_gdkDecor & GDK_DECOR_BORDER)
+ index |= 2;
+ // utility window decor can be different
+ if (m_windowStyle & wxFRAME_TOOL_WINDOW)
+ index |= 4;
+ return size[index];
+}
+
void wxTopLevelWindowGTK::OnInternalIdle()
{
wxWindow::OnInternalIdle();