File mate-applets-gtk-3.20.patch of Package mate-applets

--- a/accessx-status/applet.c
+++ b/accessx-status/applet.c
@@ -153,10 +153,17 @@ static void help_cb(GtkAction* action, A
 	GError* error = NULL;
 	GdkScreen* screen = gtk_widget_get_screen(GTK_WIDGET(sapplet->applet));
 
+#if GTK_CHECK_VERSION(3, 22, 0)
 	gtk_show_uri_on_window(NULL,
 	                       "help:mate-accessx-status",
 	                       gtk_get_current_event_time(),
 	                       &error);
+#else
+	gtk_show_uri(screen,
+	             "help:mate-accessx-status",
+	             gtk_get_current_event_time(),
+	             &error);
+#endif
 
 	if (error)
 	{
--- a/battstat/battstat_applet.c
+++ b/battstat/battstat_applet.c
@@ -1136,10 +1136,17 @@ battstat_show_help( ProgressData *battst
   else
     uri = g_strdup ("help:mate-battstat");
 
+#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_show_uri_on_window (NULL,
                 uri,
                 gtk_get_current_event_time (),
                 &error);
+#else
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (battstat->applet)),
+                uri,
+                gtk_get_current_event_time (),
+                &error);
+#endif
 
   g_free (uri);
 
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -627,10 +627,17 @@ help_cb (GtkAction     *action,
 {
   GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_show_uri_on_window (NULL,
                           "help:mate-char-palette",
                           gtk_get_current_event_time (),
                           &error);
+#else
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (curr_data->applet)),
+                "help:mate-char-palette",
+                gtk_get_current_event_time (),
+                &error);
+#endif
 
   if (error) { /* FIXME: the user needs to see this */
     g_warning ("help error: %s\n", error->message);
--- a/charpick/properties.c
+++ b/charpick/properties.c
@@ -499,10 +499,17 @@ phelp_cb (GtkDialog *dialog, gint tab, g
 {
   GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_show_uri_on_window (GTK_WINDOW (dialog),
                           "help:mate-char-palette/charpick-prefs",
                           gtk_get_current_event_time (),
                           &error);
+#else
+  gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+                "help:mate-char-palette/charpick-prefs",
+                gtk_get_current_event_time (),
+                &error);
+#endif
 
   if (error) { /* FIXME: the user needs to see this */
     g_warning ("help error: %s\n", error->message);
--- a/configure.ac
+++ b/configure.ac
@@ -11,9 +11,9 @@ AC_CONFIG_MACRO_DIR(m4)
 dnl ***************************************************************************
 dnl *** Minimum library versions for MATE-APPLETS                          ***
 dnl ***************************************************************************
-GLIB_REQUIRED=2.50.0
-GIO_REQUIRED=2.50.0
-GTK_REQUIRED=3.22.0
+GLIB_REQUIRED=2.48.0
+GIO_REQUIRED=2.48.0
+GTK_REQUIRED=3.20.0
 LIBPANEL4_REQUIRED=1.17.0
 LIBGTOP_REQUIRED=2.12.0
 LIBNOTIFY_REQUIRED=0.7.0
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -593,10 +593,17 @@ cpufreq_applet_help_cb (GtkAction     *a
 {
         GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (NULL,
 	                        "help:mate-cpufreq-applet",
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)),
+	              "help:mate-cpufreq-applet",
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 
         if (error) {
                 cpufreq_utils_display_error (_("Could not open help document"),
--- a/cpufreq/src/cpufreq-prefs.c
+++ b/cpufreq/src/cpufreq-prefs.c
@@ -356,10 +356,17 @@ cpufreq_prefs_dialog_response_cb (CPUFre
         GError *error = NULL;
 
         if (response == GTK_RESPONSE_HELP) {
+#if GTK_CHECK_VERSION (3, 22, 0)
 		gtk_show_uri_on_window (GTK_WINDOW (prefs->priv->dialog),
 	                            "help:mate-cpufreq-applet/cpufreq-applet-prefs",
 	                            gtk_get_current_event_time (),
 	                            &error);
+#else
+		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (prefs->priv->dialog)),
+		              "help:mate-cpufreq-applet/cpufreq-applet-prefs",
+		              gtk_get_current_event_time (),
+		              &error);
+#endif
 
                 if (error) {
                         cpufreq_utils_display_error (_("Could not open help document"),
--- a/drivemount/drive-button.c
+++ b/drivemount/drive-button.c
@@ -166,6 +166,7 @@ drive_button_unrealize (GtkWidget *widge
 }
 #endif /* 0 */
 
+#if GTK_CHECK_VERSION(3, 22, 0)
 static int
 _gtk_get_monitor_num (GdkMonitor *monitor)
 {
@@ -182,6 +183,7 @@ _gtk_get_monitor_num (GdkMonitor *monito
 
     return -1;
 }
+#endif
 
 /* the following function is adapted from gtkmenuitem.c */
 static void
@@ -195,7 +197,11 @@ position_menu (GtkMenu *menu, gint *x, g
     GtkRequisition requisition;
     GtkTextDirection direction;
     GdkRectangle monitor;
+#if GTK_CHECK_VERSION (3, 22, 0)
     GdkMonitor *monitor_num;
+#else
+    int monitor_num;
+#endif
     GdkDisplay *display;
 
     g_return_if_fail (menu != NULL);
@@ -212,10 +218,16 @@ position_menu (GtkMenu *menu, gint *x, g
 
     screen = gtk_widget_get_screen (GTK_WIDGET (menu));
     display =gdk_screen_get_display (screen);
+#if GTK_CHECK_VERSION (3, 22, 0)
     monitor_num = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget));
     if (monitor_num == NULL)
         monitor_num = gdk_display_get_monitor (display, 0);
     gdk_monitor_get_geometry (monitor_num, &monitor);
+#else
+    monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
+    monitor_num = monitor_num > 0 ? monitor_num : 0;
+    gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+#endif
 
     if (!gdk_window_get_origin (gtk_widget_get_window (widget), &tx, &ty)) {
 	g_warning ("Menu not on screen");
@@ -241,7 +253,11 @@ position_menu (GtkMenu *menu, gint *x, g
     *x = CLAMP (tx, monitor.x, MAX (monitor.x, monitor.x + monitor.width - twidth));
     *y = ty;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_menu_set_monitor (menu, _gtk_get_monitor_num (monitor_num));
+#else
+    gtk_menu_set_monitor (menu, monitor_num);
+#endif
 }
 
 static gboolean
--- a/drivemount/drivemount.c
+++ b/drivemount/drivemount.c
@@ -132,10 +132,17 @@ display_help (GtkAction *action,
 
     screen = gtk_widget_get_screen (GTK_WIDGET (drive_list));
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (NULL,
                            "help:mate-drivemount",
                             gtk_get_current_event_time (),
                             &error);
+#else
+    gtk_show_uri (screen,
+                  "help:mate-drivemount",
+                  gtk_get_current_event_time (),
+                  &error);
+#endif
 
     if (error) {
 	GtkWidget *dialog;
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -329,10 +329,17 @@ help_cb (GtkAction  *action,
 {
 	GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (NULL,
 	                        "help:mate-geyes",
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (eyes_applet->applet)),
+	              "help:mate-geyes",
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 
 	if (error) {
 		GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, 
--- a/geyes/themes.c
+++ b/geyes/themes.c
@@ -216,10 +216,17 @@ phelp_cb (GtkDialog *dialog)
 {
 	GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (GTK_WINDOW (dialog),
 	                        "help:mate-geyes/geyes-settings",
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+	              "help:mate-geyes/geyes-settings",
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 
 	if (error) {
 		GtkWidget *error_dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
--- a/mateweather/mateweather-applet.c
+++ b/mateweather/mateweather-applet.c
@@ -53,10 +53,17 @@ static void help_cb (GtkAction      *act
 {
     GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (NULL,
                             "help:mateweather",
                             gtk_get_current_event_time (),
                             &error);
+#else
+    gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (gw_applet->applet)),
+                  "help:mateweather",
+                  gtk_get_current_event_time (),
+                  &error);
+#endif
 
     if (error) { 
 	GtkWidget *dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
--- a/mateweather/mateweather-dialog.c
+++ b/mateweather/mateweather-dialog.c
@@ -109,10 +109,17 @@ static void response_cb(MateWeatherDialo
 
 static void link_cb(GtkButton* button, gpointer data)
 {
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (NULL,
                             "http://www.weather.com/",
                             gtk_get_current_event_time (),
                             NULL);
+#else
+    gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (button)),
+                  "https://weather.com/",
+                  gtk_get_current_event_time (),
+                  NULL);
+#endif
 }
 
 static gchar* replace_multiple_new_lines(gchar* s)
--- a/mateweather/mateweather-pref.c
+++ b/mateweather/mateweather-pref.c
@@ -740,10 +740,17 @@ static void help_cb(GtkDialog* dialog, M
 
 	current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (pref->priv->notebook));
 	uri = g_strdup_printf ("help:mateweather/mateweather-prefs#mateweather-%s", (current_page == 0) ? "metric" : "change-location");
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (GTK_WINDOW (dialog),
 	                        uri,
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+	              uri,
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 	g_free (uri);
 
 	if (error)
--- a/multiload/main.c
+++ b/multiload/main.c
@@ -73,10 +73,17 @@ help_cb (GtkAction       *action,
 
  	GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (NULL,
 	                        "help:mate-multiload",
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (ma->applet)),
+	              "help:mate-multiload",
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 
     	if (error) { /* FIXME: the user needs to see this */
         	g_warning ("help error: %s\n", error->message);
--- a/multiload/properties.c
+++ b/multiload/properties.c
@@ -86,10 +86,17 @@ properties_close_cb (GtkWidget *widget,
 	{
 		case GTK_RESPONSE_HELP:
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 			gtk_show_uri_on_window (NULL,
 			                        "help:mate-multiload/multiload-prefs",
 			                        gtk_get_current_event_time (),
 			                        &error);
+#else
+			gtk_show_uri (gtk_widget_get_screen (widget),
+			              "help:mate-multiload/multiload-prefs",
+			              gtk_get_current_event_time (),
+			              &error);
+#endif
 
 			if (error) { /* FIXME: the user needs to see this */
 				g_warning ("help error: %s\n", error->message);
--- a/netspeed/src/netspeed.c
+++ b/netspeed/src/netspeed.c
@@ -739,10 +742,17 @@ display_help (GtkWidget *dialog, const g
 	else
 		uri = g_strdup ("help:mate-netspeed-applet");
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	ret = gtk_show_uri_on_window (NULL,
 	                              uri,
 	                              gtk_get_current_event_time (),
 	                              &error);
+#else
+	ret = gtk_show_uri (gtk_widget_get_screen (dialog),
+	                    uri,
+	                    gtk_get_current_event_time (),
+	                    &error);
+#endif
 	g_free (uri);
 
 	if (ret == FALSE) {
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -336,10 +336,17 @@ void menu_help_cb(GtkAction *action, Sti
 {
 	GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	gtk_show_uri_on_window (NULL,
 	                        "help:mate-stickynotes-applet",
 	                        gtk_get_current_event_time (),
 	                        &error);
+#else
+	gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet->w_applet)),
+	              "help:mate-stickynotes-applet",
+	              gtk_get_current_event_time (),
+	              &error);
+#endif
 	if (error) {
 		GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
 							   _("There was an error displaying help: %s"), error->message);
@@ -526,10 +533,17 @@ void preferences_response_cb(GtkWidget *
 	if (response == GTK_RESPONSE_HELP) {
 		GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 		gtk_show_uri_on_window (GTK_WINDOW (dialog),
 		                        "help:mate-stickynotes-applet/stickynotes-advanced-settings",
 		                        gtk_get_current_event_time (),
 		                        &error);
+#else
+		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+		              "help:mate-stickynotes-applet/stickynotes-advanced-settings",
+		              gtk_get_current_event_time (),
+		              &error);
+#endif
 		if (error) {
 			dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
 								   _("There was an error displaying help: %s"), error->message);
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -378,10 +378,17 @@ static void
 response_cb (GtkWidget *dialog, gint id, gpointer data)
 {
         if (id == GTK_RESPONSE_HELP)
+#if GTK_CHECK_VERSION (3, 22, 0)
 		gtk_show_uri_on_window (GTK_WINDOW (dialog),
 		                        "help:mate-stickynotes-applet/stickynotes-settings-individual",
 		                        gtk_get_current_event_time (),
 		                        NULL);
+#else
+		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+		              "help:mate-stickynotes-applet/stickynotes-settings-individual",
+		              gtk_get_current_event_time (),
+		              NULL);
+#endif
         else if (id == GTK_RESPONSE_CLOSE)
                 gtk_widget_hide (dialog);
 }
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -368,10 +368,17 @@ trash_applet_open_folder (GtkAction   *a
 {
   GError *err = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_show_uri_on_window (NULL,
                           "trash:",
                           gtk_get_current_event_time (),
                           &err);
+#else
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)),
+                "trash:",
+                gtk_get_current_event_time (),
+                &err);
+#endif
 
   if (err)
     {
@@ -388,10 +395,17 @@ trash_applet_show_help (GtkAction   *act
   GError *err = NULL;
 
   /* FIXME - Actually, we need a user guide */
+#if GTK_CHECK_VERSION (3, 22, 0)
   gtk_show_uri_on_window (NULL,
                           "help:mate-trashapplet",
                           gtk_get_current_event_time (),
                           &err);
+#else
+  gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (applet)),
+                "help:mate-trashapplet",
+                gtk_get_current_event_time (),
+                &err);
+#endif
 
   if (err)
     {
--- a/trashapplet/src/xstuff.c
+++ b/trashapplet/src/xstuff.c
@@ -153,7 +153,11 @@ xstuff_zoom_animate (GtkWidget *widget,
 	GdkScreen    *gscreen;
 	GdkRectangle  rect, dest;
 	GtkAllocation allocation;
+#if GTK_CHECK_VERSION (3, 22, 0)
 	GdkMonitor   *monitor;
+#else
+	int           monitor;
+#endif
 
 	if (opt_rect)
 		rect = *opt_rect;
@@ -169,9 +173,14 @@ xstuff_zoom_animate (GtkWidget *widget,
 	}
 
 	gscreen = gtk_widget_get_screen (widget);
+#if GTK_CHECK_VERSION (3, 22, 0)
 	monitor = gdk_display_get_monitor_at_window (gdk_screen_get_display (gscreen),
 						     gtk_widget_get_window (widget));
 	gdk_monitor_get_geometry (monitor, &dest);
+#else
+	monitor = gdk_screen_get_monitor_at_window (gscreen, gtk_widget_get_window (widget));
+	gdk_screen_get_monitor_geometry (gscreen, monitor, &dest);
+#endif
 
 	draw_zoom_animation (gscreen,
 			     rect.x, rect.y, rect.width, rect.height,
openSUSE Build Service is sponsored by