summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2018-08-08 09:33:43 +0300
committerErnestas Kulik <ekulik@redhat.com>2019-06-29 14:33:41 +0200
commit3df7b8e39328a5056b2b73ab771ad9c713a7d215 (patch)
tree7dd10f9a68dcbc85950e1d722114524cd11ef69a
parentadcb3e3c6a60e130767ab490e91328047a3c1d77 (diff)
downloadnautilus-3df7b8e39328a5056b2b73ab771ad9c713a7d215.tar.gz
list-view: Fix button press handling
Before, the code would call the button_press_event() vfunc on the child tree view, but that’s no longer a thing one can do. A workaround for that could be querying the current event and calling gtk_widget_event() on the tree view, so the event coordinates don’t end up being doubly translated (gtk_widget_event_internal() does this).
-rw-r--r--src/nautilus-list-view.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 44533a80a..1831c0609 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -834,15 +834,13 @@ on_tree_view_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
/* Needed to select an item before popping up a menu. */
if (call_parent)
{
-#if 0
- GtkWidgetClass *tree_view_class;
+ g_autoptr (GdkEvent) _event = NULL;
- tree_view_class = GTK_WIDGET_GET_CLASS (tree_view);
+ _event = gtk_get_current_event ();
- g_signal_handlers_block_by_func (tree_view, row_activated_callback, view);
- tree_view_class->button_press_event (widget, (GdkEventButton *) event);
- g_signal_handlers_unblock_by_func (tree_view, row_activated_callback, view);
-#endif
+ g_signal_handlers_block_by_func (tree_view, row_activated_callback, self);
+ gtk_widget_event (GTK_WIDGET (self->tree_view), _event);
+ g_signal_handlers_unblock_by_func (tree_view, row_activated_callback, self);
}
else if (path_selected)
{