diff options
Diffstat (limited to 'frontends/gtk/compat.c')
-rw-r--r-- | frontends/gtk/compat.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/frontends/gtk/compat.c b/frontends/gtk/compat.c index 65ef51dd5..a75fdafdc 100644 --- a/frontends/gtk/compat.c +++ b/frontends/gtk/compat.c @@ -216,6 +216,17 @@ GtkWidget *nsgtk_button_new_from_stock(const gchar *stock_id) } /* exported interface documented in gtk/compat.h */ +void nsgtk_button_set_focus_on_click(GtkButton *button, gboolean focus_on_click) +{ +#if GTK_CHECK_VERSION(3,20,0) + gtk_widget_set_focus_on_click(GTK_WIDGET(button), focus_on_click); +#else + gtk_button_set_focus_on_click(button, focus_on_click); +#endif +} + + +/* exported interface documented in gtk/compat.h */ gboolean nsgtk_stock_lookup(const gchar *stock_id, GtkStockItem *item) { #ifdef NSGTK_USE_ICON_NAME @@ -235,7 +246,7 @@ void nsgtk_widget_override_background_color(GtkWidget *widget, { #if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,16,0) - /* do nothing - deprecated - must use css styling */ + /* do nothing - deprecated - must use css styling */ return; #else GdkRGBA colour; @@ -547,6 +558,17 @@ void nsgtk_image_menu_item_set_image(GtkWidget *image_menu_item, GtkWidget *imag } /* exported interface documented in gtk/compat.h */ +void nsgtk_menu_popup_at_pointer(GtkMenu *menu, const GdkEvent *trigger_event) +{ +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(menu, trigger_event); +#else + gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, + gtk_get_current_event_time()); +#endif +} + +/* exported interface documented in gtk/compat.h */ gboolean nsgtk_icon_size_lookup_for_settings(GtkSettings *settings, GtkIconSize size, gint *width, |