From 1d1ea369da6e027b1ed1453584233f0f7cdcf223 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 25 Jul 2020 20:49:05 +0100 Subject: A GtkButton is already sufficient to get mouse events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia61a7906198bf6b6a4ce188d7de9a627c8540af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99450 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtk3gtkinst.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 003af767ca65..e9c7dab0b0e0 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1929,7 +1929,7 @@ protected: m_aFocusOutHdl.Call(*this); } - void ensureMouseEventWidget() + virtual void ensureMouseEventWidget() { if (!m_pMouseEventBox) m_pMouseEventBox = ::ensureEventWidget(m_pWidget); @@ -6662,6 +6662,13 @@ private: pThis->signal_clicked(); } + virtual void ensureMouseEventWidget() override + { + // The GtkButton is sufficient to get mouse events without an intermediate GtkEventBox + if (!m_pMouseEventBox) + m_pMouseEventBox = m_pWidget; + } + public: GtkInstanceButton(GtkButton* pButton, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) : GtkInstanceContainer(GTK_CONTAINER(pButton), pBuilder, bTakeOwnership) -- cgit