Avoid using gdk_window_freeze_updates() to implement Freeze()
Implement Freeze() by blocking the GtkWindow "expose-event"/"draw" signal instead. Since the introduction of client-side windows in GTK+ 2.18, gdk_window_freeze_updates() is unuseable because the impl_window (and thus the update_freeze_count) for a given GdkWindow can change unpredictably. See #16795
This commit is contained in:
@@ -695,6 +695,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
gulong sig_id = g_signal_connect(m_buffer, "mark_set", G_CALLBACK(mark_set), &m_anonymousMarkList);
|
||||
// Create view
|
||||
m_text = gtk_text_view_new_with_buffer(m_buffer);
|
||||
GTKConnectFreezeWidget(m_text);
|
||||
// gtk_text_view_set_buffer adds its own reference
|
||||
g_object_unref(m_buffer);
|
||||
g_signal_handler_disconnect(m_buffer, sig_id);
|
||||
@@ -1975,6 +1976,8 @@ void wxTextCtrl::DoFreeze()
|
||||
wxCHECK_RET(m_text != NULL, wxT("invalid text ctrl"));
|
||||
|
||||
GTKFreezeWidget(m_text);
|
||||
if (m_widget != m_text)
|
||||
GTKFreezeWidget(m_widget);
|
||||
|
||||
if ( HasFlag(wxTE_MULTILINE) )
|
||||
{
|
||||
@@ -2021,6 +2024,8 @@ void wxTextCtrl::DoThaw()
|
||||
}
|
||||
|
||||
GTKThawWidget(m_text);
|
||||
if (m_widget != m_text)
|
||||
GTKThawWidget(m_widget);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user