File caja-gtk-3.20.patch of Package caja

--- a/configure.ac
+++ b/configure.ac
@@ -2,11 +2,11 @@ AC_PREREQ(2.54)
 
 dnl ===========================================================================
 
-m4_define(glib_minver,                 2.50.0)
-m4_define(gio_minver,                  2.50.0)
+m4_define(glib_minver,                 2.48.0)
+m4_define(gio_minver,                  2.48.0)
 m4_define(mate_desktop_minver,         1.17.3)
 m4_define(pango_minver,                1.1.2)
-m4_define(gtk_minver,                  3.22.0)
+m4_define(gtk_minver,                  3.20.0)
 m4_define(xml_minver,                  2.4.7)
 m4_define(exif_minver,                 0.6.14)
 m4_define(exempi_minver,               1.99.5)
--- a/eel/eel-background.c
+++ b/eel/eel-background.c
@@ -80,7 +80,9 @@ struct EelBackgroundDetails
     gboolean is_active;
 };
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 static GList *desktop_bg_objects = NULL;
+#endif
 
 static void
 free_fade (EelBackground *self)
@@ -129,12 +131,14 @@ eel_background_finalize (GObject *object
     free_background_surface (self);
     free_fade (self);
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     if (self->details->is_desktop)
     {
         desktop_bg_objects = g_list_remove (desktop_bg_objects,
                                             G_OBJECT (self));
     }
 
+#endif
     G_OBJECT_CLASS (eel_background_parent_class)->finalize (object);
 }
 
@@ -493,8 +497,22 @@ fade_to_surface (EelBackground   *self,
 
     if (!mate_bg_crossfade_is_started (self->details->fade))
     {
+#if GTK_CHECK_VERSION (3, 22, 0)
         mate_bg_crossfade_start_widget (self->details->fade, widget);
+#else
+        GdkWindow *window;
 
+        if (EEL_IS_CANVAS (widget))
+        {
+            window = gtk_layout_get_bin_window (GTK_LAYOUT (widget));
+        }
+        else
+        {
+            window = gtk_widget_get_window (widget);
+        }
+
+        mate_bg_crossfade_start (self->details->fade, window);
+#endif
         if (self->details->is_desktop)
         {
             g_signal_connect (self->details->fade,
@@ -541,6 +559,22 @@ eel_background_set_up_widget (EelBackgro
 
         if (self->details->is_desktop)
         {
+#if !GTK_CHECK_VERSION (3, 22, 0)
+            if (self->details->bg_surface != NULL)
+            {
+                cairo_pattern_t *pattern =
+                  cairo_pattern_create_for_surface (self->details->bg_surface);
+                gdk_window_set_background_pattern (window, pattern);
+                cairo_pattern_destroy (pattern);
+            }
+            else
+            {
+                GdkRGBA color = self->details->default_color;
+                make_color_inactive (self, &color);
+                gdk_window_set_background_rgba (window, &color);
+            }
+            gdk_window_invalidate_rect (window, NULL, TRUE);
+#endif
             set_root_surface (self, window, gtk_widget_get_screen (widget));
         }
     }
@@ -715,7 +749,9 @@ eel_get_widget_background (GtkWidget *wi
 {
     EelBackground *self;
     gpointer data;
+#if GTK_CHECK_VERSION (3, 22, 0)
     GList *l;
+#endif
 
     g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
 
@@ -726,7 +762,7 @@ eel_get_widget_background (GtkWidget *wi
         g_assert (EEL_IS_BACKGROUND (data));
         return data;
     }
-
+#if GTK_CHECK_VERSION (3, 22, 0)
     /* Check for an existing desktop window background. */
     for (l = desktop_bg_objects; l != NULL; l = l->next)
     {
@@ -737,6 +773,7 @@ eel_get_widget_background (GtkWidget *wi
             return self;
         }
     }
+#endif
 
     self = eel_background_new ();
     self->details->widget = widget;
@@ -851,12 +888,14 @@ eel_background_set_desktop (EelBackgroun
 
     if (is_desktop)
     {
+#if GTK_CHECK_VERSION (3, 22, 0)
         self->details->widget =
           gtk_widget_get_toplevel (self->details->front_widget);
 
         desktop_bg_objects = g_list_prepend (desktop_bg_objects,
                                              G_OBJECT (self));
 
+#endif
         if (gtk_widget_get_realized (self->details->widget))
         {
             widget_realized_setup (self->details->widget, self);
@@ -864,9 +903,11 @@ eel_background_set_desktop (EelBackgroun
     }
     else
     {
+#if GTK_CHECK_VERSION (3, 22, 0)
         desktop_bg_objects = g_list_remove (desktop_bg_objects,
                                             G_OBJECT (self));
         self->details->widget = self->details->front_widget;
+#endif
     }
 }
 
@@ -898,7 +939,11 @@ eel_background_is_dark (EelBackground *s
     /* only check for the background on the 0th monitor */
     GdkScreen *screen = gdk_screen_get_default ();
     GdkDisplay *display = gdk_screen_get_display (screen);
+#if GTK_CHECK_VERSION (3, 22, 0)
     gdk_monitor_get_geometry (gdk_display_get_monitor (display, 0), &rect);
+#else
+    gdk_screen_get_monitor_geometry (screen, 0, &rect);
+#endif
 
     return mate_bg_is_dark (self->details->bg, rect.width, rect.height);
 }
--- a/libcaja-private/caja-icon-container.c
+++ b/libcaja-private/caja-icon-container.c
@@ -4584,7 +4584,14 @@ realize (GtkWidget *widget)
     GTK_WIDGET_CLASS (caja_icon_container_parent_class)->realize (widget);
 
     container = CAJA_ICON_CONTAINER (widget);
-
+#if !GTK_CHECK_VERSION (3, 22, 0)
+    /* Ensure that the desktop window is native so the background
+       set on it is drawn by X. */
+    if (container->details->is_desktop)
+    {
+        gdk_x11_window_get_xid (gtk_layout_get_bin_window (GTK_LAYOUT (widget)));
+    }
+#endif
     /* Set up DnD.  */
     caja_icon_dnd_init (container);
 
@@ -5245,7 +5252,11 @@ caja_icon_container_search_position_func
     GdkWindow *cont_window;
     GdkScreen *screen;
     GtkRequisition requisition;
+#if GTK_CHECK_VERSION (3, 22, 0)
     GdkMonitor *monitor_num;
+#else
+    int monitor_num;
+#endif
     GdkRectangle monitor;
 
 
@@ -5253,9 +5264,14 @@ caja_icon_container_search_position_func
     scale = gtk_widget_get_scale_factor (GTK_WIDGET (container));
     screen = gdk_window_get_screen (cont_window);
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     monitor_num = gdk_display_get_monitor_at_window (gdk_screen_get_display (screen),
                                                      cont_window);
     gdk_monitor_get_geometry (monitor_num, &monitor);
+#else
+    monitor_num = gdk_screen_get_monitor_at_window (screen, cont_window);
+    gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+#endif
 
     gtk_widget_realize (search_dialog);
 
--- a/src/caja-bookmarks-window.c
+++ b/src/caja-bookmarks-window.c
@@ -145,9 +145,15 @@ caja_bookmarks_window_response_callback
     {
         GError *error = NULL;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
         gtk_show_uri_on_window (GTK_WINDOW (dialog),
                                 "help:mate-user-guide/goscaja-36",
                                 gtk_get_current_event_time (), &error);
+#else
+        gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+                      "help:mate-user-guide/goscaja-36",
+                      gtk_get_current_event_time (), &error);
+#endif
 
         if (error)
         {
--- a/src/caja-connect-server-dialog.c
+++ b/src/caja-connect-server-dialog.c
@@ -710,9 +710,15 @@ connect_dialog_response_cb (CajaConnectS
         break;
     case GTK_RESPONSE_HELP :
         error = NULL;
+#if GTK_CHECK_VERSION (3, 22, 0)
         gtk_show_uri_on_window (GTK_WINDOW (dialog),
                                 "help:mate-user-guide/caja-server-connect",
                                 gtk_get_current_event_time (), &error);
+#else
+        gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+                      "help:mate-user-guide/caja-server-connect",
+                      gtk_get_current_event_time (), &error);
+#endif
         if (error)
         {
             eel_show_error_dialog (_("There was an error displaying help."), error->message,
--- a/src/caja-desktop-window.c
+++ b/src/caja-desktop-window.c
@@ -255,6 +255,7 @@ realize (GtkWidget *widget)
                           G_CALLBACK (caja_desktop_window_screen_size_changed), window);
 }
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 static gboolean
 draw (GtkWidget *widget,
       cairo_t   *cr)
@@ -263,6 +264,7 @@ draw (GtkWidget *widget,
 
     return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr);
 }
+#endif
 
 static char *
 real_get_title (CajaWindow *window)
@@ -287,7 +289,9 @@ caja_desktop_window_class_init (CajaDesk
     wclass->realize = realize;
     wclass->unrealize = unrealize;
     wclass->map = map;
+#if GTK_CHECK_VERSION (3, 22, 0)
     wclass->draw = draw;
+#endif
 
     nclass->window_type = CAJA_WINDOW_DESKTOP;
     nclass->get_title = real_get_title;
--- a/src/caja-file-management-properties.c
+++ b/src/caja-file-management-properties.c
@@ -222,9 +222,15 @@ preferences_show_help (GtkWindow *parent
 
     help_string = g_strdup_printf ("help:%s/%s", helpfile, sect_id);
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (parent,
                             help_string, gtk_get_current_event_time (),
                             &error);
+#else
+    gtk_show_uri (gtk_window_get_screen (parent),
+                  help_string, gtk_get_current_event_time (),
+                  &error);
+#endif
     g_free (help_string);
 
     if (error)
--- a/src/caja-location-dialog.c
+++ b/src/caja-location-dialog.c
@@ -94,9 +94,15 @@ response_callback (CajaLocationDialog *d
         break;
     case GTK_RESPONSE_HELP :
         error = NULL;
+#if GTK_CHECK_VERSION (3, 22, 0)
         gtk_show_uri_on_window (GTK_WINDOW (dialog),
                                 "help:mate-user-guide/caja-open-location",
                                 gtk_get_current_event_time (), &error);
+#else
+        gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+                      "help:mate-user-guide/caja-open-location",
+                      gtk_get_current_event_time (), &error);
+#endif
         if (error)
         {
             eel_show_error_dialog (_("There was an error displaying help."), error->message,
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -1648,9 +1648,15 @@ help_button_callback (GtkWidget *widget,
     GError *error = NULL;
     GtkWidget *dialog;
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (GTK_WINDOW (property_browser),
                             "help:mate-user-guide/goscaja-50",
                             gtk_get_current_event_time (), &error);
+#else
+    gtk_show_uri (gtk_widget_get_screen (property_browser),
+                  "help:mate-user-guide/goscaja-50",
+                  gtk_get_current_event_time (), &error);
+#endif
 
     if (error)
     {
--- a/src/caja-window-menus.c
+++ b/src/caja-window-menus.c
@@ -575,11 +575,19 @@ action_caja_manual_callback (GtkAction *
     error = NULL;
     window = CAJA_WINDOW (user_data);
 
+#if GTK_CHECK_VERSION (3, 22, 0)
     gtk_show_uri_on_window (GTK_WINDOW (window),
                             CAJA_IS_DESKTOP_WINDOW (window)
                                ? "help:mate-user-guide"
                                : "help:mate-user-guide/goscaja-1",
                             gtk_get_current_event_time (), &error);
+#else
+    gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (window)),
+                  CAJA_IS_DESKTOP_WINDOW (window)
+                     ? "help:mate-user-guide"
+                     : "help:mate-user-guide/goscaja-1",
+                  gtk_get_current_event_time (), &error);
+#endif
 
     if (error)
     {
--- a/src/caja-zoom-control.c
+++ b/src/caja-zoom-control.c
@@ -144,7 +144,12 @@ menu_position_under_widget (GtkMenu   *m
     GtkRequisition req;
     GtkRequisition menu_req;
     GdkRectangle monitor;
+#if GTK_CHECK_VERSION (3, 22, 0)
     GdkMonitor *monitor_num;
+#else
+    int monitor_num;
+    GdkScreen *screen;
+#endif
     GdkDisplay *display;
     GtkAllocation allocation;
 
@@ -159,10 +164,18 @@ menu_position_under_widget (GtkMenu   *m
     gtk_widget_get_allocation (widget, &allocation);
 
     display = gtk_widget_get_display (GTK_WIDGET (menu));
+#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
+    screen = gdk_display_get_default_screen (display);
+    monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
+    if (monitor_num < 0)
+        monitor_num = 0;
+    gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+#endif
 
     gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
     if (!gtk_widget_get_has_window (widget))
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -1170,9 +1170,15 @@ pattern_select_response_cb (GtkWidget *d
 		break;
 	case GTK_RESPONSE_HELP :
 		error = NULL;
+#if GTK_CHECK_VERSION (3, 22, 0)
 		gtk_show_uri_on_window (GTK_WINDOW (dialog),
 			                "help:mate-user-guide/caja-select-pattern",
 			                gtk_get_current_event_time (), &error);
+#else
+		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+		              "help:mate-user-guide/caja-select-pattern",
+		              gtk_get_current_event_time (), &error);
+#endif
 		if (error) {
 			eel_show_error_dialog (_("There was an error displaying help."), error->message,
 					       GTK_WINDOW (dialog));
--- a/src/file-manager/fm-list-model.c
+++ b/src/file-manager/fm-list-model.c
@@ -270,7 +270,11 @@ fm_list_model_get_icon_scale (FMListMode
                    &retval);
 
     if (retval == -1) {
+#if GTK_CHECK_VERSION (3, 22, 0)
         retval = gdk_monitor_get_scale_factor (gdk_display_get_monitor (gdk_display_get_default (), 0));
+#else
+        retval = gdk_screen_get_monitor_scale_factor (gdk_screen_get_default (), 0);
+#endif
     }
 
     return retval;
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -3421,9 +3421,11 @@ create_emblems_page (FMPropertiesWindow
 
 	gtk_container_set_border_width (GTK_CONTAINER (emblems_table), 12);
 
+#if GTK_CHECK_VERSION (3, 22, 0)
 	/* stop GTK 3.22 builds from ballooning the properties dialog to full screen height */
 	gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), 300);
 
+#endif
 	gtk_widget_show (scroller);
 
 	gtk_notebook_append_page (window->details->notebook,
@@ -5405,10 +5407,17 @@ real_response (GtkDialog *dialog,
 
 	switch (response) {
 	case GTK_RESPONSE_HELP:
+#if GTK_CHECK_VERSION (3, 22, 0)
 		gtk_show_uri_on_window (GTK_WINDOW (dialog),
 			                "help:mate-user-guide/goscaja-51",
 			                gtk_get_current_event_time (),
 			                &error);
+#else
+		gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)),
+		              "help:mate-user-guide/goscaja-51",
+		              gtk_get_current_event_time (),
+		              &error);
+#endif
 		if (error != NULL) {
 			eel_show_error_dialog (_("There was an error displaying help."), error->message,
 					       GTK_WINDOW (dialog));
openSUSE Build Service is sponsored by