summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-21 17:15:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-21 20:22:51 +0200
commita641e68077b8c91db8f7520f817da9f7949d0e6d (patch)
tree0f20868752b4de01f0bc8c987b0d989c2d9ee000
parent090528707ce5c4f3db344e0106d997a26ed8831e (diff)
block GtkCalendar mouse click from propogating to toplevel GtkWindow
Change-Id: I0f6d98a8e8ec95616e8aeec83874f220200dcf24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96815 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 01390a5d1fd7..26e1742f7e61 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8454,6 +8454,7 @@ private:
gulong m_nDaySelectedSignalId;
gulong m_nDaySelectedDoubleClickSignalId;
gulong m_nKeyPressEventSignalId;
+ gulong m_nButtonPressEventSignalId;
static void signalDaySelected(GtkCalendar*, gpointer widget)
{
@@ -8483,6 +8484,16 @@ private:
return pThis->signal_key_press(pEvent);
}
+ static gboolean signalButton(GtkWidget*, GdkEventButton*, gpointer)
+ {
+ // don't let button press get to parent window, for the case of the
+ // ImplCFieldFloatWin floating window belonging to CalendarField where
+ // the click on the calendar continues to the parent GtkWindow and
+ // closePopup is called by GtkSalFrame::signalButton because the click
+ // window isn't that of the floating parent GtkWindow
+ return true;
+ }
+
public:
GtkInstanceCalendar(GtkCalendar* pCalendar, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
: GtkInstanceWidget(GTK_WIDGET(pCalendar), pBuilder, bTakeOwnership)
@@ -8490,6 +8501,7 @@ public:
, m_nDaySelectedSignalId(g_signal_connect(pCalendar, "day-selected", G_CALLBACK(signalDaySelected), this))
, m_nDaySelectedDoubleClickSignalId(g_signal_connect(pCalendar, "day-selected-double-click", G_CALLBACK(signalDaySelectedDoubleClick), this))
, m_nKeyPressEventSignalId(g_signal_connect(pCalendar, "key-press-event", G_CALLBACK(signalKeyPress), this))
+ , m_nButtonPressEventSignalId(g_signal_connect_after(pCalendar, "button-press-event", G_CALLBACK(signalButton), this))
{
}
@@ -8524,6 +8536,7 @@ public:
virtual ~GtkInstanceCalendar() override
{
+ g_signal_handler_disconnect(m_pCalendar, m_nButtonPressEventSignalId);
g_signal_handler_disconnect(m_pCalendar, m_nKeyPressEventSignalId);
g_signal_handler_disconnect(m_pCalendar, m_nDaySelectedDoubleClickSignalId);
g_signal_handler_disconnect(m_pCalendar, m_nDaySelectedSignalId);