This is an automated email from the git hooks/post-receive script. o c h o s i 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/xfce4-panel.
commit d9e4900125cfbfba89f9e51864d4972d3d9e6448 Author: Simon Steinbeiss <[email protected]> Date: Fri Nov 23 23:26:27 2018 +0100 Set minimum Gtk+3 version to 3.22 Drop all Gtk3.22 specific ifdefs and - where necessary - replace them with generic Gtk3 ifdefs. --- configure.ac.in | 2 +- libxfce4panel/xfce-panel-plugin.c | 11 +++++------ panel/panel-base-window.c | 25 +++++++++++-------------- panel/panel-window.c | 5 ----- plugins/actions/actions.c | 6 ------ plugins/applicationsmenu/applicationsmenu.c | 9 --------- plugins/directorymenu/directorymenu.c | 8 -------- plugins/launcher/launcher-dialog.c | 8 -------- plugins/launcher/launcher.c | 7 ------- plugins/systray/systray-manager.c | 6 ------ plugins/systray/systray.c | 19 +------------------ plugins/tasklist/tasklist-widget.c | 23 ----------------------- plugins/windowmenu/windowmenu.c | 11 ----------- 13 files changed, 18 insertions(+), 122 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 713ea18..04f42b5 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -145,7 +145,7 @@ XDT_CHECK_PACKAGE([GARCON], [garcon-1], [0.5.0]) XDT_CHECK_PACKAGE([GARCON_GTK3], [garcon-gtk3-1], [0.5.0]) XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.13.0]) XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.13.2]) -XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.16.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0]) XDT_CHECK_PACKAGE([EXO], [exo-2], [0.11.2]) XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0]) XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0]) diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c index 3d1307f..d591b71 100644 --- a/libxfce4panel/xfce-panel-plugin.c +++ b/libxfce4panel/xfce-panel-plugin.c @@ -994,13 +994,12 @@ xfce_panel_plugin_button_press_event (GtkWidget *widget, gtk_widget_set_sensitive (item, plugin->priv->menu_blocked == 0); /* popup the menu */ -#if GTK_CHECK_VERSION (3, 22, 0) +#if GTK_CHECK_VERSION (3, 0, 0) gtk_menu_popup_at_pointer (menu, (GdkEvent *) event); #else gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time); #endif - return TRUE; } @@ -2433,7 +2432,7 @@ xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin) { XfceScreenPosition screen_position; GdkScreen *screen; -#if GTK_CHECK_VERSION (3, 22, 0) +#if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkMonitor *monitor; #else @@ -2466,7 +2465,7 @@ xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin) /* get the monitor geometry */ screen = gtk_widget_get_screen (GTK_WIDGET (plugin)); -#if GTK_CHECK_VERSION (3, 22, 0) +#if GTK_CHECK_VERSION (3, 0, 0) display = gdk_screen_get_display (screen); monitor = gdk_display_get_monitor_at_window (display, window); gdk_monitor_get_geometry (monitor, &geometry); @@ -2515,7 +2514,7 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin, GtkRequisition requisition; GdkScreen *screen; GdkRectangle geometry; -#if GTK_CHECK_VERSION (3, 22, 0) +#if GTK_CHECK_VERSION (3, 0, 0) GdkDisplay *display; GdkMonitor *monitor; #else @@ -2620,7 +2619,7 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin, /* get the monitor geometry */ screen = gtk_widget_get_screen (attach_widget); -#if GTK_CHECK_VERSION (3, 22, 0) +#if GTK_CHECK_VERSION (3, 0, 0) display = gdk_screen_get_display (screen); monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (attach_widget)); gdk_monitor_get_geometry (monitor, &geometry); diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c index 5d5db6d..34f87f5 100644 --- a/panel/panel-base-window.c +++ b/panel/panel-base-window.c @@ -58,7 +58,8 @@ static gboolean panel_base_window_enter_notify_event (GtkWidget GdkEventCrossing *event); static gboolean panel_base_window_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event); -static void panel_base_window_composited_changed (GtkWidget *widget); +static void panel_base_window_composited_changed (GdkScreen *screen, + GtkWidget *widget); static gboolean panel_base_window_active_timeout (gpointer user_data); static void panel_base_window_active_timeout_destroyed (gpointer user_data); static void panel_base_window_set_background_color_css (PanelBaseWindow *window); @@ -125,7 +126,6 @@ panel_base_window_class_init (PanelBaseWindowClass *klass) gtkwidget_class = GTK_WIDGET_CLASS (klass); gtkwidget_class->enter_notify_event = panel_base_window_enter_notify_event; gtkwidget_class->leave_notify_event = panel_base_window_leave_notify_event; - gtkwidget_class->composited_changed = panel_base_window_composited_changed; gtkwidget_class->screen_changed = panel_base_window_screen_changed; g_object_class_install_property (gobject_class, @@ -194,6 +194,7 @@ static void panel_base_window_init (PanelBaseWindow *window) { GtkStyleContext *context; + GdkScreen *screen; window->priv = panel_base_window_get_instance_private (window); @@ -203,11 +204,16 @@ panel_base_window_init (PanelBaseWindow *window) window->background_rgba = NULL; window->enter_opacity = 1.00; window->leave_opacity = 1.00; + window->leave_opacity_old = 1.00; window->priv->css_provider = gtk_css_provider_new (); window->priv->borders = PANEL_BORDER_NONE; window->priv->active_timeout_id = 0; + screen = gtk_widget_get_screen (GTK_WIDGET (window)); + g_signal_connect (G_OBJECT (screen), "composited-changed", + G_CALLBACK (panel_base_window_composited_changed), window); + /* some wm require stick to show the window on all workspaces, on xfwm4 * the type-hint already takes care of that */ gtk_window_stick (GTK_WINDOW (window)); @@ -445,11 +451,7 @@ panel_base_window_screen_changed (GtkWidget *widget, GdkScreen *previous_screen) if (visual != NULL) { gtk_widget_set_visual (widget, visual); -#if GTK_CHECK_VERSION (3, 22, 0) window->is_composited = gdk_screen_is_composited (screen); -#else - window->is_composited = gtk_widget_is_composited (widget); -#endif } panel_debug (PANEL_DEBUG_BASE_WINDOW, @@ -504,7 +506,8 @@ panel_base_window_leave_notify_event (GtkWidget *widget, static void -panel_base_window_composited_changed (GtkWidget *widget) +panel_base_window_composited_changed (GdkScreen *screen, + GtkWidget *widget) { PanelBaseWindow *window = PANEL_BASE_WINDOW (widget); gboolean was_composited = window->is_composited; @@ -512,14 +515,8 @@ panel_base_window_composited_changed (GtkWidget *widget) GtkAllocation allocation; /* set new compositing state */ -#if GTK_CHECK_VERSION (3, 22, 0) - GdkScreen *screen; - - screen = gtk_window_get_screen (GTK_WINDOW (window)); window->is_composited = gdk_screen_is_composited (screen); -#else - window->is_composited = gtk_widget_is_composited (widget); -#endif + if (window->is_composited == was_composited) return; diff --git a/panel/panel-window.c b/panel/panel-window.c index a2e253e..6c892db 100644 --- a/panel/panel-window.c +++ b/panel/panel-window.c @@ -2768,12 +2768,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS gtk_widget_show (item); } -#if GTK_CHECK_VERSION (3, 22, 0) gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); -#else - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, - NULL, NULL, 0, event->time); -#endif } diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c index 960fe66..e20ccdb 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 347bb5e..efe4a26 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 dc6c970..0014e4d 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 4a956e5..a35b872 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 84f29a1..57c9c1d 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 46827d0..f200bcb 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 9e34c73..0a9c46a 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 386a184..80a0de1 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 fbaecc6..4975d2f 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 } -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
