diff -Nru caja-1.16.3/configure.ac caja-1.16.9/configure.ac --- caja-1.16.3/configure.ac 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/configure.ac 2017-05-08 10:34:20.000000000 +0000 @@ -4,7 +4,7 @@ m4_define(glib_minver, 2.36.0) m4_define(gio_minver, 2.26.0) -m4_define(mate_desktop_minver, 1.15.1) +m4_define(mate_desktop_minver, 1.16.2) m4_define(pango_minver, 1.1.2) m4_define(gtk_minver, 2.24.0) m4_define(xml_minver, 2.4.7) @@ -19,7 +19,7 @@ m4_define(caja_extension_current, 5) m4_define(caja_extension_revision, 0) -AC_INIT([caja], [1.16.1], [http://www.mate-desktop.org]) +AC_INIT([caja], [1.16.6], [http://www.mate-desktop.org]) dnl --------------------------------------------------------------------------- dnl GTK library version diff -Nru caja-1.16.3/data/caja.css caja-1.16.9/data/caja.css --- caja-1.16.3/data/caja.css 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/data/caja.css 2017-05-08 10:34:20.000000000 +0000 @@ -1,25 +1,10 @@ +/*Sane defaults for themes that do not specify them, themes can override these */ +/*This is loaded with GTK_STYLE_PROVIDER_PRIORITY_THEME so themes can override */ .caja-canvas-item { border-radius: 3px; } -.caja-desktop-window, -.caja-desktop:not(:selected):not(:active):not(.rubberband){ - background-color: transparent; -} - -/* desktop mode */ -.caja-desktop.caja-canvas-item { - color: #ffffff; - text-shadow: 1px 1px alpha (#000000, 0.8); -} - -.caja-desktop.caja-canvas-item:selected, -.caja-desktop.caja-canvas-item:active, -.caja-desktop.caja-canvas-item:hover { - text-shadow: none; -} - /* EelEditableLabel (icon labels) */ .caja-desktop.view .entry, .caja-desktop.view .entry:focus, @@ -45,7 +30,7 @@ .caja-desktop.view .entry:selected, .caja-desktop.view .entry:focus:selected, -.caja-desktop.view .entry:backdrop:selected +.caja-desktop.view .entry:backdrop:selected, .caja-navigation-window .view .entry:active, .caja-navigation-window .view .entry:selected, .caja-navigation-window .view .entry:focus:selected, @@ -55,16 +40,4 @@ text-shadow: none; } -/* remove possible theme settings for borders on scrolledwindow with gtk+-3.20 */ -.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow, -.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow.frame, -.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow > widget.view.caja-desktop { - border-width: 0px; - border-style: none; - border-radius: 0px; -} -/* Padding in slider buttons causes GTK errors in GTK 3.20 or later */ -.caja-navigation-window .slider-button { - padding: 0px; -} diff -Nru caja-1.16.3/data/caja-desktop-3.14.css caja-1.16.9/data/caja-desktop-3.14.css --- caja-1.16.3/data/caja-desktop-3.14.css 1970-01-01 00:00:00.000000000 +0000 +++ caja-1.16.9/data/caja-desktop-3.14.css 2017-05-08 10:34:20.000000000 +0000 @@ -0,0 +1,29 @@ +/* Everything that themes must not override goes in this file */ +/* This is loaded with GTK_STYLE_PROVIDER_PRIORITY_APPLICATION and overrides themes */ + +/* desktop mode */ +.caja-desktop.caja-canvas-item { + color: #ffffff; + text-shadow: 1px 1px alpha (#000000, 0.8); +} + +.caja-desktop.caja-canvas-item:selected, +.caja-desktop.caja-canvas-item:active, +.caja-desktop.caja-canvas-item:hover { + text-shadow: none; +} + +/* remove possible theme settings for borders on scrolledwindow with gtk+-3.20 */ +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow, +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow.frame, +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow > widget.view.caja-desktop { + border-width: 0px; + border-style: none; + border-radius: 0px; +} + +/* This is not on the desktop but will cause errors if themes can override */ +/* Padding in slider buttons causes GTK errors in GTK 3.20 or later */ +.caja-navigation-window .slider-button { + padding: 0px; +} diff -Nru caja-1.16.3/data/caja-desktop.css caja-1.16.9/data/caja-desktop.css --- caja-1.16.3/data/caja-desktop.css 1970-01-01 00:00:00.000000000 +0000 +++ caja-1.16.9/data/caja-desktop.css 2017-05-08 10:34:20.000000000 +0000 @@ -0,0 +1,34 @@ +/* Everything that themes must not override goes in this file */ +/* This is loaded with GTK_STYLE_PROVIDER_PRIORITY_APPLICATION and overrides themes */ + +.caja-desktop-window, +.caja-desktop:not(:selected):not(:active):not(.rubberband){ + background-color: transparent; +} + +/* desktop mode */ +.caja-desktop.caja-canvas-item { + color: #ffffff; + text-shadow: 1px 1px alpha (#000000, 0.8); +} + +.caja-desktop.caja-canvas-item:selected, +.caja-desktop.caja-canvas-item:active, +.caja-desktop.caja-canvas-item:hover { + text-shadow: none; +} + +/* remove possible theme settings for borders on scrolledwindow with gtk+-3.20 */ +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow, +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow.frame, +.caja-desktop-window > grid.vertical > box.vertical > box.vertical > box.vertical > scrolledwindow > widget.view.caja-desktop { + border-width: 0px; + border-style: none; + border-radius: 0px; +} + +/* This is not on the desktop but will cause errors if themes can override */ +/* Padding in slider buttons causes GTK errors in GTK 3.20 or later */ +.caja-navigation-window .slider-button { + padding: 0px; +} diff -Nru caja-1.16.3/data/Makefile.am caja-1.16.9/data/Makefile.am --- caja-1.16.3/data/Makefile.am 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/data/Makefile.am 2017-05-08 10:34:20.000000000 +0000 @@ -34,6 +34,8 @@ caja-extras.placeholder \ caja-suggested.placeholder \ caja.css \ + caja-desktop.css \ + caja-desktop-3.14.css \ $(NULL) # app data file diff -Nru caja-1.16.3/debian/changelog caja-1.16.9/debian/changelog --- caja-1.16.3/debian/changelog 2017-01-24 06:49:12.000000000 +0000 +++ caja-1.16.9/debian/changelog 2017-05-15 18:02:33.000000000 +0000 @@ -1,14 +1,33 @@ -caja (1.16.3-1~vinnie1.1) xenial; urgency=medium +caja (1.16.9-1~xenial1.1vinnie1) xenial; urgency=medium - * Add patch for compiz "wallpaper" plugin + * Add Compiz wallpaper support - -- Igor An. Berezhnov (Vinnie) Tue, 24 Jan 2017 09:47:55 +0300 + -- Igor An. Berezhnov (Vinnie) Mon, 15 May 2017 21:01:48 +0300 -caja (1.16.1-1~xenial3.1) xenial; urgency=medium +caja (1.16.6-1~xenial1.1) xenial; urgency=medium * Automated PPA build. - -- Martin Wimpress Fri, 13 Jan 2017 02:00:31 +0000 + -- Martin Wimpress Mon, 15 May 2017 00:13:08 +0100 + +caja (1.16.2-2~xenial4.0) xenial; urgency=medium + + [ Martin Wimpress ] + * debian/rules: + + Enable dh_girespository helper. + + -- Mike Gabriel Tue, 24 Jan 2017 20:15:12 +0100 + +caja (1.16.2-1) unstable; urgency=medium + + * New upstream release. + - List view: show/hide columns instead of appending/removing them (fixes + crash when moving between trash and other folder with GTK+3). (Closes: + #834943). + - Rename labels: follow theme if available, sane default. (Closes: #851311). + - Fix keyboard-down wraparound on compact view. (Closes: #817061). + + -- Mike Gabriel Tue, 24 Jan 2017 17:19:20 +0100 caja (1.16.1-1) unstable; urgency=medium diff -Nru caja-1.16.3/debian/control caja-1.16.9/debian/control --- caja-1.16.3/debian/control 2016-10-05 08:03:35.000000000 +0000 +++ caja-1.16.9/debian/control 2017-05-14 23:13:08.000000000 +0000 @@ -17,7 +17,7 @@ libgirepository1.0-dev, libglib2.0-dev, libgtk2.0-dev, - libmate-desktop-dev (>= 1.16), + libmate-desktop-dev (>= 1.16.2), libpango1.0-dev, libselinux1-dev [linux-any], libstartup-notification0-dev, @@ -136,4 +136,4 @@ This package contains introspection data for Caja. . It can be used by packages using the GIRepository format to generate - dynamic bindings. \ No newline at end of file + dynamic bindings. diff -Nru caja-1.16.3/debian/patches/01_add-compiz-wallpapers-support.patch caja-1.16.9/debian/patches/01_add-compiz-wallpapers-support.patch --- caja-1.16.3/debian/patches/01_add-compiz-wallpapers-support.patch 2017-01-23 10:51:10.000000000 +0000 +++ caja-1.16.9/debian/patches/01_add-compiz-wallpapers-support.patch 2017-05-15 17:53:05.000000000 +0000 @@ -1,6 +1,6 @@ -diff -Nura caja-1.14.0.orig/eel/eel-background.c caja-1.14.0/eel/eel-background.c ---- caja-1.14.0.orig/eel/eel-background.c 2016-04-06 17:52:24.000000000 +0300 -+++ caja-1.14.0/eel/eel-background.c 2016-05-18 19:49:22.468524206 +0300 +diff -Nura caja-1.16.0.orig/eel/eel-background.c caja-1.14.0/eel/eel-background.c +--- caja-1.16.0.orig/eel/eel-background.c 2016-04-06 17:52:24.000000000 +0300 ++++ caja-1.16.0/eel/eel-background.c 2016-05-18 19:49:22.468524206 +0300 @@ -53,6 +53,11 @@ #define mate_bg_crossfade_set_end_surface mate_bg_crossfade_set_end_pixmap #endif @@ -13,7 +13,7 @@ G_DEFINE_TYPE (EelBackground, eel_background, G_TYPE_OBJECT); enum -@@ -84,6 +89,9 @@ +@@ -85,6 +90,9 @@ #endif gboolean use_base; @@ -23,7 +23,7 @@ /* Is this background attached to desktop window */ gboolean is_desktop; -@@ -437,9 +445,22 @@ +@@ -467,9 +475,22 @@ set_image_properties (self); window = gtk_widget_get_window (self->details->widget); @@ -49,26 +49,26 @@ self->details->unset_root_surface = self->details->is_desktop; self->details->bg_entire_width = width; -@@ -650,8 +671,15 @@ - window = gtk_widget_get_window (widget); - } +@@ -659,8 +680,15 @@ + + gtk_widget_queue_draw (widget); - if (self->details->fade != NULL) -- in_fade = fade_to_surface (self, window, self->details->bg_surface); +- in_fade = fade_to_surface (self, widget, self->details->bg_surface); + if (self->details->fade != NULL) { -+ /* transparent background patch - don't fade when transparent */ -+ if (desktop_is_transparent) { -+ in_fade = FALSE; -+ } else { -+ in_fade = fade_to_surface (self, window, self->details->bg_surface); -+ } -+ /* transparent background patch - don't fade when transparent */ ++ /* transparent background patch - don't fade when transparent */ ++ if (desktop_is_transparent) { ++ in_fade = FALSE; ++ } else { ++ in_fade = fade_to_surface (self, widget, self->details->bg_surface); ++ } ++ /* transparent background patch - don't fade when transparent */ + } if (!in_fade) { -@@ -973,7 +1001,15 @@ - GtkWidget *widget, +@@ -1039,7 +1067,15 @@ + eel_background_set_desktop (EelBackground *self, gboolean is_desktop) { - self->details->is_desktop = is_desktop; @@ -82,21 +82,21 @@ + } + /* transparent background patch - remember desktop mode */ - if (gtk_widget_get_realized (widget) && is_desktop) + if (is_desktop) { -diff -Nura caja-1.14.0.orig/src/caja-actions.h caja-1.14.0/src/caja-actions.h ---- caja-1.14.0.orig/src/caja-actions.h 2016-03-17 13:19:22.000000000 +0300 -+++ caja-1.14.0/src/caja-actions.h 2016-05-18 19:49:22.468524206 +0300 +diff -Nura caja-1.16.0.orig/src/caja-actions.h caja-1.16.0/src/caja-actions.h +--- caja-1.16.0.orig/src/caja-actions.h 2016-03-17 13:19:22.000000000 +0300 ++++ caja-1.16.0/src/caja-actions.h 2016-05-18 19:49:22.468524206 +0300 @@ -1,5 +1,4 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - /* * Caja * -diff -Nura caja-1.14.0.orig/src/caja-application.c caja-1.14.0/src/caja-application.c ---- caja-1.14.0.orig/src/caja-application.c 2016-04-06 17:52:16.000000000 +0300 -+++ caja-1.14.0/src/caja-application.c 2016-05-18 19:49:22.468524206 +0300 -@@ -1039,6 +1039,15 @@ +diff -Nura caja-1.16.0.orig/src/caja-application.c caja-1.16.0/src/caja-application.c +--- caja-1.16.0.orig/src/caja-application.c 2016-04-06 17:52:16.000000000 +0300 ++++ caja-1.16.0/src/caja-application.c 2016-05-18 19:49:22.468524206 +0300 +@@ -1058,6 +1058,15 @@ } #endif @@ -112,7 +112,7 @@ void caja_application_startup (CajaApplication *application, gboolean kill_shell, -@@ -1087,6 +1096,17 @@ +@@ -1106,6 +1115,17 @@ else { caja_application_open_desktop (application); @@ -130,12 +130,12 @@ } } -diff -Nura caja-1.14.0.orig/src/caja-desktop-window.c caja-1.14.0/src/caja-desktop-window.c ---- caja-1.14.0.orig/src/caja-desktop-window.c 2016-04-06 17:52:16.000000000 +0300 -+++ caja-1.14.0/src/caja-desktop-window.c 2016-05-18 19:50:48.299943537 +0300 -@@ -40,6 +40,10 @@ - #include - #endif +diff -Nura caja-1.16.0.orig/src/caja-desktop-window.c caja-1.16.0/src/caja-desktop-window.c +--- caja-1.16.0.orig/src/caja-desktop-window.c 2016-04-06 17:52:16.000000000 +0300 ++++ caja-1.16.0/src/caja-desktop-window.c 2016-05-18 19:50:48.299943537 +0300 +@@ -37,6 +37,10 @@ + #include + #include +/* transparent background patch - global status flag */ +extern gboolean desktop_is_transparent; @@ -144,7 +144,7 @@ struct CajaDesktopWindowDetails { gulong size_changed_id; -@@ -264,6 +268,14 @@ +@@ -149,6 +153,14 @@ #if GTK_CHECK_VERSION (3, 19, 0) gtk_window_set_default_size (GTK_WINDOW (window), -1, -1); #endif diff -Nru caja-1.16.3/debian/rules caja-1.16.9/debian/rules --- caja-1.16.3/debian/rules 2016-09-30 06:52:47.000000000 +0000 +++ caja-1.16.9/debian/rules 2017-05-03 00:10:48.000000000 +0000 @@ -7,7 +7,7 @@ include /usr/share/dpkg/buildflags.mk %: - dh $@ $(DHFLAGS) + dh $@ $(DHFLAGS) --with gir override_dh_install: rm -fv debian/tmp/usr/lib/*/*.la diff -Nru caja-1.16.3/eel/eel-background-box.c caja-1.16.9/eel/eel-background-box.c --- caja-1.16.3/eel/eel-background-box.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-background-box.c 2017-05-08 10:34:20.000000000 +0000 @@ -30,23 +30,30 @@ G_DEFINE_TYPE (EelBackgroundBox, eel_background_box, GTK_TYPE_EVENT_BOX) static gboolean -eel_background_box_draw (GtkWidget *widget, #if GTK_CHECK_VERSION (3, 0, 0) +eel_background_box_draw (GtkWidget *widget, cairo_t *cr) #else - GdkEventExpose *event) +eel_background_box_expose_event (GtkWidget *widget, + GdkEventExpose *event) #endif { -#if GTK_CHECK_VERSION (3, 0, 0) +#if !GTK_CHECK_VERSION (3, 0, 0) + cairo_t *cr = gdk_cairo_create (event->window); + + gdk_cairo_rectangle (cr, &event->area); + cairo_clip (cr); +#endif eel_background_draw (widget, cr); +#if GTK_CHECK_VERSION (3, 0, 0) gtk_container_propagate_draw (GTK_CONTAINER (widget), gtk_bin_get_child (GTK_BIN (widget)), cr); #else - eel_background_draw (widget, event); gtk_container_propagate_expose (GTK_CONTAINER (widget), gtk_bin_get_child (GTK_BIN (widget)), event); + cairo_destroy (cr); #endif return TRUE; } @@ -60,12 +67,12 @@ eel_background_box_class_init (EelBackgroundBoxClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - #if GTK_CHECK_VERSION (3, 0, 0) widget_class->draw = eel_background_box_draw; #else - widget_class->expose_event = eel_background_box_draw; + widget_class->expose_event = eel_background_box_expose_event; #endif + } GtkWidget* diff -Nru caja-1.16.3/eel/eel-background.c caja-1.16.9/eel/eel-background.c --- caja-1.16.3/eel/eel-background.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-background.c 2017-05-08 10:34:20.000000000 +0000 @@ -68,6 +68,7 @@ struct EelBackgroundDetails { GtkWidget *widget; + GtkWidget *front_widget; MateBG *bg; char *color; @@ -99,6 +100,10 @@ gboolean is_active; }; +#if GTK_CHECK_VERSION (3, 22, 0) +static GList *desktop_bg_objects = NULL; +#endif + static void free_fade (EelBackground *self) { @@ -144,9 +149,16 @@ } 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); } @@ -157,12 +169,24 @@ self->details->bg_entire_width = 0; self->details->bg_entire_height = 0; +#if GTK_CHECK_VERSION (3, 0, 0) + self->details->default_color.red = 1.0; + self->details->default_color.green = 1.0; + self->details->default_color.blue = 1.0; + self->details->default_color.alpha = 1.0; +#else self->details->default_color.red = 0xffff; self->details->default_color.green = 0xffff; self->details->default_color.blue = 0xffff; +#endif } +#if GTK_CHECK_VERSION (3, 0, 0) +#define CLAMP_COLOR(v) (CLAMP ((v), 0, 1)) +#else #define CLAMP_COLOR(v) (t = (v), CLAMP (t, 0, G_MAXUSHORT)) +#endif + #define SATURATE(v) ((1.0 - saturation) * intensity + saturation * (v)) static void @@ -174,7 +198,9 @@ #endif { double intensity, saturation; +#if !GTK_CHECK_VERSION (3, 0, 0) gushort t; +#endif if (!self->details->is_active) { saturation = 0.7; @@ -183,7 +209,11 @@ color->green = SATURATE (color->green); color->blue = SATURATE (color->blue); +#if GTK_CHECK_VERSION (3, 0, 0) + if (intensity > 0.5) +#else if (intensity > G_MAXUSHORT / 2) +#endif { color->red *= 0.9; color->green *= 0.9; @@ -450,46 +480,21 @@ void eel_background_draw (GtkWidget *widget, -# if GTK_CHECK_VERSION (3, 0, 0) cairo_t *cr) { - int width, height; - GdkWindow *window = gtk_widget_get_window (widget); - GdkRGBA color; - EelBackground *self = eel_get_widget_background (widget); - - drawable_get_adjusted_size (self, &width, &height); - - eel_background_ensure_realized (self); - color = self->details->default_color; - make_color_inactive (self, &color); - - cairo_save (cr); - - if (self->details->bg_surface != NULL) { - cairo_set_source_surface (cr, self->details->bg_surface, 0, 0); - cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT); - } else { - gdk_cairo_set_source_rgba (cr, &color); - } - - cairo_rectangle (cr, 0, 0, width, height); - cairo_fill (cr); - - cairo_restore (cr); -} -# else - GdkEventExpose *event) -{ - int width, height; - GdkWindow *window = gtk_widget_get_window (widget); +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA color; +#else GdkColor color; +#endif + int width, height; - if (event->window != window) + if (self->details->fade != NULL && + mate_bg_crossfade_is_started (self->details->fade)) + { return; - - EelBackground *self = eel_get_widget_background (widget); + } drawable_get_adjusted_size (self, &width, &height); @@ -497,24 +502,25 @@ color = self->details->default_color; make_color_inactive (self, &color); - cairo_t *cr = gdk_cairo_create (window); + cairo_save (cr); - if (self->details->bg_surface != NULL) { + if (self->details->bg_surface != NULL) + { cairo_set_source_surface (cr, self->details->bg_surface, 0, 0); cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT); } else { +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_cairo_set_source_rgba (cr, &color); +#else gdk_cairo_set_source_color (cr, &color); +#endif } - gdk_cairo_rectangle (cr, &event->area); - cairo_clip (cr); - cairo_rectangle (cr, 0, 0, width, height); cairo_fill (cr); - cairo_destroy (cr); + cairo_restore (cr); } -# endif static void set_root_surface (EelBackground *self, @@ -599,7 +605,7 @@ static gboolean fade_to_surface (EelBackground *self, - GdkWindow *window, + GtkWidget *widget, cairo_surface_t *surface) { if (self->details->fade == NULL || @@ -610,7 +616,22 @@ 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, @@ -625,63 +646,70 @@ static void eel_background_set_up_widget (EelBackground *self) { - GdkWindow *window; GtkWidget *widget = self->details->widget; -# if GTK_CHECK_VERSION (3, 0, 0) - GdkRGBA color; -#else - GdkColor color; -#endif gboolean in_fade = FALSE; if (!gtk_widget_get_realized (widget)) return; eel_background_ensure_realized (self); - color = self->details->default_color; - make_color_inactive (self, &color); if (self->details->bg_surface == NULL) return; - if (EEL_IS_CANVAS (widget)) { - window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); - } else { - window = gtk_widget_get_window (widget); - } + gtk_widget_queue_draw (widget); if (self->details->fade != NULL) - in_fade = fade_to_surface (self, window, self->details->bg_surface); + in_fade = fade_to_surface (self, widget, self->details->bg_surface); if (!in_fade) { -# if GTK_CHECK_VERSION (3, 0, 0) - cairo_pattern_t *pattern; - pattern = cairo_pattern_create_for_surface (self->details->bg_surface); - gdk_window_set_background_pattern (window, pattern); - cairo_pattern_destroy (pattern); -# endif + GdkWindow *window; - if (self->details->is_desktop) + if (EEL_IS_CANVAS (widget)) { -# if !GTK_CHECK_VERSION (3, 0, 0) - gdk_window_set_back_pixmap (window, self->details->bg_surface, FALSE); -# endif - set_root_surface (self, window, gtk_widget_get_screen (widget)); + window = gtk_layout_get_bin_window (GTK_LAYOUT (widget)); } else { -#if GTK_CHECK_VERSION (3, 0, 0) - gdk_window_set_background_rgba (window, &color); -#else - gdk_window_set_background (window, &color); -#endif -# if !GTK_CHECK_VERSION (3, 0, 0) - gdk_window_set_back_pixmap (window, self->details->bg_surface, FALSE); -# endif + window = gtk_widget_get_window (widget); } +#if !GTK_CHECK_VERSION (3, 0, 0) + if (self->details->bg_surface != NULL) + { + gdk_window_set_back_pixmap (window, + self->details->bg_surface, FALSE); + } + else + { + GdkColor color = self->details->default_color; + make_color_inactive (self, &color); + gdk_window_set_background (window, &color); + } gdk_window_invalidate_rect (window, NULL, TRUE); + +#endif + if (self->details->is_desktop) + { +#if GTK_CHECK_VERSION (3, 0, 0) && !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)); + } } } @@ -696,8 +724,6 @@ eel_background_unrealize (self); eel_background_set_up_widget (self); - gtk_widget_queue_draw (self->details->widget); - return FALSE; } @@ -720,6 +746,13 @@ * EelBackgroundStyle so that it will match the chosen GTK+ theme. */ static void +#if GTK_CHECK_VERSION (3, 0, 0) +widget_style_updated_cb (GtkWidget *widget, + gpointer user_data) +{ + widget_queue_background_change (widget, user_data); +} +#else widget_style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer user_data) @@ -727,6 +760,7 @@ if (previous_style != NULL) widget_queue_background_change (widget, user_data); } +#endif static void eel_background_changed (MateBG *bg, @@ -835,7 +869,9 @@ } free_fade (self); + self->details->widget = NULL; + self->details->front_widget = NULL; } /* Gets the background attached to a widget. @@ -844,9 +880,9 @@ this will create one. To change the widget's background, you can just call eel_background methods on the widget. - If the widget is a canvas, nothing more needs to be done. For - normal widgets, you need to call eel_background_draw() from your - draw/expose handler to draw the background. + If the widget is a desktop window, nothing more needs to be done, otherwise + you need to call eel_background_draw() from your draw/expose event handler + to draw the background. Later, we might want a call to find out if we already have a background, or a way to share the same background among multiple widgets; both would @@ -855,22 +891,41 @@ EelBackground * eel_get_widget_background (GtkWidget *widget) { + EelBackground *self; + gpointer data; +#if GTK_CHECK_VERSION (3, 22, 0) + GList *l; +#endif g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); /* Check for an existing background. */ - gpointer data = g_object_get_data (G_OBJECT (widget), "eel_background"); + data = g_object_get_data (G_OBJECT (widget), "eel_background"); if (data != NULL) { 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) + { + g_assert (EEL_IS_BACKGROUND (l->data)); + self = EEL_BACKGROUND (l->data); + if (widget == self->details->widget) + { + return self; + } + } +#endif + + self = eel_background_new (); + self->details->widget = widget; + self->details->front_widget = widget; /* Store the background in the widget's data. */ - EelBackground *self = eel_background_new (); g_object_set_data_full (G_OBJECT (widget), "eel_background", self, g_object_unref); - self->details->widget = widget; g_signal_connect_object (widget, "destroy", G_CALLBACK (on_widget_destroyed), self, 0); @@ -879,8 +934,13 @@ g_signal_connect_object (widget, "unrealize", G_CALLBACK (widget_unrealize_cb), self, 0); +#if GTK_CHECK_VERSION (3, 0, 0) + g_signal_connect_object (widget, "style-updated", + G_CALLBACK (widget_style_updated_cb), self, 0); +#else g_signal_connect_object (widget, "style_set", G_CALLBACK (widget_style_set_cb), self, 0); +#endif /* Arrange to get the signal whenever the background changes. */ g_signal_connect_object (self, "appearance_changed", @@ -928,9 +988,16 @@ EelBackgroundDetails); self->details->bg = mate_bg_new (); +#if GTK_CHECK_VERSION (3, 0, 0) + self->details->default_color.red = 1.0; + self->details->default_color.green = 1.0; + self->details->default_color.blue = 1.0; + self->details->default_color.alpha = 1.0; +#else self->details->default_color.red = 0xffff; self->details->default_color.green = 0xffff; self->details->default_color.blue = 0xffff; +#endif self->details->is_active = TRUE; g_signal_connect (self->details->bg, "changed", @@ -970,14 +1037,32 @@ void eel_background_set_desktop (EelBackground *self, - GtkWidget *widget, gboolean is_desktop) { self->details->is_desktop = is_desktop; - if (gtk_widget_get_realized (widget) && is_desktop) + 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); + } + } + else { - widget_realized_setup (widget, self); +#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 } } @@ -995,6 +1080,7 @@ { self->details->is_active = is_active; set_image_properties (self); + gtk_widget_queue_draw (self->details->widget); } } diff -Nru caja-1.16.3/eel/eel-background.h caja-1.16.9/eel/eel-background.h --- caja-1.16.3/eel/eel-background.h 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-background.h 2017-05-08 10:34:20.000000000 +0000 @@ -83,7 +83,6 @@ /* Should be TRUE for desktop background */ gboolean eel_background_is_desktop (EelBackground *self); void eel_background_set_desktop (EelBackground *self, - GtkWidget *widget, gboolean is_desktop); /* Calls to interrogate the current state of a background. */ @@ -95,11 +94,7 @@ /* Helper function for widgets using EelBackground */ void eel_background_draw (GtkWidget *widget, -#if GTK_CHECK_VERSION (3, 0, 0) cairo_t *cr); -#else - GdkEventExpose *event); -#endif /* Handles a dragged color being dropped on a widget to change the background color. */ void eel_background_set_dropped_color (EelBackground *self, diff -Nru caja-1.16.3/eel/eel-canvas.c caja-1.16.9/eel/eel-canvas.c --- caja-1.16.3/eel/eel-canvas.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-canvas.c 2017-05-08 10:34:20.000000000 +0000 @@ -578,6 +578,15 @@ } +#if GTK_CHECK_VERSION (3, 0, 0) +static void +eel_canvas_queue_resize (EelCanvas *canvas) +{ + if (gtk_widget_is_drawable (GTK_WIDGET (canvas))) + gtk_widget_queue_resize (GTK_WIDGET (canvas)); +} +#endif + /* Convenience function to reorder items in a group's child list. This puts the * specified link after the "before" link. Returns TRUE if the list was changed. */ @@ -851,6 +860,9 @@ } redraw_and_repick_if_mapped (item); +#if GTK_CHECK_VERSION (3, 0, 0) + eel_canvas_queue_resize (item->canvas); +#endif } } @@ -876,6 +888,10 @@ if (item->flags & EEL_CANVAS_ITEM_MAPPED) (* EEL_CANVAS_ITEM_GET_CLASS (item)->unmap) (item); +#if GTK_CHECK_VERSION (3, 0, 0) + eel_canvas_queue_resize (item->canvas); +#endif + /* No need to unrealize when we just want to hide */ } } @@ -1909,6 +1925,11 @@ if (!(item->flags & EEL_CANVAS_ITEM_MAPPED)) (* EEL_CANVAS_ITEM_GET_CLASS (item)->map) (item); } + +#if GTK_CHECK_VERSION (3, 0, 0) + if (item->flags & EEL_CANVAS_ITEM_VISIBLE) + eel_canvas_queue_resize (EEL_CANVAS_ITEM (group)->canvas); +#endif } /* Removes an item from a group */ @@ -1929,6 +1950,11 @@ if (item->flags & EEL_CANVAS_ITEM_REALIZED) (* EEL_CANVAS_ITEM_GET_CLASS (item)->unrealize) (item); +#if GTK_CHECK_VERSION (3, 0, 0) + if (item->flags & EEL_CANVAS_ITEM_VISIBLE) + eel_canvas_queue_resize (item->canvas); +#endif + /* Unparent the child */ item->parent = NULL; @@ -3045,6 +3071,7 @@ if ((canvas->new_current_item != canvas->current_item) && button_down) { + canvas->current_item = canvas->new_current_item; canvas->left_grabbed_item = TRUE; return retval; } @@ -3119,9 +3146,11 @@ /* Pick the current item as if the button were not pressed, and * then process the event. */ + event->state ^= mask; canvas->state = event->state; pick_current_item (canvas, (GdkEvent *) event); - canvas->state ^= mask; + event->state ^= mask; + canvas->state = event->state; retval = emit_event (canvas, (GdkEvent *) event); break; @@ -4296,22 +4325,6 @@ return state_set; } -#if GTK_CHECK_VERSION(3, 0, 0) -static GType eel_canvas_item_accessible_get_type (void); - -typedef struct _EelCanvasItemAccessible EelCanvasItemAccessible; -typedef struct _EelCanvasItemAccessibleClass EelCanvasItemAccessibleClass; - -struct _EelCanvasItemAccessible -{ - GtkAccessible parent; -}; - -struct _EelCanvasItemAccessibleClass -{ - GtkAccessibleClass parent_class; -}; - G_DEFINE_TYPE_WITH_CODE (EelCanvasItemAccessible, eel_canvas_item_accessible, ATK_TYPE_GOBJECT_ACCESSIBLE, @@ -4332,61 +4345,7 @@ eel_canvas_item_accessible_init (EelCanvasItemAccessible *accessible) { } -#else -static void -eel_canvas_item_accessible_class_init (AtkObjectClass *klass) -{ - accessible_item_parent_class = g_type_class_peek_parent (klass); - - klass->initialize = eel_canvas_item_accessible_initialize; - klass->ref_state_set = eel_canvas_item_accessible_ref_state_set; -} -static GType -eel_canvas_item_accessible_get_type (void) -{ - static GType type = 0; - - if (!type) - { - static const GInterfaceInfo atk_component_info = - { - (GInterfaceInitFunc) eel_canvas_item_accessible_component_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - AtkObjectFactory *factory; - GType parent_atk_type; - GTypeQuery query; - GTypeInfo tinfo = { 0 }; - - factory = atk_registry_get_factory (atk_get_default_registry(), - G_TYPE_INITIALLY_UNOWNED); - if (!factory) - { - return G_TYPE_INVALID; - } - parent_atk_type = atk_object_factory_get_accessible_type (factory); - if (!parent_atk_type) - { - return G_TYPE_INVALID; - } - g_type_query (parent_atk_type, &query); - tinfo.class_init = (GClassInitFunc) eel_canvas_item_accessible_class_init; - tinfo.class_size = query.class_size; - tinfo.instance_size = query.instance_size; - type = g_type_register_static (parent_atk_type, - "EelCanvasItemAccessibility", - &tinfo, 0); - - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - - } - - return type; -} -#endif static AtkObject * eel_canvas_item_accessible_create (GObject *for_object) { diff -Nru caja-1.16.3/eel/eel-canvas.h caja-1.16.9/eel/eel-canvas.h --- caja-1.16.3/eel/eel-canvas.h 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-canvas.h 2017-05-08 10:34:20.000000000 +0000 @@ -575,6 +575,21 @@ }; #endif + GType eel_canvas_item_accessible_get_type (void); + + typedef struct _EelCanvasItemAccessible EelCanvasItemAccessible; + typedef struct _EelCanvasItemAccessibleClass EelCanvasItemAccessibleClass; + + struct _EelCanvasItemAccessible + { + AtkGObjectAccessible parent; + }; + + struct _EelCanvasItemAccessibleClass + { + AtkGObjectAccessibleClass parent_class; + }; + #ifdef __cplusplus } #endif diff -Nru caja-1.16.3/eel/eel-gdk-extensions.c caja-1.16.9/eel/eel-gdk-extensions.c --- caja-1.16.3/eel/eel-gdk-extensions.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-gdk-extensions.c 2017-05-08 10:34:20.000000000 +0000 @@ -343,6 +343,7 @@ color->red = 1.0; color->green = 1.0; color->blue = 1.0; + color->alpha = 1.0; } } #else @@ -494,9 +495,9 @@ { int intensity; - intensity = ((((int) (color->red) >> 8) * 77) - + (((int) (color->green) >> 8) * 150) - + (((int) (color->blue) >> 8) * 28)) >> 8; + intensity = (((guint) (color->red * 0xff) * 77) + + ((guint) (color->green * 0xff) * 150) + + ((guint) (color->blue * 0xff) * 28)) >> 8; #else /** * eel_gdk_color_is_dark: diff -Nru caja-1.16.3/eel/eel-string.c caja-1.16.9/eel/eel-string.c --- caja-1.16.3/eel/eel-string.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/eel/eel-string.c 2017-05-08 10:34:20.000000000 +0000 @@ -792,8 +792,7 @@ if (unique_ref_strs == NULL) { unique_ref_strs = - eel_g_hash_table_new_free_at_exit (g_str_hash, g_str_equal, - "unique eel_ref_str"); + g_hash_table_new(g_str_hash, g_str_equal); } res = g_hash_table_lookup (unique_ref_strs, string); diff -Nru caja-1.16.3/libcaja-private/caja-desktop-link.c caja-1.16.9/libcaja-private/caja-desktop-link.c --- caja-1.16.3/libcaja-private/caja-desktop-link.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-desktop-link.c 2017-05-08 10:34:20.000000000 +0000 @@ -460,8 +460,11 @@ if (link->details->signal_handler != 0) { - g_signal_handler_disconnect (link->details->signal_handler_obj, - link->details->signal_handler); + if (g_signal_handler_is_connected(link->details->signal_handler_obj, + link->details->signal_handler)){ + g_signal_handler_disconnect (link->details->signal_handler_obj, + link->details->signal_handler); + } } if (link->details->icon_file != NULL) diff -Nru caja-1.16.3/libcaja-private/caja-desktop-link-monitor.c caja-1.16.9/libcaja-private/caja-desktop-link-monitor.c --- caja-1.16.3/libcaja-private/caja-desktop-link-monitor.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-desktop-link-monitor.c 2017-05-08 10:34:20.000000000 +0000 @@ -488,6 +488,7 @@ desktop_volumes_visible_changed, monitor); +/* These sources are already gone, this just causes errors if (monitor->details->mount_id != 0) { g_source_remove (monitor->details->mount_id); @@ -500,7 +501,7 @@ { g_source_remove (monitor->details->changed_id); } - +*/ g_free (monitor->details); EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object)); diff -Nru caja-1.16.3/libcaja-private/caja-directory-background.c caja-1.16.9/libcaja-private/caja-directory-background.c --- caja-1.16.3/libcaja-private/caja-directory-background.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-directory-background.c 2017-05-08 10:34:20.000000000 +0000 @@ -382,8 +382,7 @@ background = eel_get_widget_background (GTK_WIDGET (icon_container)); - eel_background_set_desktop (background, - GTK_WIDGET (icon_container), TRUE); + eel_background_set_desktop (background, TRUE); g_signal_connect_object (background, "settings_changed", G_CALLBACK (desktop_background_changed_cb), NULL, 0); diff -Nru caja-1.16.3/libcaja-private/caja-directory.c caja-1.16.9/libcaja-private/caja-directory.c --- caja-1.16.3/libcaja-private/caja-directory.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-directory.c 2017-05-08 10:34:20.000000000 +0000 @@ -357,11 +357,8 @@ CajaDirectory *directory; /* Create the hash table first time through. */ - if (directories == NULL) - { - directories = eel_g_hash_table_new_free_at_exit - (g_file_hash, (GCompareFunc)g_file_equal, "caja-directory.c: directories"); - + if (directories == NULL) { + directories = g_hash_table_new (g_file_hash, (GCompareFunc) g_file_equal); add_preferences_callbacks (); } diff -Nru caja-1.16.3/libcaja-private/caja-file.c caja-1.16.9/libcaja-private/caja-file.c --- caja-1.16.3/libcaja-private/caja-file.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-file.c 2017-05-08 10:34:20.000000000 +0000 @@ -552,8 +552,7 @@ /* Create the hash table first time through. */ if (symbolic_links == NULL) { - symbolic_links = eel_g_hash_table_new_free_at_exit - (g_str_hash, g_str_equal, "caja-file.c: symbolic_links"); + symbolic_links = g_hash_table_new (g_str_hash, g_str_equal); } target_uri = caja_file_get_symbolic_link_target_uri (file); @@ -4133,6 +4132,11 @@ return NULL; } + icon = get_custom_icon (file); + if (icon != NULL) { + return icon; + } + if (file->details->icon) { icon = NULL; @@ -6965,9 +6969,12 @@ gboolean caja_file_is_caja_link (CajaFile *file) { - /* NOTE: I removed the historical link here, because i don't think we - even detect that mimetype anymore */ - return caja_file_is_mime_type (file, "application/x-desktop"); + if (file->details->mime_type == NULL) { + return FALSE; + } + return g_content_type_equals (eel_ref_str_peek (file->details->mime_type), + "application/x-desktop"); + } /** diff -Nru caja-1.16.3/libcaja-private/caja-icon-canvas-item.c caja-1.16.9/libcaja-private/caja-icon-canvas-item.c --- caja-1.16.3/libcaja-private/caja-icon-canvas-item.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-icon-canvas-item.c 2017-05-08 10:34:20.000000000 +0000 @@ -149,6 +149,8 @@ EelIRect bounds_cache_for_layout; EelIRect bounds_cache_for_entire_item; + GdkWindow *cursor_window; + /* Accessibility bits */ GailTextUtil *text_util; }; @@ -275,6 +277,12 @@ details = CAJA_ICON_CANVAS_ITEM (object)->details; + if (details->cursor_window != NULL) + { + gdk_window_set_cursor (details->cursor_window, NULL); + g_object_unref (details->cursor_window); + } + if (details->pixbuf != NULL) { g_object_unref (details->pixbuf); @@ -369,9 +377,11 @@ { CajaIconCanvasItem *item; CajaIconCanvasItemDetails *details; + AtkObject *accessible; item = CAJA_ICON_CANVAS_ITEM (object); details = item->details; + accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); switch (property_id) { @@ -387,11 +397,8 @@ details->editable_text = g_strdup (g_value_get_string (value)); if (details->text_util) { - AtkObject *accessible; - gail_text_util_text_setup (details->text_util, details->editable_text); - accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); g_object_notify (G_OBJECT(accessible), "accessible-name"); } @@ -428,6 +435,9 @@ } details->is_highlighted_for_selection = g_value_get_boolean (value); caja_icon_canvas_item_invalidate_label_size (item); + + atk_object_notify_state_change (accessible, ATK_STATE_SELECTED, + details->is_highlighted_for_selection); break; case PROP_HIGHLIGHTED_AS_KEYBOARD_FOCUS: @@ -436,12 +446,8 @@ return; } details->is_highlighted_as_keyboard_focus = g_value_get_boolean (value); - - if (details->is_highlighted_as_keyboard_focus) - { - AtkObject *atk_object = atk_gobject_accessible_for_object (object); - atk_focus_tracker_notify (atk_object); - } + atk_object_notify_state_change (accessible, ATK_STATE_FOCUSED, + details->is_highlighted_as_keyboard_focus); break; case PROP_HIGHLIGHTED_FOR_DROP: @@ -1214,7 +1220,6 @@ pango_layout_set_height (layout, -1); } else if (needs_highlight || - details->is_prelit || details->is_highlighted_as_keyboard_focus || details->entire_text || container->details->label_position == CAJA_ICON_LABEL_POSITION_BESIDE) @@ -2571,8 +2576,10 @@ { CajaIconCanvasItem *icon_item; GdkCursor *cursor; + GdkWindow *cursor_window; icon_item = CAJA_ICON_CANVAS_ITEM (item); + cursor_window = ((GdkEventAny *) event)->window; switch (event->type) { @@ -2590,12 +2597,13 @@ { cursor = gdk_cursor_new_for_display (gdk_display_get_default(), GDK_HAND2); - gdk_window_set_cursor (((GdkEventAny *)event)->window, cursor); + gdk_window_set_cursor (cursor_window, cursor); #if GTK_CHECK_VERSION(3,0,0) g_object_unref (cursor); #else gdk_cursor_unref (cursor); #endif + icon_item->details->cursor_window = g_object_ref (cursor_window); } /* FIXME bugzilla.gnome.org 42473: @@ -2642,7 +2650,8 @@ eel_canvas_item_request_update (item); /* show default cursor */ - gdk_window_set_cursor (((GdkEventAny *)event)->window, NULL); + gdk_window_set_cursor (cursor_window, NULL); + g_clear_object (&icon_item->details->cursor_window); } return TRUE; @@ -3977,16 +3986,16 @@ } typedef struct { - AtkGObjectAccessible parent; + EelCanvasItemAccessible parent; } CajaIconCanvasItemAccessible; typedef struct { - AtkGObjectAccessibleClass parent_class; + EelCanvasItemAccessibleClass parent_class; } CajaIconCanvasItemAccessibleClass; G_DEFINE_TYPE_WITH_CODE (CajaIconCanvasItemAccessible, caja_icon_canvas_item_accessible, - ATK_TYPE_GOBJECT_ACCESSIBLE, + eel_canvas_item_accessible_get_type (), G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, caja_icon_canvas_item_accessible_image_interface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, @@ -4118,6 +4127,8 @@ } if (item->details->additional_text) { + if (item_text->len > 0) + g_string_append_c (item_text, ' '); g_string_append (item_text, item->details->additional_text); } item->details->text_util = gail_text_util_new (); diff -Nru caja-1.16.3/libcaja-private/caja-icon-container.c caja-1.16.9/libcaja-private/caja-icon-container.c --- caja-1.16.3/libcaja-private/caja-icon-container.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-icon-container.c 2017-05-08 10:34:20.000000000 +0000 @@ -220,8 +220,10 @@ gboolean commit); static CajaIcon *get_icon_being_renamed (CajaIconContainer *container); static void finish_adding_new_icons (CajaIconContainer *container); +#if !GTK_CHECK_VERSION(3,0,0) static void update_label_color (EelBackground *background, CajaIconContainer *icon_container); +#endif static inline void icon_get_bounding_box (CajaIcon *icon, int *x1_return, int *y1_return, @@ -914,10 +916,10 @@ } static void inline -emit_atk_focus_tracker_notify (CajaIcon *icon) +emit_atk_focus_state_change (CajaIcon *icon, gboolean focused) { AtkObject *atk_object = atk_gobject_accessible_for_object (G_OBJECT (icon->item)); - atk_focus_tracker_notify (atk_object); + atk_object_notify_state_change (atk_object, ATK_STATE_FOCUSED, focused); } /* Set @icon as the icon currently selected for keyboard operations. */ @@ -940,7 +942,7 @@ "highlighted_as_keyboard_focus", 1, NULL); - emit_atk_focus_tracker_notify (icon); + emit_atk_focus_state_change (icon, TRUE); } static void @@ -2621,7 +2623,7 @@ if (selection_changed && icon2 != NULL) { - emit_atk_focus_tracker_notify (icon2); + emit_atk_focus_state_change (icon2, TRUE); } return selection_changed; } @@ -2647,7 +2649,7 @@ if (selection_changed && icon_to_select != NULL) { - emit_atk_focus_tracker_notify (icon_to_select); + emit_atk_focus_state_change (icon_to_select, TRUE); reveal_icon (container, icon_to_select); } return selection_changed; @@ -4137,7 +4139,7 @@ IsBetterIconFunction better_start, IsBetterIconFunction empty_start, IsBetterIconFunction better_destination, - IsBetterIconFunction better_destination_fallback_if_no_a11y, + IsBetterIconFunction better_destination_fallback, IsBetterIconFunction better_destination_fallback_fallback, IsBetterIconFunction better_destination_manual) { @@ -4194,16 +4196,12 @@ container->details->auto_layout ? better_destination : better_destination_manual, &data); - /* only wrap around to next/previous row/column if no a11y is used. - * Visually impaired people may be easily confused by this. - */ + /* Wrap around to next/previous row/column */ if (to == NULL && - better_destination_fallback_if_no_a11y != NULL && - ATK_IS_NO_OP_OBJECT (gtk_widget_get_accessible (GTK_WIDGET (container)))) - { + better_destination_fallback != NULL) { to = find_best_icon (container, from, - better_destination_fallback_if_no_a11y, + better_destination_fallback, &data); } @@ -4255,15 +4253,15 @@ keyboard_right (CajaIconContainer *container, GdkEventKey *event) { - IsBetterIconFunction no_a11y; + IsBetterIconFunction fallback; IsBetterIconFunction next_column_fallback; - no_a11y = NULL; + fallback = NULL; if (container->details->auto_layout && !caja_icon_container_is_layout_vertical (container) && !is_rectangle_selection_event (event)) { - no_a11y = next_row_leftmost; + fallback = next_row_leftmost; } next_column_fallback = NULL; @@ -4283,7 +4281,7 @@ caja_icon_container_is_layout_rtl (container) ? rightmost_in_top_row : leftmost_in_top_row, same_row_right_side_leftmost, - no_a11y, + fallback, next_column_fallback, closest_in_90_degrees); } @@ -4292,15 +4290,15 @@ keyboard_left (CajaIconContainer *container, GdkEventKey *event) { - IsBetterIconFunction no_a11y; + IsBetterIconFunction fallback; IsBetterIconFunction previous_column_fallback; - no_a11y = NULL; + fallback = NULL; if (container->details->auto_layout && !caja_icon_container_is_layout_vertical (container) && !is_rectangle_selection_event (event)) { - no_a11y = previous_row_rightmost; + fallback = previous_row_rightmost; } previous_column_fallback = NULL; @@ -4320,7 +4318,7 @@ caja_icon_container_is_layout_rtl (container) ? rightmost_in_top_row : leftmost_in_top_row, same_row_left_side_rightmost, - no_a11y, + fallback, previous_column_fallback, closest_in_90_degrees); } @@ -4329,21 +4327,21 @@ keyboard_down (CajaIconContainer *container, GdkEventKey *event) { - IsBetterIconFunction no_a11y; + IsBetterIconFunction fallback; IsBetterIconFunction next_row_fallback; - no_a11y = NULL; + fallback = NULL; if (container->details->auto_layout && caja_icon_container_is_layout_vertical (container) && !is_rectangle_selection_event (event)) { if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL) { - no_a11y = previous_column_highest; + fallback = previous_column_highest; } else { - no_a11y = next_column_highest; + fallback = next_column_highest; } } @@ -4370,7 +4368,7 @@ caja_icon_container_is_layout_rtl (container) ? rightmost_in_top_row : leftmost_in_top_row, same_column_below_highest, - no_a11y, + fallback, next_row_fallback, closest_in_90_degrees); } @@ -4379,20 +4377,20 @@ keyboard_up (CajaIconContainer *container, GdkEventKey *event) { - IsBetterIconFunction no_a11y; + IsBetterIconFunction fallback; - no_a11y = NULL; + fallback = NULL; if (container->details->auto_layout && caja_icon_container_is_layout_vertical (container) && !is_rectangle_selection_event (event)) { if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL) { - no_a11y = next_column_bottommost; + fallback = next_column_bottommost; } else { - no_a11y = previous_column_lowest; + fallback = previous_column_lowest; } } @@ -4406,7 +4404,7 @@ caja_icon_container_is_layout_rtl (container) ? rightmost_in_top_row : leftmost_in_top_row, same_column_above_lowest, - no_a11y, + fallback, NULL, closest_in_90_degrees); } @@ -4702,6 +4700,81 @@ } } +#if GTK_CHECK_VERSION (3, 0, 0) +static GtkSizeRequestMode +get_request_mode (GtkWidget *widget) +{ + /* Don't trade size at all, since we get whatever we get anyway. */ + return GTK_SIZE_REQUEST_CONSTANT_SIZE; +} + + /* We need to implement these since the GtkScrolledWindow uses them + to guess whether to show scrollbars or not, and if we don't report + anything it'll tend to get it wrong causing double calls + to size_allocate (at different sizes) during its size allocation. */ +static void +get_prefered_width (GtkWidget *widget, + gint *minimum_size, + gint *natural_size) +{ + EelCanvasGroup *root; + double x1, x2; + int cx1, cx2; + int width; + + root = eel_canvas_root (EEL_CANVAS (widget)); + eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (root), + &x1, NULL, &x2, NULL); + eel_canvas_w2c (EEL_CANVAS (widget), x1, 0, &cx1, NULL); + eel_canvas_w2c (EEL_CANVAS (widget), x2, 0, &cx2, NULL); + + width = cx2 - cx1; + if (natural_size) { + *natural_size = width; + } + if (minimum_size) { + *minimum_size = width; + } +} + +static void +get_prefered_height (GtkWidget *widget, + gint *minimum_size, + gint *natural_size) +{ + EelCanvasGroup *root; + double y1, y2; + int cy1, cy2; + int height; + + root = eel_canvas_root (EEL_CANVAS (widget)); + eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (root), + NULL, &y1, NULL, &y2); + eel_canvas_w2c (EEL_CANVAS (widget), 0, y1, NULL, &cy1); + eel_canvas_w2c (EEL_CANVAS (widget), 0, y2, NULL, &cy2); + + height = cy2 - cy1; + if (natural_size) { + *natural_size = height; + } + if (minimum_size) { + *minimum_size = height; + } +} + +static gboolean +draw (GtkWidget *widget, cairo_t *cr) +{ + if (!CAJA_ICON_CONTAINER (widget)->details->is_desktop) + { + eel_background_draw (widget, cr); + } + + return GTK_WIDGET_CLASS (caja_icon_container_parent_class)->draw (widget, + cr); +} +#endif + static void realize (GtkWidget *widget) { @@ -4711,8 +4784,7 @@ GTK_WIDGET_CLASS (caja_icon_container_parent_class)->realize (widget); container = CAJA_ICON_CONTAINER (widget); - /* Unless GTK 3.21 or later is in use and the desktop must be transparent*/ -#if !GTK_CHECK_VERSION(3, 21, 0) +#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) @@ -6289,7 +6361,6 @@ return TRUE; } -#if !GTK_CHECK_VERSION(3, 21, 0) static void draw_canvas_background (EelCanvas *canvas, #if GTK_CHECK_VERSION(3,0,0) @@ -6300,22 +6371,7 @@ { /* Don't chain up to the parent to avoid clearing and redrawing */ } -#endif - -#if !GTK_CHECK_VERSION(3,0,0) -static gboolean -expose_event (GtkWidget *widget, - GdkEventExpose *event) -{ - /* g_warning ("Expose Icon Container %p '%d,%d: %d,%d'", - widget, - event->area.x, event->area.y, - event->area.width, event->area.height); */ - - return GTK_WIDGET_CLASS (caja_icon_container_parent_class)->expose_event (widget, event); -} -#endif #if !GTK_CHECK_VERSION(3, 0, 0) static AtkObject * @@ -6770,6 +6826,12 @@ widget_class = GTK_WIDGET_CLASS (class); widget_class->size_allocate = size_allocate; +#if GTK_CHECK_VERSION (3, 0, 0) + widget_class->get_request_mode = get_request_mode; + widget_class->get_preferred_width = get_prefered_width; + widget_class->get_preferred_height = get_prefered_height; + widget_class->draw = draw; +#endif widget_class->realize = realize; widget_class->unrealize = unrealize; widget_class->button_press_event = button_press_event; @@ -6786,14 +6848,11 @@ widget_class->style_updated = style_updated; #else widget_class->style_set = style_set; - widget_class->expose_event = expose_event; #endif widget_class->grab_notify = grab_notify_cb; canvas_class = EEL_CANVAS_CLASS (class); -#if !GTK_CHECK_VERSION(3, 21, 0) canvas_class->draw_background = draw_canvas_background; -#endif class->start_interactive_search = caja_icon_container_start_interactive_search; #if GTK_CHECK_VERSION(3,0,0) diff -Nru caja-1.16.3/libcaja-private/caja-mime-actions.c caja-1.16.9/libcaja-private/caja-mime-actions.c --- caja-1.16.3/libcaja-private/caja-mime-actions.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-mime-actions.c 2017-05-08 10:34:20.000000000 +0000 @@ -860,9 +860,7 @@ gboolean caja_mime_file_opens_in_view (CajaFile *file) { - return (caja_file_is_directory (file) || - CAJA_IS_DESKTOP_ICON_FILE (file) || - caja_file_is_caja_link (file)); + return (caja_file_is_directory (file)); } static ActivationAction @@ -871,7 +869,7 @@ ActivationAction action; char *activation_uri; - if (caja_file_is_launcher (file)) + if (caja_file_is_caja_link (file)) { return ACTIVATION_ACTION_LAUNCH_DESKTOP_FILE; } diff -Nru caja-1.16.3/libcaja-private/caja-open-with-dialog.c caja-1.16.9/libcaja-private/caja-open-with-dialog.c --- caja-1.16.3/libcaja-private/caja-open-with-dialog.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/libcaja-private/caja-open-with-dialog.c 2017-05-08 10:34:20.000000000 +0000 @@ -531,7 +531,7 @@ *p = 0; } pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), - icon_no_extension, 24, 0, NULL); + icon_no_extension, 24, GTK_ICON_LOOKUP_FORCE_SIZE, NULL); g_free (icon_no_extension); } } diff -Nru caja-1.16.3/NEWS caja-1.16.9/NEWS --- caja-1.16.3/NEWS 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/NEWS 2017-05-08 10:34:20.000000000 +0000 @@ -1,3 +1,45 @@ +Major changes in 1.16.6 are: +* Show correct right-click menu after making file/folder selection +* Make custom icons (like folder-color extension) work in list view +* Open With dialog: force icon size to avoid huge icons with GTK+3 +* Load different CSS for desktop with GTK+ 3.14 (fixes black text + under desktop icons with some themes like Adwaita) + +Major changes in 1.16.5 are: +* icon and compact view: fix scrolling and renaming in large folders +* IconCanvasItem: fix overlapping filenames on hover + +Major changes in 1.16.4 are: +* Fix broken directory background in GTK+2 build (regression in 1.16.3) + +Major changes in 1.16.3 are: +* Build: require libmate-desktop >= 1.16.2 +* Add ability to get feedback from Orca when additional icons are + selected/deselected +* Restore "Open with other application" menu entry for directories + (regression in 1.16.2) +* Fix crossfade issues with recent GTK+3 versions +* Fix more graphics issues to allow Caja to use background for + directory windows in GTK+3 build +* GTK+3: fix broken rename in list view after keyboard navigation +* GTK+3: property-browser: add style class frame to scrolledwindows + +Major changes in 1.16.2 are: +* List view: show/hide columns instead of appending/removing them + (fixes crash when moving between trash and other folder with GTK+3) +* Icon view: fix accessibility issues +* Icon and compact views: fix moving to next/previous row (or column) + with right/left (or down/up) keys +* Prefs dialog: fix vertical expand of content with window resize +* Show "Open with" menu item and "Open with" tab in properties window + for .desktop and .theme files +* Fix cursor refresh issues on folder change in single click mode +* Fix runtime warnings on window closing and Caja exit +* GTK+3: fix mousewheel scrolling in compact view +* GTK+3: fix visual issues when renaming files +* GTK+3: force X11 backend +* Some more fixes and cleanups + Major changes in 1.16.1 are: * Fix regression that sometimes caused visual glitches when selecting icons diff -Nru caja-1.16.3/src/caja-application.c caja-1.16.9/src/caja-application.c --- caja-1.16.3/src/caja-application.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-application.c 2017-05-08 10:34:20.000000000 +0000 @@ -1022,17 +1022,36 @@ GtkCssProvider *provider; GError *error = NULL; + /* add our custom CSS provider */ provider = gtk_css_provider_new (); gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja.css", &error); if (error != NULL) { - g_warning ("Failed to load application css file: %s", error->message); - g_error_free (error); + g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message); + g_error_free (error); } else { - gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), - GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_THEME); + } + +/* add our desktop CSS provider, ensures the desktop background does not get covered */ + provider = gtk_css_provider_new (); + +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop.css", &error); +#else + gtk_css_provider_load_from_path (provider, CAJA_DATADIR G_DIR_SEPARATOR_S "caja-desktop-3.14.css", &error); +#endif + + if (error != NULL) { + g_warning ("Can't parse Caja' CSS custom description: %s\n", error->message); + g_error_free (error); + } else { + gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } g_object_unref (provider); diff -Nru caja-1.16.3/src/caja-desktop-window.c caja-1.16.9/src/caja-desktop-window.c --- caja-1.16.3/src/caja-desktop-window.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-desktop-window.c 2017-05-08 10:34:20.000000000 +0000 @@ -30,133 +30,23 @@ #include #include #include +#include #include #include #include #include #include -#if GTK_CHECK_VERSION(3, 21, 0) -#define MATE_DESKTOP_USE_UNSTABLE_API -#include -#endif struct CajaDesktopWindowDetails { gulong size_changed_id; gboolean loaded; -#if GTK_CHECK_VERSION(3, 21, 0) - gboolean composited; - cairo_surface_t *surface; -#endif }; G_DEFINE_TYPE (CajaDesktopWindow, caja_desktop_window, CAJA_TYPE_SPATIAL_WINDOW); -#if GTK_CHECK_VERSION(3, 21, 0) - -static void -background_changed (CajaDesktopWindow *window) -{ - GdkScreen *screen = gdk_screen_get_default (); - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - } - - window->details->surface = mate_bg_get_surface_from_root (screen); - gtk_widget_queue_draw (GTK_WIDGET (window)); -} - -static GdkFilterReturn -filter_func (GdkXEvent *xevent, - GdkEvent *event, - CajaDesktopWindow *window) -{ - XEvent *xev = (XEvent *) xevent; - GdkAtom gdkatom; - - if (xev->type != PropertyNotify) { - return GDK_FILTER_CONTINUE; - } - - gdkatom = gdk_atom_intern_static_string ("_XROOTPMAP_ID"); - if (xev->xproperty.atom != gdk_x11_atom_to_xatom (gdkatom)) { - return GDK_FILTER_CONTINUE; - } - - background_changed (window); - - return GDK_FILTER_CONTINUE; -} - -static void -caja_desktop_window_composited_changed (GtkWidget *widget) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (widget); - GdkScreen *screen = gdk_screen_get_default (); - gboolean composited = gdk_screen_is_composited (screen); - GdkWindow *root; - - if (window->details->composited == composited) { - return; - } - - window->details->composited = composited; - root = gdk_screen_get_root_window (screen); - - if (composited) { - gdk_window_remove_filter (root, (GdkFilterFunc) filter_func, window); - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - window->details->surface = NULL; - } - } else { - gint events = gdk_window_get_events (root); - - gdk_window_set_events (root, events | GDK_PROPERTY_CHANGE_MASK); - gdk_window_add_filter (root, (GdkFilterFunc) filter_func, window); - background_changed (window); - } -} - -static gboolean -caja_desktop_window_draw (GtkWidget *widget, - cairo_t *cr) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (widget); - - if (window->details->surface) { - cairo_set_source_surface (cr, window->details->surface, 0, 0); - cairo_paint (cr); - } - - return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr); -} - -static void -caja_desktop_window_finalize (GObject *obj) -{ - CajaDesktopWindow *window = CAJA_DESKTOP_WINDOW (obj); - - if (window->details->composited == FALSE) { - GdkScreen *screen = gdk_screen_get_default (); - GdkWindow *root = gdk_screen_get_root_window (screen); - - gdk_window_remove_filter (root, (GdkFilterFunc) filter_func, window); - } - - if (window->details->surface) { - cairo_surface_destroy (window->details->surface); - window->details->surface = NULL; - } - - G_OBJECT_CLASS (caja_desktop_window_parent_class)->finalize (obj); -} -#endif - static void caja_desktop_window_init (CajaDesktopWindow *window) { @@ -173,11 +63,6 @@ gtk_style_context_add_class (context, "caja-desktop-window"); #endif -#if GTK_CHECK_VERSION(3, 21, 0) - window->details->composited = TRUE; - caja_desktop_window_composited_changed (GTK_WIDGET (window)); -#endif - gtk_window_move (GTK_WINDOW (window), 0, 0); /* shouldn't really be needed given our semantic type @@ -283,13 +168,6 @@ /* Chain up to realize our children */ GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->map (widget); gdk_window_lower (gtk_widget_get_window (widget)); -#if GTK_CHECK_VERSION(3, 21, 0) - GdkWindow *window; - GdkRGBA transparent = { 0, 0, 0, 0 }; - - window = gtk_widget_get_window (widget); - gdk_window_set_background_rgba (window, &transparent); -#endif } static void @@ -359,21 +237,12 @@ { CajaDesktopWindow *window; CajaDesktopWindowDetails *details; -#if GTK_CHECK_VERSION(3, 21, 0) - GdkVisual *visual; -#endif window = CAJA_DESKTOP_WINDOW (widget); details = window->details; /* Make sure we get keyboard events */ gtk_widget_set_events (widget, gtk_widget_get_events (widget) | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); -#if GTK_CHECK_VERSION(3, 21, 0) - visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)); - if (visual) { - gtk_widget_set_visual (widget, visual); - } -#endif /* Do the work of realizing. */ GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->realize (widget); @@ -387,6 +256,17 @@ G_CALLBACK (caja_desktop_window_screen_size_changed), window); } +#if GTK_CHECK_VERSION (3, 22, 0) +static gboolean +draw (GtkWidget *widget, + cairo_t *cr) +{ + eel_background_draw (widget, cr); + + return GTK_WIDGET_CLASS (caja_desktop_window_parent_class)->draw (widget, cr); +} +#endif + static char * real_get_title (CajaWindow *window) { @@ -405,18 +285,12 @@ { GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass); CajaWindowClass *nclass = CAJA_WINDOW_CLASS (klass); -#if GTK_CHECK_VERSION(3, 21, 0) - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = caja_desktop_window_finalize; -#endif wclass->realize = realize; wclass->unrealize = unrealize; wclass->map = map; -#if GTK_CHECK_VERSION(3, 21, 0) - wclass->composited_changed = caja_desktop_window_composited_changed; - wclass->draw = caja_desktop_window_draw; +#if GTK_CHECK_VERSION (3, 22, 0) + wclass->draw = draw; #endif nclass->window_type = CAJA_WINDOW_DESKTOP; nclass->get_title = real_get_title; diff -Nru caja-1.16.3/src/caja-file-management-properties.ui caja-1.16.9/src/caja-file-management-properties.ui --- caja-1.16.3/src/caja-file-management-properties.ui 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-file-management-properties.ui 2017-05-08 10:34:20.000000000 +0000 @@ -2538,7 +2538,7 @@ - False + True True 1 diff -Nru caja-1.16.3/src/caja-main.c caja-1.16.9/src/caja-main.c --- caja-1.16.3/src/caja-main.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-main.c 2017-05-08 10:34:20.000000000 +0000 @@ -438,6 +438,10 @@ g_set_prgname ("caja"); +#if GTK_CHECK_VERSION(3, 0, 0) + gdk_set_allowed_backends ("x11"); +#endif + if (g_file_test (DATADIR "/applications/caja.desktop", G_FILE_TEST_EXISTS)) { egg_set_desktop_file (DATADIR "/applications/caja.desktop"); diff -Nru caja-1.16.3/src/caja-property-browser.c caja-1.16.9/src/caja-property-browser.c --- caja-1.16.3/src/caja-property-browser.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-property-browser.c 2017-05-08 10:34:20.000000000 +0000 @@ -2238,6 +2238,9 @@ gboolean got_categories; char *name, *image, *type, *description, *display_name, *path, *mode; const char *text; +#if GTK_CHECK_VERSION (3, 0, 0) + GtkStyleContext *context; +#endif /* load the xml document corresponding to the path and selection */ document = read_browser_xml (property_browser); @@ -2255,6 +2258,8 @@ /* allocate a new container, with a scrollwindow and viewport */ property_browser->details->content_frame = gtk_scrolled_window_new (NULL, NULL); #if GTK_CHECK_VERSION (3, 0, 0) + context = gtk_widget_get_style_context (property_browser->details->content_frame); + gtk_style_context_add_class (context, "frame"); gtk_widget_set_vexpand (property_browser->details->content_frame, TRUE); #endif viewport = gtk_viewport_new (NULL, NULL); diff -Nru caja-1.16.3/src/caja-sidebar-title.c caja-1.16.9/src/caja-sidebar-title.c --- caja-1.16.3/src/caja-sidebar-title.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-sidebar-title.c 2017-05-08 10:34:20.000000000 +0000 @@ -212,8 +212,11 @@ { if (sidebar_title->details->file_changed_connection != 0) { - g_signal_handler_disconnect (sidebar_title->details->file, + if (g_signal_handler_is_connected(G_OBJECT (sidebar_title->details->file), + sidebar_title->details->file_changed_connection)){ + g_signal_handler_disconnect (sidebar_title->details->file, sidebar_title->details->file_changed_connection); + } sidebar_title->details->file_changed_connection = 0; } diff -Nru caja-1.16.3/src/caja-window-menus.c caja-1.16.9/src/caja-window-menus.c --- caja-1.16.3/src/caja-window-menus.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/caja-window-menus.c 2017-05-08 10:34:20.000000000 +0000 @@ -98,8 +98,11 @@ static void bookmark_holder_free (BookmarkHolder *bookmark_holder) { + if (g_signal_handler_is_connected(bookmark_holder->bookmark, + bookmark_holder->changed_handler_id)){ g_signal_handler_disconnect (bookmark_holder->bookmark, - bookmark_holder->changed_handler_id); + bookmark_holder->changed_handler_id); + } g_object_unref (bookmark_holder->bookmark); g_free (bookmark_holder); } diff -Nru caja-1.16.3/src/file-manager/fm-desktop-icon-view.c caja-1.16.9/src/file-manager/fm-desktop-icon-view.c --- caja-1.16.3/src/file-manager/fm-desktop-icon-view.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/file-manager/fm-desktop-icon-view.c 2017-05-08 10:34:20.000000000 +0000 @@ -38,9 +38,7 @@ #include #include #include -#if !GTK_CHECK_VERSION(3, 21, 0) #include -#endif #include #include #include diff -Nru caja-1.16.3/src/file-manager/fm-directory-view.c caja-1.16.9/src/file-manager/fm-directory-view.c --- caja-1.16.3/src/file-manager/fm-directory-view.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/file-manager/fm-directory-view.c 2017-05-08 10:34:20.000000000 +0000 @@ -61,9 +61,7 @@ #include #include #include -#if !GTK_CHECK_VERSION(3, 21, 0) #include -#endif #include #include #include @@ -423,9 +421,7 @@ EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, can_zoom_out) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, clear) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, file_changed) -#if !GTK_CHECK_VERSION(3, 21, 0) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_background_widget) -#endif EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_selection) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_selection_for_file_transfer) EEL_IMPLEMENT_MUST_OVERRIDE_SIGNAL (fm_directory_view, get_item_count) @@ -3692,7 +3688,6 @@ can_zoom_out, (view)); } -#if !GTK_CHECK_VERSION(3, 21, 0) GtkWidget * fm_directory_view_get_background_widget (FMDirectoryView *view) { @@ -3718,7 +3713,7 @@ bg = fm_directory_view_get_background (view); eel_background_set_active (bg, is_active); } -#endif + static void fm_directory_view_set_is_active (FMDirectoryView *view, gboolean is_active) @@ -4783,15 +4778,6 @@ other_applications_visible = (selection != NULL); filter_default = (selection != NULL); - for (node = selection; node != NULL; node = node->next) { - - file = CAJA_FILE (node->data); - - other_applications_visible &= - (!caja_mime_file_opens_in_view (file) || - caja_file_is_directory (file)); - } - default_app = NULL; if (filter_default) { default_app = caja_mime_get_default_application_for_files (selection); @@ -7754,11 +7740,9 @@ ui = caja_ui_string_get ("caja-directory-view-ui.xml"); view->details->dir_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, NULL); -#if !GTK_CHECK_VERSION(3, 21, 0) g_signal_connect_object (fm_directory_view_get_background (view), "settings_changed", G_CALLBACK (schedule_update_menus), G_OBJECT (view), G_CONNECT_SWAPPED); -#endif view->details->scripts_invalid = TRUE; view->details->templates_invalid = TRUE; } @@ -11114,12 +11098,10 @@ klass->supports_properties = real_supports_properties; klass->supports_zooming = real_supports_zooming; klass->using_manual_layout = real_using_manual_layout; - klass->merge_menus = real_merge_menus; - klass->unmerge_menus = real_unmerge_menus; - klass->update_menus = real_update_menus; -#if !GTK_CHECK_VERSION(3, 21, 0) - klass->set_is_active = real_set_is_active; -#endif + klass->merge_menus = real_merge_menus; + klass->unmerge_menus = real_unmerge_menus; + klass->update_menus = real_update_menus; + klass->set_is_active = real_set_is_active; /* Function pointers that subclasses must override */ EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, add_file); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, bump_zoom_level); @@ -11127,9 +11109,7 @@ EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, can_zoom_out); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, clear); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, file_changed); -#if !GTK_CHECK_VERSION(3, 21, 0) - EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_background_widget); -#endif + EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_background_widget); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_selection); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_selection_for_file_transfer); EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, fm_directory_view, get_item_count); diff -Nru caja-1.16.3/src/file-manager/fm-icon-view.c caja-1.16.9/src/file-manager/fm-icon-view.c --- caja-1.16.3/src/file-manager/fm-icon-view.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/file-manager/fm-icon-view.c 2017-05-08 10:34:20.000000000 +0000 @@ -30,9 +30,7 @@ #include "fm-desktop-icon-view.h" #include "fm-error-reporting.h" #include -#if !GTK_CHECK_VERSION(3, 21, 0) #include -#endif #include #include #include @@ -45,9 +43,7 @@ #include #include #include -#if !GTK_CHECK_VERSION(3, 21, 0) #include -#endif #include #include #include @@ -1281,7 +1277,6 @@ /* kill any sound preview process that is ongoing */ preview_audio (icon_view, NULL, FALSE); -#if !GTK_CHECK_VERSION(3, 21, 0) /* FIXME bugzilla.gnome.org 45060: Should use methods instead * of hardcoding desktop knowledge in here. */ @@ -1305,7 +1300,6 @@ caja_connect_background_to_file_metadata (icon_container, file, default_action); } -#endif /* Set up the zoom level from the metadata. */ if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) { @@ -1511,7 +1505,6 @@ > CAJA_ZOOM_LEVEL_SMALLEST; } -#if !GTK_CHECK_VERSION(3, 21, 0) static GtkWidget * fm_icon_view_get_background_widget (FMDirectoryView *view) { @@ -1519,7 +1512,6 @@ return GTK_WIDGET (get_icon_container (FM_ICON_VIEW (view))); } -#endif static gboolean fm_icon_view_is_empty (FMDirectoryView *view) @@ -2494,6 +2486,30 @@ icon_view = FM_ICON_VIEW (widget); +#if GTK_CHECK_VERSION (3, 0, 0) + if (icon_view->details->compact && + (scroll_event->direction == GDK_SCROLL_UP || + scroll_event->direction == GDK_SCROLL_DOWN || + scroll_event->direction == GDK_SCROLL_SMOOTH)) { + ret = fm_directory_view_handle_scroll_event (FM_DIRECTORY_VIEW (icon_view), scroll_event); + if (!ret) + { + /* in column-wise layout, re-emit vertical mouse scroll events as horizontal ones, + * if they don't bump zoom */ + event_copy = gdk_event_copy ((GdkEvent *) scroll_event); + + scroll_event_copy = (GdkEventScroll *) event_copy; + + /* transform vertical integer smooth scroll events into horizontal events */ + if (scroll_event_copy->direction == GDK_SCROLL_SMOOTH && scroll_event_copy->delta_x == 0) { + if (scroll_event_copy->delta_y == 1.0) { + scroll_event_copy->direction = GDK_SCROLL_DOWN; + } else if (scroll_event_copy->delta_y == -1.0) { + scroll_event_copy->direction = GDK_SCROLL_UP; + } + } + if ((scroll_event_copy->direction == GDK_SCROLL_UP) || (scroll_event_copy->delta_x == -1.0)) +#else if (icon_view->details->compact && (scroll_event->direction == GDK_SCROLL_UP || scroll_event->direction == GDK_SCROLL_DOWN)) @@ -2507,6 +2523,7 @@ scroll_event_copy = (GdkEventScroll *) event_copy; if (scroll_event_copy->direction == GDK_SCROLL_UP) +#endif { scroll_event_copy->direction = GDK_SCROLL_LEFT; } @@ -3174,9 +3191,7 @@ fm_directory_view_class->clear = fm_icon_view_clear; fm_directory_view_class->end_loading = fm_icon_view_end_loading; fm_directory_view_class->file_changed = fm_icon_view_file_changed; -#if !GTK_CHECK_VERSION(3, 21, 0) fm_directory_view_class->get_background_widget = fm_icon_view_get_background_widget; -#endif fm_directory_view_class->get_selected_icon_locations = fm_icon_view_get_selected_icon_locations; fm_directory_view_class->get_selection = fm_icon_view_get_selection; fm_directory_view_class->get_selection_for_file_transfer = fm_icon_view_get_selection; diff -Nru caja-1.16.3/src/file-manager/fm-list-view.c caja-1.16.9/src/file-manager/fm-list-view.c --- caja-1.16.3/src/file-manager/fm-list-view.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/file-manager/fm-list-view.c 2017-05-08 10:34:20.000000000 +0000 @@ -47,9 +47,7 @@ #include #include #include -#if !GTK_CHECK_VERSION(3, 21, 0) #include -#endif #include #include #include @@ -1541,27 +1539,22 @@ view_columns = g_list_reverse (view_columns); - /* remove columns that are not present in the configuration */ + /* hide columns that are not present in the configuration */ old_view_columns = gtk_tree_view_get_columns (list_view->details->tree_view); for (l = old_view_columns; l != NULL; l = l->next) { if (g_list_find (view_columns, l->data) == NULL) { - gtk_tree_view_remove_column (list_view->details->tree_view, l->data); + gtk_tree_view_column_set_visible (l->data, FALSE); } } g_list_free (old_view_columns); - /* append new columns from the configuration */ - old_view_columns = gtk_tree_view_get_columns (list_view->details->tree_view); + /* show new columns from the configuration */ for (l = view_columns; l != NULL; l = l->next) { - if (g_list_find (old_view_columns, l->data) == NULL) - { - gtk_tree_view_append_column (list_view->details->tree_view, l->data); - } + gtk_tree_view_column_set_visible (l->data, TRUE); } - g_list_free (old_view_columns); /* place columns in the correct order */ prev_view_column = NULL; @@ -1643,7 +1636,7 @@ view->details->columns = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, - (GDestroyNotify) g_object_unref); + NULL); gtk_tree_view_set_enable_search (view->details->tree_view, TRUE); /* Don't handle backspace key. It's used to open the parent folder. */ @@ -1762,7 +1755,7 @@ font_size = PANGO_PIXELS (pango_font_description_get_size (gtk_widget_get_style (GTK_WIDGET(view))->font_desc)); #endif gtk_tree_view_column_set_min_width (view->details->file_name_column, 20*font_size); - g_object_ref_sink (view->details->file_name_column); + gtk_tree_view_append_column (view->details->tree_view, view->details->file_name_column); view->details->file_name_column_num = column_num; g_hash_table_insert (view->details->columns, @@ -1806,14 +1799,13 @@ cell, "text", column_num, NULL); - g_object_ref_sink (column); + gtk_tree_view_append_column (view->details->tree_view, column); gtk_tree_view_column_set_sort_column_id (column, column_num); g_hash_table_insert (view->details->columns, g_strdup (name), column); gtk_tree_view_column_set_resizable (column, TRUE); - gtk_tree_view_column_set_visible (column, TRUE); } g_free (name); g_free (label); @@ -2127,13 +2119,11 @@ } } -#if !GTK_CHECK_VERSION(3, 21, 0) static GtkWidget * fm_list_view_get_background_widget (FMDirectoryView *view) { return GTK_WIDGET (view); } -#endif static void fm_list_view_get_selection_foreach_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) @@ -2918,9 +2908,10 @@ NULL, list_view->details->file_name_column, TRUE, 0.0, 0.0); - gtk_tree_view_set_cursor (list_view->details->tree_view, + gtk_tree_view_set_cursor_on_cell (list_view->details->tree_view, path, list_view->details->file_name_column, + GTK_CELL_RENDERER (list_view->details->file_name_cell), TRUE); /* set cursor also triggers editing-started, where we save the editable widget */ @@ -3335,9 +3326,7 @@ fm_directory_view_class->click_policy_changed = fm_list_view_click_policy_changed; fm_directory_view_class->clear = fm_list_view_clear; fm_directory_view_class->file_changed = fm_list_view_file_changed; -#if !GTK_CHECK_VERSION(3, 21, 0) fm_directory_view_class->get_background_widget = fm_list_view_get_background_widget; -#endif fm_directory_view_class->get_selection = fm_list_view_get_selection; fm_directory_view_class->get_selection_for_file_transfer = fm_list_view_get_selection_for_file_transfer; fm_directory_view_class->get_item_count = fm_list_view_get_item_count; diff -Nru caja-1.16.3/src/file-manager/fm-properties-window.c caja-1.16.9/src/file-manager/fm-properties-window.c --- caja-1.16.3/src/file-manager/fm-properties-window.c 2016-10-18 13:34:03.000000000 +0000 +++ caja-1.16.9/src/file-manager/fm-properties-window.c 2017-05-08 10:34:20.000000000 +0000 @@ -4011,7 +4011,7 @@ gtk_container_set_border_width (GTK_CONTAINER (emblems_table), 12); /*stop GTK 3.22 builds from ballooning the properties dialog to full screen height */ #if GTK_CHECK_VERSION(3,21,0) - gtk_scrolled_window_set_max_content_height(scroller, 300); + gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), 300); #endif gtk_widget_show (scroller); @@ -6068,7 +6068,6 @@ { if (file == NULL || CAJA_IS_DESKTOP_ICON_FILE (file) || - caja_file_is_caja_link (file) || is_merged_trash_directory (file) || is_computer_directory (file)) { return TRUE; @@ -6082,7 +6081,7 @@ CajaFile *file; /* Don't show open with tab for desktop special icons (trash, etc) - * or desktop files. We don't get the open-with menu for these anyway. + * We don't get the open-with menu for these anyway. * * Also don't show it for folders. Changing the default app for folders * leads to all sort of hard to understand errors.