filechooser: Fix context menus

We only want to show the file list context menu
when we are over the file list.

Fixes: #5554
This commit is contained in:
Matthias Clasen 2023-02-03 14:16:40 +01:00
parent 3f87b130ba
commit 92c2c68c7b

View File

@ -7226,12 +7226,17 @@ file_chooser_widget_clicked (GtkEventController *controller,
int n_press, int n_press,
double x, double x,
double y, double y,
gpointer user_data) GtkFileChooserWidget *impl)
{ {
GtkWidget *widget = user_data; GtkWidget *widget = GTK_WIDGET (impl);
GtkWidget *child;
child = gtk_widget_pick (widget, x, y, 0);
if (gtk_widget_is_ancestor (child, impl->browse_files_stack))
{
gtk_gesture_set_state (GTK_GESTURE (controller), GTK_EVENT_SEQUENCE_CLAIMED); gtk_gesture_set_state (GTK_GESTURE (controller), GTK_EVENT_SEQUENCE_CLAIMED);
popup_menu (widget, x, y); popup_menu (widget, x, y);
}
} }
static void static void