[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jun 21 18:23:27 UTC 2020
vcl/unx/gtk3/gtk3gtkinst.cxx | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit a641e68077b8c91db8f7520f817da9f7949d0e6d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jun 21 17:15:28 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Jun 21 20:22:51 2020 +0200
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 at redhat.com>
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);
More information about the Libreoffice-commits
mailing list