diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-06 21:00:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-07 10:09:15 +0200 |
commit | c48b021357f4e657291d12fbaa5a2d1a6471ce9b (patch) | |
tree | d00168344ac8286237773c836e74dd90ab5a7db5 /vcl | |
parent | 78389969a8f38edf4c13f0b070b4471c02f1d858 (diff) |
tdf#136455 unused ComboBox menu listening to GtkListStore and slowing inserts
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)
Change-Id: Ie2383e1a4b28f0787559132d93236df5c641cb06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102135
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index ab92be3f3c27..5230dcf92a88 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -14279,6 +14279,21 @@ 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) @@ -14420,6 +14435,8 @@ 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 |