diff --git a/app/propgui/gimppropgui-utils.c b/app/propgui/gimppropgui-utils.c index a601e398e2..471b05eaad 100644 --- a/app/propgui/gimppropgui-utils.c +++ b/app/propgui/gimppropgui-utils.c @@ -28,8 +28,6 @@ #include "propgui-types.h" -#include "widgets/gimpwidgets-utils.h" - #include "gimppropgui-utils.h" #include "gimp-intl.h" @@ -37,18 +35,13 @@ /* local function prototypes */ -static void gimp_prop_kelvin_presets_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data); -static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget, - GdkEventButton *bevent, - GtkMenu *menu); -static void gimp_prop_kelvin_presets_activate (GtkWidget *widget, - GObject *config); -static void gimp_prop_random_seed_new_clicked (GtkButton *button, - GtkAdjustment *adj); +static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget, + GdkEventButton *bevent, + GtkMenu *menu); +static void gimp_prop_kelvin_presets_activate (GtkWidget *widget, + GObject *config); +static void gimp_prop_random_seed_new_clicked (GtkButton *button, + GtkAdjustment *adj); /* public functions */ @@ -168,16 +161,6 @@ gimp_prop_random_seed_new (GObject *config, /* private functions */ -static void -gimp_prop_kelvin_presets_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y); -} - static gboolean gimp_prop_kelvin_presets_button_press (GtkWidget *widget, GdkEventButton *bevent, @@ -185,10 +168,10 @@ gimp_prop_kelvin_presets_button_press (GtkWidget *widget, { if (bevent->type == GDK_BUTTON_PRESS) { - gtk_menu_popup (menu, - NULL, NULL, - gimp_prop_kelvin_presets_menu_position, widget, - bevent->button, bevent->time); + gtk_menu_popup_at_widget (menu, widget, + GDK_GRAVITY_WEST, + GDK_GRAVITY_NORTH_EAST, + (GdkEvent *) bevent); } return TRUE; diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c index 7932b6213e..c02a30ce89 100644 --- a/app/widgets/gimpdashboard.c +++ b/app/widgets/gimpdashboard.c @@ -50,7 +50,6 @@ #include "gimpmeter.h" #include "gimpsessioninfo-aux.h" #include "gimpuimanager.h" -#include "gimpwidgets-utils.h" #include "gimpwindowstrategy.h" #include "gimp-intl.h" @@ -301,12 +300,6 @@ static void gimp_dashboard_sample_object (GimpDashboard static void gimp_dashboard_container_remove (GtkWidget *widget, GtkContainer *container); -static void gimp_dashboard_group_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data); - static void gimp_dashboard_update_groups (GimpDashboard *dashboard); static void gimp_dashboard_update_group (GimpDashboard *dashboard, Group group); @@ -1256,11 +1249,11 @@ gimp_dashboard_group_expander_button_press (GimpDashboard *dashboard, bevent->y >= allocation.y && bevent->y < allocation.y + allocation.height) { - gtk_menu_popup (group_data->menu, - NULL, NULL, - gimp_dashboard_group_menu_position, - group_data->menu_button, - bevent->button, bevent->time); + gtk_menu_popup_at_widget (group_data->menu, + GTK_WIDGET (group_data->menu_button), + GDK_GRAVITY_WEST, + GDK_GRAVITY_NORTH_EAST, + (GdkEvent *) bevent); return TRUE; } @@ -1900,16 +1893,6 @@ gimp_dashboard_container_remove (GtkWidget *widget, gtk_container_remove (container, widget); } -static void -gimp_dashboard_group_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y); -} - static void gimp_dashboard_update_groups (GimpDashboard *dashboard) { diff --git a/app/widgets/gimpsettingsbox.c b/app/widgets/gimpsettingsbox.c index 9609623615..a56e319d55 100644 --- a/app/widgets/gimpsettingsbox.c +++ b/app/widgets/gimpsettingsbox.c @@ -39,7 +39,6 @@ #include "gimpcontainerview.h" #include "gimpsettingsbox.h" #include "gimpsettingseditor.h" -#include "gimpwidgets-utils.h" #include "gimp-intl.h" @@ -575,16 +574,6 @@ gimp_settings_box_setting_selected (GimpContainerView *view, } } -static void -gimp_settings_box_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - gimp_button_menu_position (user_data, menu, GTK_POS_LEFT, x, y); -} - static gboolean gimp_settings_box_menu_press (GtkWidget *widget, GdkEventButton *bevent, @@ -594,10 +583,10 @@ gimp_settings_box_menu_press (GtkWidget *widget, if (bevent->type == GDK_BUTTON_PRESS) { - gtk_menu_popup (GTK_MENU (private->menu), - NULL, NULL, - gimp_settings_box_menu_position, widget, - bevent->button, bevent->time); + gtk_menu_popup_at_widget (GTK_MENU (private->menu), widget, + GDK_GRAVITY_WEST, + GDK_GRAVITY_NORTH_EAST, + (GdkEvent *) bevent); } return TRUE; diff --git a/libgimpwidgets/gimpcolorbutton.c b/libgimpwidgets/gimpcolorbutton.c index aa4ae21e64..67427a8a9f 100644 --- a/libgimpwidgets/gimpcolorbutton.c +++ b/libgimpwidgets/gimpcolorbutton.c @@ -535,9 +535,7 @@ gimp_color_button_button_press (GtkWidget *widget, gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget)); - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, - bevent->button, bevent->time); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) bevent); } return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent); diff --git a/libgimpwidgets/gimppreviewarea.c b/libgimpwidgets/gimppreviewarea.c index 254ca28775..a5b00e8261 100644 --- a/libgimpwidgets/gimppreviewarea.c +++ b/libgimpwidgets/gimppreviewarea.c @@ -1946,10 +1946,5 @@ gimp_preview_area_menu_popup (GimpPreviewArea *area, gtk_menu_shell_append (GTK_MENU_SHELL (menu), gimp_preview_area_menu_new (area, "check-size")); - if (event) - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, event->button, event->time); - else - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ()); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); } diff --git a/plug-ins/common/animation-play.c b/plug-ins/common/animation-play.c index 579cb57eee..602258ff90 100644 --- a/plug-ins/common/animation-play.c +++ b/plug-ins/common/animation-play.c @@ -305,10 +305,7 @@ popup_menu (GtkWidget *widget, GtkWidget *menu = gtk_ui_manager_get_widget (ui_manager, "/anim-play-popup"); gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget)); - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, - event ? event->button : 0, - event ? event->time : gtk_get_current_event_time ()); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); return TRUE; } diff --git a/plug-ins/common/colormap-remap.c b/plug-ins/common/colormap-remap.c index 6ee8d831de..8c67e08943 100644 --- a/plug-ins/common/colormap-remap.c +++ b/plug-ins/common/colormap-remap.c @@ -557,10 +557,7 @@ remap_popup_menu (GtkWidget *widget, GtkWidget *menu = gtk_ui_manager_get_widget (remap_ui, "/remap-popup"); gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget)); - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, - event ? event->button : 0, - event ? event->time : gtk_get_current_event_time ()); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); return TRUE; } diff --git a/plug-ins/help-browser/dialog.c b/plug-ins/help-browser/dialog.c index beb9de9f76..095ce0fd3c 100644 --- a/plug-ins/help-browser/dialog.c +++ b/plug-ins/help-browser/dialog.c @@ -1058,10 +1058,7 @@ view_popup_menu (GtkWidget *widget, menu = gtk_ui_manager_get_widget (ui_manager, path); gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget)); - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, - event ? event->button : 0, - event ? event->time : gtk_get_current_event_time ()); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); return TRUE; } diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c index ffad80263f..1bf98f1278 100644 --- a/plug-ins/ifs-compose/ifs-compose.c +++ b/plug-ins/ifs-compose/ifs-compose.c @@ -1593,9 +1593,7 @@ design_area_button_press (GtkWidget *widget, gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget)); - gtk_menu_popup (GTK_MENU (menu), - NULL, NULL, NULL, NULL, - event->button, event->time); + gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event); return FALSE; } diff --git a/plug-ins/imagemap/imap_menu.c b/plug-ins/imagemap/imap_menu.c index c184319b7a..8185d5c74c 100644 --- a/plug-ins/imagemap/imap_menu.c +++ b/plug-ins/imagemap/imap_menu.c @@ -493,8 +493,8 @@ void do_main_popup_menu(GdkEventButton *event) { GtkWidget *popup = gtk_ui_manager_get_widget (ui_manager, "/PopupMenu"); - gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, - event->button, event->time); + + gtk_menu_popup_at_pointer (GTK_MENU (popup), (GdkEvent *) event); } void diff --git a/plug-ins/imagemap/imap_object_popup.c b/plug-ins/imagemap/imap_object_popup.c index bee4fdba16..f3e3b61877 100644 --- a/plug-ins/imagemap/imap_object_popup.c +++ b/plug-ins/imagemap/imap_object_popup.c @@ -42,8 +42,7 @@ object_handle_popup(ObjectPopup_t *popup, Object_t *obj, GdkEventButton *event) (position < g_list_length(obj->list->list)) ? TRUE : FALSE); #endif - gtk_menu_popup(GTK_MENU(popup->menu), NULL, NULL, NULL, NULL, - event->button, event->time); + gtk_menu_popup_at_pointer (GTK_MENU (popup->menu), (GdkEvent *) event); } void diff --git a/plug-ins/imagemap/imap_polygon.c b/plug-ins/imagemap/imap_polygon.c index 53d46a88ab..b30e47b6ea 100644 --- a/plug-ins/imagemap/imap_polygon.c +++ b/plug-ins/imagemap/imap_polygon.c @@ -719,8 +719,7 @@ polygon_handle_popup (GdkEventButton *event, gboolean near_sash, gtk_widget_set_sensitive (delete, near_sash); gtk_widget_set_sensitive (insert, near_edge); - gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL, - event->button, event->time); + gtk_menu_popup_at_pointer (GTK_MENU (popup), (GdkEvent *) event); } static void