From 2a5d4ed38df988077bcec62da331a7958ce0aaf3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 19 Dec 2019 10:50:40 +0000 Subject: Resolves: tdf#129484 install decimal key handler for all widgets again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reparent notebook back to its original parent so its not destroyed when the overflow parent is destroyed and add g_object_ref/g_object_unref guard to GtkInstanceWidget Change-Id: I85d691c05e82531e398736258668e024c4aa1e64 Reviewed-on: https://gerrit.libreoffice.org/85508 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/unx/gtk3/gtk3gtkinst.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 260bc605cf7e..d8d3e09c6640 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2182,6 +2182,10 @@ public: , m_nDragDropReceivedSignalId(0) , m_nDragLeaveSignalId(0) { + if (!bTakeOwnership) + g_object_ref(m_pWidget); + + localizeDecimalSeparator(); } virtual void connect_key_press(const Link& rLink) override @@ -2771,6 +2775,8 @@ public: if (m_bTakeOwnership) gtk_widget_destroy(m_pWidget); + else + g_object_unref(m_pWidget); } virtual void disable_notify_events() @@ -6083,7 +6089,16 @@ public: g_signal_handler_disconnect(m_pOverFlowNotebook, m_nOverFlowSwitchPageSignalId); gtk_widget_destroy(GTK_WIDGET(m_pOverFlowNotebook)); if (m_pOverFlowBox) + { + // put it back to how we found it initially + GtkWidget* pParent = gtk_widget_get_parent(GTK_WIDGET(m_pOverFlowBox)); + g_object_ref(m_pNotebook); + gtk_container_remove(GTK_CONTAINER(m_pOverFlowBox), GTK_WIDGET(m_pNotebook)); + gtk_container_add(GTK_CONTAINER(pParent), GTK_WIDGET(m_pNotebook)); + g_object_unref(m_pNotebook); + gtk_widget_destroy(GTK_WIDGET(m_pOverFlowBox)); + } } }; @@ -10512,7 +10527,6 @@ public: , m_bBlockOutput(false) , m_bBlank(false) { - localizeDecimalSeparator(); } virtual int get_value() const override -- cgit