Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/4765c68a15545a2c5465781f2957d771e5c7eb77
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/4765c68a15545a2c5465781f2957d771e5c7eb77
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/4765c68a15545a2c5465781f2957d771e5c7eb77

The branch, master has been updated
       via  4765c68a15545a2c5465781f2957d771e5c7eb77 (commit)
      from  f4620a3f68cf386394cbdd595827a2b60525b26f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=4765c68a15545a2c5465781f2957d771e5c7eb77
commit 4765c68a15545a2c5465781f2957d771e5c7eb77
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    fix gtk 3 deprication warnings

diff --git a/frontends/gtk/compat.c b/frontends/gtk/compat.c
index 65ef51d..a75fdaf 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,
diff --git a/frontends/gtk/compat.h b/frontends/gtk/compat.h
index 9554b0c..d822e2d 100644
--- a/frontends/gtk/compat.h
+++ b/frontends/gtk/compat.h
@@ -209,6 +209,16 @@ GtkWidget *nsgtk_button_new_from_stock(const gchar 
*stock_id);
  */
 gboolean nsgtk_stock_lookup(const gchar *stock_id, GtkStockItem *item);
 
+/**
+ * Sets whether the button will grab focus when it is clicked with the mouse.
+ *
+ * Compatability interface for original deprecated in GTK 3.20
+ *
+ * \param button The button alter
+ * \param focus_on_click whether the button grabs focus when clicked with the 
mouse
+ */
+void nsgtk_button_set_focus_on_click(GtkButton *button, gboolean 
focus_on_click);
+
 void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity);
 
 void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window, 
GtkWidget *child);
@@ -268,6 +278,15 @@ GtkWidget *nsgtk_image_menu_item_new_with_mnemonic(const 
gchar *label);
  */
 void nsgtk_image_menu_item_set_image(GtkWidget *image_menu_item, GtkWidget 
*image);
 
+/**
+ * Displays menu and makes it available for selection
+ *
+ * Compatability interface for gtk_menu_popup deprecated in GTK 3.22.
+ *
+ * \param image_menu_item The image menu entry item.
+ * \param trigger_event the GdkEvent that initiated this request or NULL if 
it's the current event.
+ */
+void nsgtk_menu_popup_at_pointer(GtkMenu *menu, const GdkEvent *trigger_event);
 
 /**
  * Parses a resource file containing a GtkBuilder UI definition and
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index bedad91..8c46fd8 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -534,8 +534,7 @@ nsgtk_window_tool_bar_clicked(GtkToolbar *toolbar,
        popup_menu_hide(g->menu_popup, true, false, true, false);
        popup_menu_show(g->menu_popup, false, false, false, true);
 
-       gtk_menu_popup(g->menu_popup->popup_menu, NULL, NULL, NULL, NULL, 0,
-                      gtk_get_current_event_time());
+       nsgtk_menu_popup_at_pointer(g->menu_popup->popup_menu, NULL);
 
        return TRUE;
 }
@@ -2751,8 +2750,7 @@ void nsgtk_scaffolding_context_menu(struct 
nsgtk_scaffolding *g,
                popup_menu_hide(g->menu_popup, false, false, false, true);
        }
 
-       gtk_menu_popup(gtkmenu, NULL, NULL, NULL, NULL, 0,
-                      gtk_get_current_event_time());
+       nsgtk_menu_popup_at_pointer(gtkmenu, NULL);
 }
 
 /**
diff --git a/frontends/gtk/tabs.c b/frontends/gtk/tabs.c
index dbe9d40..f99b240 100644
--- a/frontends/gtk/tabs.c
+++ b/frontends/gtk/tabs.c
@@ -82,7 +82,7 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window 
*window)
        close = nsgtk_image_new_from_stock(NSGTK_STOCK_CLOSE,
                                           GTK_ICON_SIZE_MENU);
        gtk_container_add(GTK_CONTAINER(button), close);
-       gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
+       nsgtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
        gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
        gtk_widget_set_tooltip_text(button, "Close this tab.");
 
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index 7f24d40..d0443a2 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1295,9 +1295,7 @@ static void gui_window_create_form_select_menu(struct 
gui_window *g,
 
        gtk_widget_show_all(select_menu);
 
-       gtk_menu_popup(GTK_MENU(select_menu), NULL, NULL, NULL,
-                       NULL /* data */, 0, gtk_get_current_event_time());
-
+       nsgtk_menu_popup_at_pointer(GTK_MENU(select_menu), NULL);
 }
 
 static void


-----------------------------------------------------------------------

Summary of changes:
 frontends/gtk/compat.c      |   24 +++++++++++++++++++++++-
 frontends/gtk/compat.h      |   19 +++++++++++++++++++
 frontends/gtk/scaffolding.c |    6 ++----
 frontends/gtk/tabs.c        |    2 +-
 frontends/gtk/window.c      |    4 +---
 5 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/frontends/gtk/compat.c b/frontends/gtk/compat.c
index 65ef51d..a75fdaf 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,
diff --git a/frontends/gtk/compat.h b/frontends/gtk/compat.h
index 9554b0c..d822e2d 100644
--- a/frontends/gtk/compat.h
+++ b/frontends/gtk/compat.h
@@ -209,6 +209,16 @@ GtkWidget *nsgtk_button_new_from_stock(const gchar 
*stock_id);
  */
 gboolean nsgtk_stock_lookup(const gchar *stock_id, GtkStockItem *item);
 
+/**
+ * Sets whether the button will grab focus when it is clicked with the mouse.
+ *
+ * Compatability interface for original deprecated in GTK 3.20
+ *
+ * \param button The button alter
+ * \param focus_on_click whether the button grabs focus when clicked with the 
mouse
+ */
+void nsgtk_button_set_focus_on_click(GtkButton *button, gboolean 
focus_on_click);
+
 void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity);
 
 void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window, 
GtkWidget *child);
@@ -268,6 +278,15 @@ GtkWidget *nsgtk_image_menu_item_new_with_mnemonic(const 
gchar *label);
  */
 void nsgtk_image_menu_item_set_image(GtkWidget *image_menu_item, GtkWidget 
*image);
 
+/**
+ * Displays menu and makes it available for selection
+ *
+ * Compatability interface for gtk_menu_popup deprecated in GTK 3.22.
+ *
+ * \param image_menu_item The image menu entry item.
+ * \param trigger_event the GdkEvent that initiated this request or NULL if 
it's the current event.
+ */
+void nsgtk_menu_popup_at_pointer(GtkMenu *menu, const GdkEvent *trigger_event);
 
 /**
  * Parses a resource file containing a GtkBuilder UI definition and
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index bedad91..8c46fd8 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -534,8 +534,7 @@ nsgtk_window_tool_bar_clicked(GtkToolbar *toolbar,
        popup_menu_hide(g->menu_popup, true, false, true, false);
        popup_menu_show(g->menu_popup, false, false, false, true);
 
-       gtk_menu_popup(g->menu_popup->popup_menu, NULL, NULL, NULL, NULL, 0,
-                      gtk_get_current_event_time());
+       nsgtk_menu_popup_at_pointer(g->menu_popup->popup_menu, NULL);
 
        return TRUE;
 }
@@ -2751,8 +2750,7 @@ void nsgtk_scaffolding_context_menu(struct 
nsgtk_scaffolding *g,
                popup_menu_hide(g->menu_popup, false, false, false, true);
        }
 
-       gtk_menu_popup(gtkmenu, NULL, NULL, NULL, NULL, 0,
-                      gtk_get_current_event_time());
+       nsgtk_menu_popup_at_pointer(gtkmenu, NULL);
 }
 
 /**
diff --git a/frontends/gtk/tabs.c b/frontends/gtk/tabs.c
index dbe9d40..f99b240 100644
--- a/frontends/gtk/tabs.c
+++ b/frontends/gtk/tabs.c
@@ -82,7 +82,7 @@ static GtkWidget *nsgtk_tab_label_setup(struct gui_window 
*window)
        close = nsgtk_image_new_from_stock(NSGTK_STOCK_CLOSE,
                                           GTK_ICON_SIZE_MENU);
        gtk_container_add(GTK_CONTAINER(button), close);
-       gtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
+       nsgtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
        gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
        gtk_widget_set_tooltip_text(button, "Close this tab.");
 
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index 7f24d40..d0443a2 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -1295,9 +1295,7 @@ static void gui_window_create_form_select_menu(struct 
gui_window *g,
 
        gtk_widget_show_all(select_menu);
 
-       gtk_menu_popup(GTK_MENU(select_menu), NULL, NULL, NULL,
-                       NULL /* data */, 0, gtk_get_current_event_time());
-
+       nsgtk_menu_popup_at_pointer(GTK_MENU(select_menu), NULL);
 }
 
 static void


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to