summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorOlivier Duchateau <duchateau.olivier@gmail.com>2018-01-02 15:10:15 +0100
committerSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2018-01-02 21:20:04 +0100
commit43dfa79865eed5948c62847b1d03a8010e13d9a2 (patch)
treee3774050edc97447d396c8bb0fbce55002119bb9 /plugins
parent983bcedfa712d804657cd10b779fbf36219deff7 (diff)
downloadxfce4-panel-43dfa79865eed5948c62847b1d03a8010e13d9a2.tar.gz
Fix various warnings with Gtk3 (Bug #14135)
* replace 'gtk_menu_popup' by 'gtk_menu_popup_at_pointer' or 'gtk_menu_popup_at_widget' * 'gtk_dialog_set_alternative_button_order' is only for Gtk+ < 3.x (Bug #14129)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/actions/actions.c9
-rw-r--r--plugins/applicationsmenu/applicationsmenu.c9
-rw-r--r--plugins/directorymenu/directorymenu.c9
-rw-r--r--plugins/launcher/launcher-dialog.c7
-rw-r--r--plugins/launcher/launcher.c7
-rw-r--r--plugins/tasklist/tasklist-widget.c23
-rw-r--r--plugins/windowmenu/windowmenu.c14
7 files changed, 77 insertions, 1 deletions
diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index bfa88b09..6daa3a64 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -863,7 +863,7 @@ actions_plugin_action_dbus_can (GDBusProxy *proxy,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
- error);
+ &error);
if (G_LIKELY (retval))
{
@@ -1329,7 +1329,14 @@ actions_plugin_menu (GtkWidget *button,
}
}
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (plugin->menu), button,
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
+#else
gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
button != NULL ? xfce_panel_plugin_position_menu : NULL,
plugin, 1, gtk_get_current_event_time ());
+#endif
}
diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index 797ccaae..fdf76144 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -539,9 +539,11 @@ applications_menu_plugin_configure_plugin_icon_chooser (GtkWidget *
_("OK"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_dialog_set_alternative_button_order (GTK_DIALOG (chooser),
GTK_RESPONSE_ACCEPT,
GTK_RESPONSE_CANCEL, -1);
+#endif
exo_icon_chooser_dialog_set_icon (EXO_ICON_CHOOSER_DIALOG (chooser),
panel_str_is_empty (plugin->button_icon) ? DEFAULT_ICON_NAME : plugin->button_icon);
@@ -783,10 +785,17 @@ applications_menu_plugin_menu (GtkWidget *button,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
/* show the menu */
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (plugin->menu), button,
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ (GdkEvent *) event);
+#else
gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
button != NULL ? xfce_panel_plugin_position_menu : NULL,
plugin, 1,
event != NULL ? event->time : gtk_get_current_event_time ());
+#endif
return TRUE;
}
diff --git a/plugins/directorymenu/directorymenu.c b/plugins/directorymenu/directorymenu.c
index e4bf620b..1e9696cf 100644
--- a/plugins/directorymenu/directorymenu.c
+++ b/plugins/directorymenu/directorymenu.c
@@ -395,9 +395,11 @@ directory_menu_plugin_configure_plugin_icon_chooser (GtkWidget *button
_("OK"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT);
+#if !GTK_CHECK_VERSION (3, 0, 0)
gtk_dialog_set_alternative_button_order (GTK_DIALOG (chooser),
GTK_RESPONSE_ACCEPT,
GTK_RESPONSE_CANCEL, -1);
+#endif
if (!panel_str_is_empty (plugin->icon_name))
exo_icon_chooser_dialog_set_icon (EXO_ICON_CHOOSER_DIALOG (chooser), plugin->icon_name);
@@ -1015,7 +1017,14 @@ directory_menu_plugin_menu (GtkWidget *button,
g_object_unref);
directory_menu_plugin_menu_load (menu, plugin);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu), button,
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
button != NULL ? xfce_panel_plugin_position_menu : NULL,
plugin, 1, gtk_get_current_event_time ());
+#endif
}
diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index 39c59fbd..fd224f2d 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -660,10 +660,17 @@ launcher_dialog_tree_popup_menu (GtkWidget *treeview,
/* show the menu */
menu = gtk_builder_get_object (dialog->builder, "popup-menu");
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu), treeview,
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
+#else
gtk_menu_popup (GTK_MENU (menu),
NULL, treeview,
NULL, NULL, 3,
gtk_get_current_event_time ());
+ #endif
return TRUE;
}
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 133b3032..4111702d 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -1653,10 +1653,17 @@ launcher_plugin_menu_popup (gpointer user_data)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (plugin->arrow), TRUE);
/* popup the menu */
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (plugin->menu),
+ plugin->button, GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
+#else
gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
xfce_panel_plugin_position_menu,
XFCE_PANEL_PLUGIN (plugin), 1,
gtk_get_current_event_time ());
+#endif
/* fallback to manual positioning, this is used with
* drag motion over the arrow button */
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 904e6ba2..4eedb541 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1512,10 +1512,17 @@ xfce_tasklist_arrow_button_toggled (GtkWidget *button,
}
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu),
+ xfce_tasklist_get_panel_plugin (tasklist),
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST, NULL);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
xfce_panel_plugin_position_menu,
xfce_tasklist_get_panel_plugin (tasklist),
1, gtk_get_current_event_time ());
+#endif
}
}
@@ -2864,11 +2871,19 @@ xfce_tasklist_button_button_press_event (GtkWidget *button,
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu),
+ xfce_tasklist_get_panel_plugin (child->tasklist),
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ (GdkEvent *) event);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
child->type == CHILD_TYPE_WINDOW ? xfce_panel_plugin_position_menu : NULL,
xfce_tasklist_get_panel_plugin (child->tasklist),
event->button,
event->time);
+#endif
return TRUE;
}
@@ -3574,11 +3589,19 @@ xfce_tasklist_group_button_button_press_event (GtkWidget *button,
G_CALLBACK (xfce_tasklist_group_button_menu_destroy), group_child);
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu),
+ xfce_tasklist_get_panel_plugin (group_child->tasklist),
+ GDK_GRAVITY_SOUTH_WEST,
+ GDK_GRAVITY_NORTH_WEST,
+ (GdkEvent *) event);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
xfce_panel_plugin_position_menu,
xfce_tasklist_get_panel_plugin (group_child->tasklist),
event->button,
event->time);
+#endif
return TRUE;
}
diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
index f47e993e..87cded75 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -943,8 +943,15 @@ window_menu_plugin_menu_window_item_activate (GtkWidget *mi,
g_signal_connect (G_OBJECT (menu), "selection-done",
G_CALLBACK (window_menu_plugin_menu_actions_selection_done),
gtk_widget_get_parent (mi));
+#if GTK_CHECK_VERSION (3, 20, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu), mi,
+ GDK_GRAVITY_SOUTH,
+ GDK_GRAVITY_NORTH_WEST,
+ (GdkEvent *) event);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL,
NULL, event->button, event->time);
+#endif
return TRUE;
}
@@ -1392,7 +1399,14 @@ window_menu_plugin_menu (GtkWidget *button,
g_signal_connect (G_OBJECT (menu), "deactivate",
G_CALLBACK (window_menu_plugin_menu_selection_done), button);
+#if GTK_CHECK_VERSION (3, 22, 0)
+ gtk_menu_popup_at_widget (GTK_MENU (menu), button,
+ GDK_GRAVITY_SOUTH,
+ GDK_GRAVITY_NORTH_WEST,
+ NULL);
+#else
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
button != NULL ? xfce_panel_plugin_position_menu : NULL,
plugin, 1, gtk_get_current_event_time ());
+#endif
}