summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2018-11-23 23:26:27 +0100
committerSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2018-11-23 23:26:27 +0100
commitd9e4900125cfbfba89f9e51864d4972d3d9e6448 (patch)
tree30e6d2c1b0f5061c2e0668239ea9779b06017832 /plugins
parent60bb559af477341f53a1d508e4a77f7659f6b56d (diff)
downloadxfce4-panel-d9e4900125cfbfba89f9e51864d4972d3d9e6448.tar.gz
Set minimum Gtk+3 version to 3.22
Drop all Gtk3.22 specific ifdefs and - where necessary - replace them with generic Gtk3 ifdefs.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/actions/actions.c6
-rw-r--r--plugins/applicationsmenu/applicationsmenu.c9
-rw-r--r--plugins/directorymenu/directorymenu.c8
-rw-r--r--plugins/launcher/launcher-dialog.c8
-rw-r--r--plugins/launcher/launcher.c7
-rw-r--r--plugins/systray/systray-manager.c6
-rw-r--r--plugins/systray/systray.c19
-rw-r--r--plugins/tasklist/tasklist-widget.c23
-rw-r--r--plugins/windowmenu/windowmenu.c11
9 files changed, 1 insertions, 96 deletions
diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index 960fe666..e20ccdb1 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -1343,16 +1343,10 @@ actions_plugin_menu (GtkWidget *button,
}
}
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_menu_popup_at_widget (GTK_MENU (plugin->menu), button,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
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 347bb5e8..efe4a269 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -539,11 +539,9 @@ 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);
@@ -785,19 +783,12 @@ 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,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
(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 dc6c970b..0014e4d6 100644
--- a/plugins/directorymenu/directorymenu.c
+++ b/plugins/directorymenu/directorymenu.c
@@ -395,11 +395,9 @@ 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);
@@ -1017,16 +1015,10 @@ 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,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
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 4a956e5a..a35b8728 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -660,18 +660,10 @@ 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 84f29a18..57c9c1db 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -1706,7 +1706,6 @@ 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,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
@@ -1714,12 +1713,6 @@ launcher_plugin_menu_popup (gpointer user_data)
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
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/systray/systray-manager.c b/plugins/systray/systray-manager.c
index 46827d04..f200bcbf 100644
--- a/plugins/systray/systray-manager.c
+++ b/plugins/systray/systray-manager.c
@@ -766,14 +766,8 @@ systray_manager_set_visual (SystrayManager *manager)
visual_atom = gdk_x11_get_xatom_by_name_for_display (display,
"_NET_SYSTEM_TRAY_VISUAL");
-#if GTK_CHECK_VERSION (3, 22, 0)
if (gdk_screen_is_composited (gtk_widget_get_screen (manager->invisible))
&& (gdk_screen_get_rgba_visual (screen) != NULL))
-#else
- if (gtk_widget_is_composited (manager->invisible)
- && gdk_screen_get_rgba_visual (screen) != NULL
- && gdk_display_supports_composite (display))
-#endif
{
/* get the rgba visual */
xvisual = GDK_VISUAL_XVISUAL (gdk_screen_get_rgba_visual (screen));
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index 9e34c739..0a9c46ad 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -721,7 +721,7 @@ systray_plugin_box_draw_icon (GtkWidget *child,
}
-#if GTK_CHECK_VERSION (3, 22, 0)
+
static void
systray_plugin_box_draw (GtkWidget *box,
cairo_t *cr,
@@ -746,23 +746,6 @@ systray_plugin_box_draw (GtkWidget *box,
gtk_container_foreach (GTK_CONTAINER (box),
(GtkCallback) systray_plugin_box_draw_icon, cr);
}
-#else
-static void
-systray_plugin_box_draw (GtkWidget *box,
- cairo_t *cr,
- gpointer user_data)
-{
- panel_return_if_fail (cr != NULL);
-
- if (!gtk_widget_is_composited (box))
- return;
-
- /* separately draw all the composed tray icons after gtk
- * handled the draw event */
- gtk_container_foreach (GTK_CONTAINER (box),
- (GtkCallback) systray_plugin_box_draw_icon, cr);
-}
-#endif
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 386a184c..80a0de19 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1512,19 +1512,12 @@ 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), button,
xfce_tasklist_vertical (tasklist)
? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH_EAST,
xfce_tasklist_vertical (tasklist)
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH_EAST,
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
}
}
@@ -2873,20 +2866,12 @@ 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), button,
xfce_tasklist_vertical (child->tasklist)
? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_NORTH_WEST,
xfce_tasklist_vertical (child->tasklist)
? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_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;
}
@@ -3592,20 +3577,12 @@ 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), button,
xfce_tasklist_vertical (group_child->tasklist)
? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_NORTH_WEST,
xfce_tasklist_vertical (group_child->tasklist)
? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_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 fbaecc67..4975d2fc 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -943,15 +943,10 @@ 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, 22, 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;
}
@@ -1399,16 +1394,10 @@ 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,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_WEST : GDK_GRAVITY_NORTH,
xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin)) == GTK_ORIENTATION_VERTICAL
? GDK_GRAVITY_EAST : GDK_GRAVITY_SOUTH,
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
}