if (!win->IsIconized())
{
-#if 1
- win->m_resizeQueued = true;
-#else
wxSizeEvent event(size, win->GetId());
event.SetEventObject(win);
win->HandleWindowEvent(event);
-#endif
}
// else the window is currently unmapped, don't generate size events
}
m_gdkFunc = 0;
m_grabbed = false;
m_deferShow = true;
+ m_deferShowAllowed = true;
m_updateDecorSize = true;
m_urgency_hint = -2;
-
- m_resizeQueued = false;
}
bool wxTopLevelWindowGTK::Create( wxWindow *parent,
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
// m_wxwindow is the client area
- m_wxwindow = wxPizza::New();
+ m_wxwindow = wxPizza::New(0,this);
gtk_widget_show( m_wxwindow );
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
// overridden wxWindow methods
// ----------------------------------------------------------------------------
+void wxTopLevelWindowGTK::Refresh( bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect) )
+{
+ wxCHECK_RET( m_widget, wxT("invalid frame") );
+
+ gtk_widget_queue_draw( m_widget );
+
+ if (m_wxwindow && m_wxwindow->window)
+ gdk_window_invalidate_rect( m_wxwindow->window, NULL, TRUE );
+}
+
bool wxTopLevelWindowGTK::Show( bool show )
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
- bool deferShow = show && !m_isShown && m_deferShow;
+ bool deferShow = show && !m_isShown && m_deferShow && m_deferShowAllowed;
if (deferShow)
{
deferShow = false;
{
wxCHECK_RET( m_widget, wxT("invalid frame") );
+ m_deferShowAllowed = true;
+
// deal with the position first
int old_x = m_x;
int old_y = m_y;
void wxTopLevelWindowGTK::DoSetClientSize(int width, int height)
{
- if (m_deferShow && !m_isShown)
- // Since client size is being explicitly set, don't change it later
- m_deferShow = false;
+ // Since client size is being explicitly set, don't change it later
+ m_deferShowAllowed = false;
+
wxTopLevelWindowBase::DoSetClientSize(width, height);
}
wxTheApp->SetActive(activate, (wxWindow *)g_lastActiveFrame);
}
-
- if (m_resizeQueued)
- {
- wxSize size( m_width, m_height );
- wxSizeEvent event(size, GetId());
- event.SetEventObject(this);
- HandleWindowEvent(event);
- m_resizeQueued = false;
- }
}
// ----------------------------------------------------------------------------
bool new_hint_value = false;
// FIXME: This is a workaround to focus handling problem
- // If RequestUserAttention is called for example right after a wxSleep, OnInternalIdle hasn't
- // yet been processed, and the internal focus system is not up to date yet.
- // wxYieldIfNeeded ensures the processing of it, but can have unwanted side effects - MR
- ::wxYieldIfNeeded();
+ // If RequestUserAttention is called for example right after a wxSleep, OnInternalIdle
+ // hasn't yet been processed, and the internal focus system is not up to date yet.
+ // YieldFor(wxEVT_CATEGORY_UI) ensures the processing of it (hopefully it
+ // won't have side effects) - MR
+ wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI);
if(m_urgency_hint >= 0)
g_source_remove(m_urgency_hint);