Commit 873156cf authored by Ernestas Kulik's avatar Ernestas Kulik 🦑

window: Check if a tab was hit on right click

Since we have to handle the event in reverse order (because GtkTreeView
claims the event sequence in the capture phase, meaning that the events
won’t bubble up), the context menu for notebook tabs will open
everywhere, because the event handler is not stopped by those lower in
the hierarchy. A simple check if the cursor is on a tab will prevent
parent 13a8d3ef
......@@ -222,6 +222,14 @@ nautilus_notebook_contains_slot (NautilusNotebook *notebook,
return found;
nautilus_notebook_content_area_hit (NautilusNotebook *notebook,
gint x,
gint y)
return find_tab_num_at_pos (notebook, x, y) == -1;
nautilus_notebook_sync_loading (NautilusNotebook *notebook,
NautilusWindowSlot *slot)
......@@ -54,4 +54,8 @@ void nautilus_notebook_next_page (NautilusNotebook *notebook);
gboolean nautilus_notebook_contains_slot (NautilusNotebook *notebook,
NautilusWindowSlot *slot);
\ No newline at end of file
gboolean nautilus_notebook_content_area_hit (NautilusNotebook *notebook,
gint x,
gint y);
......@@ -2027,10 +2027,18 @@ notebook_button_press_cb (GtkGestureMultiPress *gesture,
gpointer user_data)
NautilusWindow *window;
NautilusWindowPrivate *priv;
GdkEventSequence *sequence;
const GdkEvent *event;
window = NAUTILUS_WINDOW (user_data);
priv = nautilus_window_get_instance_private (window);
if (nautilus_notebook_content_area_hit (NAUTILUS_NOTEBOOK (priv->notebook), x, y))
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment