// the frame that is currently active (i.e. its child has focus). It is
// used to generate wxActivateEvents
-static wxTopLevelWindowGTK *g_activeFrame = (wxTopLevelWindowGTK*) NULL;
-static wxTopLevelWindowGTK *g_lastActiveFrame = (wxTopLevelWindowGTK*) NULL;
+static wxTopLevelWindowGTK *g_activeFrame = NULL;
+static wxTopLevelWindowGTK *g_lastActiveFrame = NULL;
// if we detect that the app has got/lost the focus, we set this variable to
// either TRUE or FALSE and an activate event will be sent during the next
void wxTopLevelWindowGTK::Init()
{
- m_mainWidget = (GtkWidget*) NULL;
+ m_mainWidget = NULL;
m_isIconized = false;
m_fsIsShowing = false;
m_themeEnabled = true;
m_gdkFunc = 0;
m_grabbed = false;
m_deferShow = true;
+ m_updateDecorSize = true;
m_urgency_hint = -2;
}
RemoveGrab();
}
- m_isBeingDeleted = true;
+ SendDestroyEvent();
// it may also be GtkScrolledWindow in the case of an MDI child
if (GTK_IS_WINDOW(m_widget))
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
- bool deferShow = show && m_deferShow && !m_isShown;
+ bool deferShow = show && !m_isShown && m_deferShow;
if (deferShow)
{
- m_deferShow =
- deferShow = !GTK_WIDGET_REALIZED(m_widget) &&
- gdk_x11_screen_supports_net_wm_hint(
- gtk_widget_get_screen(m_widget),
- gdk_atom_intern("_NET_REQUEST_FRAME_EXTENTS", false)) &&
+ deferShow = false;
+ if (!GTK_WIDGET_REALIZED(m_widget) &&
g_signal_handler_find(m_widget,
GSignalMatchType(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA),
g_signal_lookup("property_notify_event", GTK_TYPE_WIDGET),
- 0, NULL, NULL, this);
+ 0, NULL, NULL, this))
+ {
+ if (gdk_x11_screen_supports_net_wm_hint(
+ gtk_widget_get_screen(m_widget),
+ gdk_atom_intern("_NET_REQUEST_FRAME_EXTENTS", false)))
+ {
+ deferShow = true;
+ }
+ else
+ {
+ // Don't allow changes to m_decorSize, it breaks saving/restoring
+ // window size with GetSize()/SetSize() because it makes window
+ // bigger between each restore and save.
+ m_updateDecorSize = false;
+ }
+ }
+ m_deferShow = deferShow;
}
if (deferShow)
{
{
if (!IsMaximized() && !IsFullScreen())
GetCachedDecorSize() = decorSize;
- if (m_decorSize != decorSize)
+ if (m_updateDecorSize && m_decorSize != decorSize)
{
const wxSize diff = decorSize - m_decorSize;
m_decorSize = decorSize;