[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 9 14:50:00 UTC 2021


 vcl/unx/gtk3/gtkframe.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 9fb3742df0a65238197e760a85f3f4a0e58ec31b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 9 11:35:17 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 9 16:49:28 2021 +0200

    use GTK_PHASE_TARGET instead of GTK_PHASE_BUBBLE
    
    so we don't get called if the event happened in another widget hosted
    inside this widget
    
    Change-Id: I77fe9250ffa45b76602dc0e77839ccff2e856de2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118666
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 71b8673ee11e..3b23b5c2a07e 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -961,6 +961,10 @@ void GtkSalFrame::InitCommon()
 #else
     GtkGesture *pClick = gtk_gesture_click_new();
     gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(pClick), 0);
+    // use GTK_PHASE_TARGET instead of default GTK_PHASE_BUBBLE because I don't
+    // want click events in gtk widgets inside the overlay, e.g. the font size
+    // combobox GtkEntry in the toolbar, to be propagated down to this widget
+    gtk_event_controller_set_propagation_phase(GTK_EVENT_CONTROLLER(pClick), GTK_PHASE_TARGET);
     gtk_widget_add_controller(pEventWidget, GTK_EVENT_CONTROLLER(pClick));
     g_signal_connect(pClick, "pressed", G_CALLBACK(gesturePressed), this);
     g_signal_connect(pClick, "released", G_CALLBACK(gestureReleased), this);
@@ -969,6 +973,7 @@ void GtkSalFrame::InitCommon()
     g_signal_connect(pMotionController, "motion", G_CALLBACK(signalMotion), this);
     g_signal_connect(pMotionController, "enter", G_CALLBACK(signalEnter), this);
     g_signal_connect(pMotionController, "leave", G_CALLBACK(signalLeave), this);
+    gtk_event_controller_set_propagation_phase(pMotionController, GTK_PHASE_TARGET);
     gtk_widget_add_controller(pEventWidget, pMotionController);
 
     GtkEventController* pScrollController = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);


More information about the Libreoffice-commits mailing list