[Xfce4-commits] [xfce/thunar] 01/02: removed deprecated method "gtk_menu_popup" and remains
noreply at xfce.org
noreply at xfce.org
Thu Feb 15 22:28:50 CET 2018
This is an automated email from the git hooks/post-receive script.
a l e x p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit bc74029cea6ea874d0358570ce5d374e60ed86b8
Author: Alexander Schwinn <acs82 at gmx.de>
Date: Tue Feb 13 22:39:53 2018 +0100
removed deprecated method "gtk_menu_popup" and remains
---
thunar/thunar-abstract-icon-view.c | 4 ++--
thunar/thunar-chooser-dialog.c | 16 +++++---------
thunar/thunar-details-view.c | 6 ++---
thunar/thunar-dnd.c | 6 ++---
thunar/thunar-dnd.h | 1 -
thunar/thunar-gtk-extensions.c | 42 +++++++----------------------------
thunar/thunar-gtk-extensions.h | 7 +-----
thunar/thunar-history-action.c | 45 +++++++-------------------------------
thunar/thunar-location-button.c | 2 +-
thunar/thunar-location-buttons.c | 4 ++--
thunar/thunar-renamer-dialog.c | 16 +++++---------
thunar/thunar-shortcuts-view.c | 13 +++++------
thunar/thunar-standard-view.c | 17 +++++---------
thunar/thunar-standard-view.h | 4 +---
thunar/thunar-tree-view.c | 13 +++++------
thunar/thunar-window.c | 13 +++++------
16 files changed, 61 insertions(+), 148 deletions(-)
diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c
index 493704b..2267d4a 100644
--- a/thunar/thunar-abstract-icon-view.c
+++ b/thunar/thunar-abstract-icon-view.c
@@ -511,7 +511,7 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view,
exo_icon_view_unselect_all (view);
/* open the context menu */
- thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (abstract_icon_view), event->button, event->time);
+ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (abstract_icon_view));
}
return TRUE;
@@ -685,7 +685,7 @@ thunar_abstract_icon_view_key_press_event (ExoIconView *view,
/* popup context menu if "Menu" or "<Shift>F10" is pressed */
if (event->keyval == GDK_KEY_Menu || ((event->state & GDK_SHIFT_MASK) != 0 && event->keyval == GDK_KEY_F10))
{
- thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (abstract_icon_view), 0, event->time);
+ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (abstract_icon_view));
return TRUE;
}
diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index 72addcd..cc5ff7d 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -68,9 +68,7 @@ static gboolean thunar_chooser_dialog_selection_func (GtkTreeSelection
GtkTreePath *path,
gboolean path_currently_selected,
gpointer user_data);
-static gboolean thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog,
- guint button,
- guint32 time);
+static gboolean thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog);
static void thunar_chooser_dialog_update_accept (ThunarChooserDialog *dialog);
static void thunar_chooser_dialog_update_header (ThunarChooserDialog *dialog);
static void thunar_chooser_dialog_action_remove (ThunarChooserDialog *dialog);
@@ -537,9 +535,7 @@ thunar_chooser_dialog_selection_func (GtkTreeSelection *selection,
static gboolean
-thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog,
- guint button,
- guint32 timestamp)
+thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog)
{
GtkTreeSelection *selection;
GtkTreeModel *model;
@@ -570,8 +566,8 @@ thunar_chooser_dialog_context_menu (ThunarChooserDialog *dialog,
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
- /* run the menu on the dialog's screen (takes over the floating of menu) */
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (dialog), NULL, NULL, button, timestamp);
+ /* run the menu (takes over the floating of menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* clean up */
g_object_unref (app_info);
@@ -880,7 +876,7 @@ thunar_chooser_dialog_button_press_event (GtkWidget *tree_view,
gtk_tree_path_free (path);
/* ...and popup the context menu */
- return thunar_chooser_dialog_context_menu (dialog, event->button, event->time);
+ return thunar_chooser_dialog_context_menu (dialog);
}
}
@@ -961,7 +957,7 @@ thunar_chooser_dialog_popup_menu (GtkWidget *tree_view,
_thunar_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
/* popup the context menu */
- return thunar_chooser_dialog_context_menu (dialog, 0, gtk_get_current_event_time ());
+ return thunar_chooser_dialog_context_menu (dialog);
}
diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c
index 8029461..5a69ebf 100644
--- a/thunar/thunar-details-view.c
+++ b/thunar/thunar-details-view.c
@@ -724,7 +724,7 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view,
if (path == NULL)
{
/* open the context menu */
- thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view), event->button, event->time);
+ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view));
}
else
{
@@ -747,7 +747,7 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view,
}
/* show the context menu */
- thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view), event->button, event->time);
+ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view));
}
gtk_tree_path_free (path);
}
@@ -809,7 +809,7 @@ thunar_details_view_key_press_event (GtkTreeView *tree_view,
/* popup context menu if "Menu" or "<Shift>F10" is pressed */
if (event->keyval == GDK_KEY_Menu || ((event->state & GDK_SHIFT_MASK) != 0 && event->keyval == GDK_KEY_F10))
{
- thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view), 0, event->time);
+ thunar_standard_view_context_menu (THUNAR_STANDARD_VIEW (details_view));
return TRUE;
}
diff --git a/thunar/thunar-dnd.c b/thunar/thunar-dnd.c
index a8b54d0..6c8f451 100644
--- a/thunar/thunar-dnd.c
+++ b/thunar/thunar-dnd.c
@@ -48,7 +48,6 @@ dnd_action_selected (GtkWidget *item,
* @widget : the widget on which the drop was performed.
* @folder : the #ThunarFile to which the @path_list is being dropped.
* @path_list : the #GFile<!---->s of the files being dropped to @file.
- * @timestamp : the time of the drop event.
* @actions : the list of actions supported for the drop.
*
* Pops up a menu that asks the user to choose one of the
@@ -66,7 +65,6 @@ GdkDragAction
thunar_dnd_ask (GtkWidget *widget,
ThunarFile *folder,
GList *path_list,
- guint timestamp,
GdkDragAction dnd_actions)
{
static const GdkDragAction dnd_action_items[] = { GDK_ACTION_COPY, GDK_ACTION_MOVE, GDK_ACTION_LINK };
@@ -168,8 +166,8 @@ thunar_dnd_ask (GtkWidget *widget,
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
- /* run the menu on the widget's screen (takes over the floating reference of menu) */
- thunar_gtk_menu_run (GTK_MENU (menu), widget, NULL, NULL, 3, timestamp);
+ /* run the menu (takes over the floating of menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* cleanup */
g_object_unref (G_OBJECT (factory));
diff --git a/thunar/thunar-dnd.h b/thunar/thunar-dnd.h
index 7f047cb..326ccfd 100644
--- a/thunar/thunar-dnd.h
+++ b/thunar/thunar-dnd.h
@@ -27,7 +27,6 @@ G_BEGIN_DECLS;
GdkDragAction thunar_dnd_ask (GtkWidget *widget,
ThunarFile *folder,
GList *path_list,
- guint time,
GdkDragAction actions);
gboolean thunar_dnd_perform (GtkWidget *widget,
diff --git a/thunar/thunar-gtk-extensions.c b/thunar/thunar-gtk-extensions.c
index dd142da..3c8cf6d 100644
--- a/thunar/thunar-gtk-extensions.c
+++ b/thunar/thunar-gtk-extensions.c
@@ -125,55 +125,29 @@ thunar_gtk_label_set_a11y_relation (GtkLabel *label,
/**
* thunar_gtk_menu_run:
- * @menu : a #GtkMenu.
- * @parent : either a #GtkWidget or a #GdkScreen which determines the screen
- * on which to run the @menu. May also be %NULL, which means that
- * the screen of @menu will not be altered.
- * @func : a user supplied function used to position the menu, or %NULL.
- * @data : user supplied data to be passed to @func.
- * @button : the mouse button which was pressed to initiate the event.
- * @activate_time : the time at which the activation event occurred.
+ * @menu : a #GtkMenu.
*
- * A simple wrapper around gtk_menu_popup(), which runs the @menu in a separate
- * main loop and returns only after the @menu was deactivated.
+ * A simple wrapper around gtk_menu_popup_at_pointer(), which takes care on the
+ * menu and returns only after the @menu was deactivated.
*
* This method automatically takes over the floating reference of @menu if any and
* releases it on return. That means if you created the menu via gtk_menu_new() you'll
* not need to take care of destroying the menu later.
**/
void
-thunar_gtk_menu_run (GtkMenu *menu,
- gpointer parent,
- GtkMenuPositionFunc func,
- gpointer data,
- guint button,
- guint32 activate_time)
+thunar_gtk_menu_run (GtkMenu *menu)
{
- GMainLoop *loop;
- gulong signal_id;
+ GdkEvent *event;
- _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent));
_thunar_return_if_fail (GTK_IS_MENU (menu));
/* take over the floating reference on the menu */
g_object_ref_sink (G_OBJECT (menu));
- /* place the menu on the same screen as the parent */
- if (G_UNLIKELY (parent != NULL && GDK_IS_SCREEN (parent)))
- gtk_menu_set_screen (menu, GDK_SCREEN (parent));
- else if (G_LIKELY (parent != NULL && GTK_IS_WIDGET (parent)))
- gtk_menu_set_screen (menu, gtk_widget_get_screen (GTK_WIDGET (parent)));
-
- /* run an internal main loop */
- loop = g_main_loop_new (NULL, FALSE);
- signal_id = g_signal_connect_swapped (G_OBJECT (menu), "deactivate", G_CALLBACK (g_main_loop_quit), loop);
- gtk_menu_popup (menu, NULL, NULL, func, data, button, activate_time);
+ event = gtk_get_current_event ();
+ gtk_menu_popup_at_pointer (menu, event);
+ gdk_event_free (event);
gtk_menu_reposition (menu);
- gtk_grab_add (GTK_WIDGET (menu));
- g_main_loop_run (loop);
- g_signal_handler_disconnect (G_OBJECT (menu), signal_id);
- g_main_loop_unref (loop);
- gtk_grab_remove (GTK_WIDGET (menu));
/* release the menu reference */
g_object_unref (G_OBJECT (menu));
diff --git a/thunar/thunar-gtk-extensions.h b/thunar/thunar-gtk-extensions.h
index afc4150..a264595 100644
--- a/thunar/thunar-gtk-extensions.h
+++ b/thunar/thunar-gtk-extensions.h
@@ -35,12 +35,7 @@ void thunar_gtk_action_group_set_action_sensitive (GtkActionGroup
void thunar_gtk_label_set_a11y_relation (GtkLabel *label,
GtkWidget *widget);
-void thunar_gtk_menu_run (GtkMenu *menu,
- gpointer parent,
- GtkMenuPositionFunc func,
- gpointer data,
- guint button,
- guint32 activate_time);
+void thunar_gtk_menu_run (GtkMenu *menu);
GtkAction *thunar_gtk_ui_manager_get_action_by_name (GtkUIManager *ui_manager,
const gchar *action_name);
diff --git a/thunar/thunar-history-action.c b/thunar/thunar-history-action.c
index b0cfc92..65fe434 100644
--- a/thunar/thunar-history-action.c
+++ b/thunar/thunar-history-action.c
@@ -21,6 +21,7 @@
#include <config.h>
#endif
+#include <thunar/thunar-gtk-extensions.h>
#include <thunar/thunar-history-action.h>
#include <thunar/thunar-private.h>
@@ -28,9 +29,7 @@
static GtkWidget *thunar_history_action_create_tool_item (GtkAction *action);
static void thunar_history_action_show_menu (GtkWidget *tool_item,
- ThunarHistoryAction *history_action,
- guint button,
- guint32 timestamp);
+ ThunarHistoryAction *history_action);
@@ -90,7 +89,7 @@ thunar_history_action_popup_delayed (gpointer data)
ThunarHistoryAction *history_action;
history_action = g_object_get_data (G_OBJECT (button), I_("thunar-history-action"));
- thunar_history_action_show_menu (button, history_action, 3, 0);
+ thunar_history_action_show_menu (button, history_action);
history_action->popup_delay = 0;
return FALSE;
@@ -122,8 +121,7 @@ thunar_history_action_button_press_event (GtkWidget *toggle_button,
else if (event->button == 3)
{
/* directy show the menu */
- thunar_history_action_show_menu (toggle_button, history_action,
- event->button, event->time);
+ thunar_history_action_show_menu (toggle_button, history_action);
}
return FALSE;
@@ -191,8 +189,7 @@ thunar_history_action_leave_notify_event (GtkWidget *toggle_button,
&& event->x < alloc.width
&& event->y >= alloc.height)
{
- thunar_history_action_show_menu (toggle_button, history_action,
- 3, event->time);
+ thunar_history_action_show_menu (toggle_button, history_action);
}
}
@@ -280,26 +277,6 @@ thunar_history_action_create_tool_item (GtkAction *action)
static void
-thunar_history_action_position_menu (GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer user_data)
-{
- GtkWidget *button = GTK_WIDGET (user_data);
- GtkAllocation alloc;
-
- gdk_window_get_origin (gtk_widget_get_window (button), x, y);
-
- gtk_widget_get_allocation (button, &alloc);
- *x += alloc.x;
- *y += alloc.y + alloc.height;
- *push_in = FALSE;
-}
-
-
-
-static void
thunar_history_action_menu_deactivate (GtkWidget *toggle_button)
{
/* untoggle the button */
@@ -310,9 +287,7 @@ thunar_history_action_menu_deactivate (GtkWidget *toggle_button)
static void
thunar_history_action_show_menu (GtkWidget *toggle_button,
- ThunarHistoryAction *history_action,
- guint button,
- guint32 timestamp)
+ ThunarHistoryAction *history_action)
{
GtkWidget *menu;
@@ -331,12 +306,8 @@ thunar_history_action_show_menu (GtkWidget *toggle_button,
/* toggle the button */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle_button), TRUE);
- /* show menu */
- gtk_menu_popup (GTK_MENU (menu),
- NULL, NULL,
- thunar_history_action_position_menu, toggle_button,
- button,
- timestamp ? timestamp : gtk_get_current_event_time ());
+ /* run the menu (takes over the floating of menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
}
diff --git a/thunar/thunar-location-button.c b/thunar/thunar-location-button.c
index efeb9ff..be16161 100644
--- a/thunar/thunar-location-button.c
+++ b/thunar/thunar-location-button.c
@@ -673,7 +673,7 @@ thunar_location_button_drag_data_received (GtkWidget *button,
{
/* as the user what to do with the drop data */
action = (gdk_drag_context_get_selected_action (context) == GDK_ACTION_ASK)
- ? thunar_dnd_ask (button, location_button->file, location_button->drop_file_list, timestamp, actions)
+ ? thunar_dnd_ask (button, location_button->file, location_button->drop_file_list, actions)
: gdk_drag_context_get_selected_action (context);
/* perform the requested action */
diff --git a/thunar/thunar-location-buttons.c b/thunar/thunar-location-buttons.c
index e240039..af8645f 100644
--- a/thunar/thunar-location-buttons.c
+++ b/thunar/thunar-location-buttons.c
@@ -1301,8 +1301,8 @@ thunar_location_buttons_context_menu (ThunarLocationButton *button,
g_object_set_qdata_full (G_OBJECT (action), thunar_file_quark, g_object_ref (G_OBJECT (file)), (GDestroyNotify) g_object_unref);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action));
- /* run the menu on the screen on the buttons' screen */
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (buttons), NULL, NULL, 0, gtk_get_current_event_time ());
+ /* run the menu (takes over the floating of menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* cleanup */
g_object_unref (buttons);
diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c
index 9bc3769..2d238e9 100644
--- a/thunar/thunar-renamer-dialog.c
+++ b/thunar/thunar-renamer-dialog.c
@@ -79,9 +79,7 @@ static void thunar_renamer_dialog_realize (GtkWidget
static void thunar_renamer_dialog_unrealize (GtkWidget *widget);
static void thunar_renamer_dialog_response (GtkDialog *dialog,
gint response);
-static void thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog,
- guint button,
- guint32 timestamp);
+static void thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog);
static void thunar_renamer_dialog_help (ThunarRenamerDialog *renamer_dialog);
static void thunar_renamer_dialog_save (ThunarRenamerDialog *renamer_dialog);
static void thunar_renamer_dialog_action_add_files (GtkAction *action,
@@ -840,9 +838,7 @@ thunar_renamer_dialog_response (GtkDialog *dialog,
static void
-thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog,
- guint button,
- guint32 timestamp)
+thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog)
{
GtkActionGroup *renamer_actions = NULL;
ThunarxRenamer *renamer;
@@ -882,9 +878,9 @@ thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog,
g_list_free (items);
}
- /* run the menu on the dialog's screen */
+ /* run the menu (takes over the floating of menu) */
menu = gtk_ui_manager_get_widget (renamer_dialog->ui_manager, "/file-context-menu");
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (renamer_dialog), NULL, NULL, button, timestamp);
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* remove the previously merge items from the UI manager */
if (G_UNLIKELY (renamer_merge_id != 0))
@@ -1299,7 +1295,7 @@ thunar_renamer_dialog_button_press_event (GtkWidget *tree_view,
}
/* popup the context menu */
- thunar_renamer_dialog_context_menu (renamer_dialog, event->button, event->time);
+ thunar_renamer_dialog_context_menu (renamer_dialog);
/* we handled the event */
return TRUE;
@@ -1606,7 +1602,7 @@ thunar_renamer_dialog_popup_menu (GtkWidget *tree_view,
_thunar_return_val_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog), FALSE);
/* popup the context menu */
- thunar_renamer_dialog_context_menu (renamer_dialog, 0, gtk_get_current_event_time ());
+ thunar_renamer_dialog_context_menu (renamer_dialog);
/* we handled the event */
return TRUE;
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index d56f7ce..8980d7d 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -643,7 +643,7 @@ thunar_shortcuts_view_drag_data_received (GtkWidget *widget,
{
/* ask the user what to do with the drop data */
if (G_UNLIKELY (action == GDK_ACTION_ASK))
- action = thunar_dnd_ask (widget, file, view->drop_file_list, timestamp, actions);
+ action = thunar_dnd_ask (widget, file, view->drop_file_list, actions);
/* perform the requested action */
if (G_LIKELY (action != 0))
@@ -1041,10 +1041,8 @@ thunar_shortcuts_view_context_menu_visibility (ThunarShortcutsView *view,
gtk_tree_path_free (path);
- /* run the menu on the view's screen (taking over the floating reference on menu) */
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (view), NULL, NULL,
- (event != NULL) ? event->button : 0,
- (event != NULL) ? event->time : gtk_get_current_event_time ());
+ /* run the menu (taking over the floating reference on menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
}
@@ -1288,9 +1286,8 @@ thunar_shortcuts_view_context_menu (ThunarShortcutsView *view,
g_object_unref (G_OBJECT (device));
gtk_tree_path_free (path);
- /* run the menu on the view's screen (taking over the floating reference on menu) */
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (view), NULL, NULL, (event != NULL) ? event->button : 0,
- (event != NULL) ? event->time : gtk_get_current_event_time ());
+ /* run the menu (taking over the floating reference on menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
}
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 5ae8ab2..c94c38d 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -2994,7 +2994,7 @@ thunar_standard_view_button_release_event (GtkWidget *view,
g_source_remove (standard_view->priv->drag_timer_id);
/* fire up the context menu */
- thunar_standard_view_context_menu (standard_view, 0, event->time);
+ thunar_standard_view_context_menu (standard_view);
return TRUE;
}
@@ -3407,7 +3407,7 @@ thunar_standard_view_drag_data_received (GtkWidget *view,
{
/* ask the user what to do with the drop data */
action = (gdk_drag_context_get_selected_action (context) == GDK_ACTION_ASK)
- ? thunar_dnd_ask (GTK_WIDGET (standard_view), file, standard_view->priv->drop_file_list, timestamp, actions)
+ ? thunar_dnd_ask (GTK_WIDGET (standard_view), file, standard_view->priv->drop_file_list, actions)
: gdk_drag_context_get_selected_action (context);
/* perform the requested action */
@@ -3959,7 +3959,7 @@ thunar_standard_view_drag_timer (gpointer user_data)
/* fire up the context menu */
GDK_THREADS_ENTER ();
- thunar_standard_view_context_menu (standard_view, 3, gtk_get_current_event_time ());
+ thunar_standard_view_context_menu (standard_view);
GDK_THREADS_LEAVE ();
return FALSE;
@@ -4241,18 +4241,13 @@ thunar_standard_view_size_allocate (ThunarStandardView *standard_view,
/**
* thunar_standard_view_context_menu:
* @standard_view : a #ThunarStandardView instance.
- * @button : the mouse button which triggered the context menu or %0 if
- * the event wasn't triggered by a pointer device.
- * @timestamp : the event time.
*
* Invoked by derived classes (and only by derived classes!) whenever the user
* requests to open a context menu, e.g. by right-clicking on a file/folder or by
* using one of the context menu shortcuts.
**/
void
-thunar_standard_view_context_menu (ThunarStandardView *standard_view,
- guint button,
- guint32 timestamp)
+thunar_standard_view_context_menu (ThunarStandardView *standard_view)
{
GtkWidget *menu;
GList *selected_items;
@@ -4267,9 +4262,9 @@ thunar_standard_view_context_menu (ThunarStandardView *standard_view,
/* grab an additional reference on the view */
g_object_ref (G_OBJECT (standard_view));
- /* run the menu on the view's screen (figuring out whether to use the file or the folder context menu) */
+ /* run the menu (figuring out whether to use the file or the folder context menu) */
menu = gtk_ui_manager_get_widget (standard_view->ui_manager, (selected_items != NULL) ? "/file-context-menu" : "/folder-context-menu");
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (standard_view), NULL, NULL, button, timestamp);
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* release the additional reference on the view */
g_object_unref (G_OBJECT (standard_view));
diff --git a/thunar/thunar-standard-view.h b/thunar/thunar-standard-view.h
index 5a73402..f851368 100644
--- a/thunar/thunar-standard-view.h
+++ b/thunar/thunar-standard-view.h
@@ -144,9 +144,7 @@ struct _ThunarStandardView
GType thunar_standard_view_get_type (void) G_GNUC_CONST;
-void thunar_standard_view_context_menu (ThunarStandardView *standard_view,
- guint button,
- guint32 time);
+void thunar_standard_view_context_menu (ThunarStandardView *standard_view);
void thunar_standard_view_queue_popup (ThunarStandardView *standard_view,
GdkEventButton *event);
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index da5a354..a1a3224 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -132,7 +132,6 @@ static void thunar_tree_view_row_collapsed (G
GtkTreePath *path);
static gboolean thunar_tree_view_delete_selected_files (ThunarTreeView *view);
static void thunar_tree_view_context_menu (ThunarTreeView *view,
- GdkEventButton *event,
GtkTreeModel *model,
GtkTreeIter *iter);
static GdkDragAction thunar_tree_view_get_dest_actions (ThunarTreeView *view,
@@ -739,7 +738,7 @@ thunar_tree_view_button_press_event (GtkWidget *widget,
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
{
/* popup the context menu */
- thunar_tree_view_context_menu (view, event, GTK_TREE_MODEL (view->model), &iter);
+ thunar_tree_view_context_menu (view, GTK_TREE_MODEL (view->model), &iter);
/* we effectively handled the event */
result = TRUE;
@@ -973,7 +972,7 @@ thunar_tree_view_drag_data_received (GtkWidget *widget,
{
/* ask the user what to do with the drop data */
action = (gdk_drag_context_get_selected_action (context) == GDK_ACTION_ASK)
- ? thunar_dnd_ask (GTK_WIDGET (view), file, view->drop_file_list, timestamp, actions)
+ ? thunar_dnd_ask (GTK_WIDGET (view), file, view->drop_file_list, actions)
: gdk_drag_context_get_selected_action (context);
/* perform the requested action */
@@ -1121,7 +1120,7 @@ thunar_tree_view_popup_menu (GtkWidget *widget)
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
/* popup the context menu */
- thunar_tree_view_context_menu (view, NULL, model, &iter);
+ thunar_tree_view_context_menu (view, model, &iter);
return TRUE;
}
else if (GTK_WIDGET_CLASS (thunar_tree_view_parent_class)->popup_menu != NULL)
@@ -1252,7 +1251,6 @@ thunar_tree_view_delete_selected_files (ThunarTreeView *view)
static void
thunar_tree_view_context_menu (ThunarTreeView *view,
- GdkEventButton *event,
GtkTreeModel *model,
GtkTreeIter *iter)
{
@@ -1543,9 +1541,8 @@ thunar_tree_view_context_menu (ThunarTreeView *view,
image = gtk_image_new_from_icon_name ("document-properties", GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
- /* run the menu on the view's screen (taking over the floating reference on the menu) */
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (view), NULL, NULL, (event != NULL) ? event->button : 0,
- (event != NULL) ? event->time : gtk_get_current_event_time ());
+ /* run the menu (taking over the floating reference on the menu) */
+ thunar_gtk_menu_run (GTK_MENU (menu));
/* cleanup */
if (G_UNLIKELY (device != NULL))
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index fb3c65f..4f52058 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -1602,16 +1602,13 @@ thunar_window_notebook_page_removed (GtkWidget *notebook,
static void
-thunar_window_notebook_popup_menu_real (ThunarWindow *window,
- guint32 timestamp,
- gint button)
+thunar_window_notebook_popup_menu_real (ThunarWindow *window)
{
GtkWidget *menu;
- /* run the menu on the view's screen (figuring out whether to use the file or the folder context menu) */
+ /* run the menu (figuring out whether to use the file or the folder context menu) */
menu = gtk_ui_manager_get_widget (window->ui_manager, "/tab-context-menu");
- thunar_gtk_menu_run (GTK_MENU (menu), GTK_WIDGET (window),
- NULL, NULL, button, timestamp);
+ thunar_gtk_menu_run (GTK_MENU (menu));
}
@@ -1666,7 +1663,7 @@ thunar_window_notebook_button_press_event (GtkWidget *notebook,
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), page_num);
/* show the tab menu */
- thunar_window_notebook_popup_menu_real (window, event->time, event->button);
+ thunar_window_notebook_popup_menu_real (window);
}
return TRUE;
@@ -1681,7 +1678,7 @@ static gboolean
thunar_window_notebook_popup_menu (GtkWidget *notebook,
ThunarWindow *window)
{
- thunar_window_notebook_popup_menu_real (window, gtk_get_current_event_time (), 0);
+ thunar_window_notebook_popup_menu_real (window);
return TRUE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list