summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-13 14:52:35 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-10-16 11:02:32 +0200
commitb0542c740a6f46550e4ad2aced7c1e324eab693a (patch)
tree929aedd55e2512767fc2166db996d852abb212b6 /vcl/unx
parent2a8cd72be8045ff90bad87acb884c5c96ca96ed2 (diff)
better fix for tdf#136455 without destroying widgets we don't truly own
Change-Id: I9c3148fc6dd8658e1ff4a91ff83888288806f9e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104256 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 231a4e024b85aa0ad06a5632d3f514152babea30) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104167 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx25
1 files changed, 7 insertions, 18 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d2d0ca46c7e5..cf06ebae9dfc 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -14055,21 +14055,6 @@ private:
return true;
}
- // Since tdf#131120 we don't use the original ComboBox menu, but it's still
- // listening to additions to the ListStore and slowing things down (tdf#136455)
- void destroy_unused_menu()
- {
- AtkObject* pAtkObj = gtk_combo_box_get_popup_accessible(m_pComboBox);
- if (!pAtkObj)
- return;
- if (!GTK_IS_ACCESSIBLE(pAtkObj))
- return;
- GtkWidget* pWidget = gtk_accessible_get_widget(GTK_ACCESSIBLE(pAtkObj));
- if (!pWidget)
- return;
- gtk_widget_destroy(pWidget);
- }
-
public:
GtkInstanceComboBox(GtkBuilder* pComboBuilder, GtkComboBox* pComboBox, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
: GtkInstanceContainer(GTK_CONTAINER(gtk_builder_get_object(pComboBuilder, "box")), pBuilder, bTakeOwnership)
@@ -14112,7 +14097,13 @@ public:
gtk_widget_set_no_show_all(GTK_WIDGET(m_pComboBox), true);
gtk_tree_view_set_model(m_pTreeView, m_pTreeModel);
- gtk_combo_box_set_model(m_pComboBox, nullptr);
+ /* tdf#136455 gtk_combo_box_set_model with a null Model should be good
+ enough. But in practice, while the ComboBox model is unset, GTK
+ doesn't unset the ComboBox menus model, so that remains listening to
+ additions to the ListStore and slowing things down massively.
+ Using a new model does reset the menu to listen to that unused one instead */
+ gtk_combo_box_set_model(m_pComboBox, GTK_TREE_MODEL(gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING)));
+
GtkTreeViewColumn* pCol = gtk_tree_view_column_new();
gtk_tree_view_append_column(m_pTreeView, pCol);
@@ -14211,8 +14202,6 @@ public:
gtk_overlay_add_overlay(m_pOverlay, GTK_WIDGET(m_pOverlayButton));
g_signal_connect(m_pOverlayButton, "leave-notify-event", G_CALLBACK(signalOverlayButtonCrossing), this);
g_signal_connect(m_pOverlayButton, "enter-notify-event", G_CALLBACK(signalOverlayButtonCrossing), this);
-
- destroy_unused_menu();
}
virtual int get_active() const override