diff options
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/Makefile.am | 4 | ||||
-rw-r--r-- | libcaja-private/caja-cell-renderer-text-ellipsized.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-directory-background.c | 2 | ||||
-rw-r--r-- | libcaja-private/caja-file.c | 29 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-program-choosing.c | 34 | ||||
-rw-r--r-- | libcaja-private/caja-thumbnails.c | 2 | ||||
-rw-r--r-- | libcaja-private/caja-tree-view-drag-dest.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-ui-utilities.c | 9 | ||||
-rw-r--r-- | libcaja-private/caja-undostack-manager.h | 2 |
10 files changed, 71 insertions, 23 deletions
diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index 984c2fd4..b3bffb2f 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.shared noinst_LTLIBRARIES=libcaja-private.la -INCLUDES = \ +AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/cut-n-paste-code \ @@ -229,6 +229,7 @@ convert_DATA = caja.convert EXTRA_DIST = \ caja-marshal.list \ $(gsettingsschema_in_files) \ + $(convert_DATA) \ $(BEAGLE_SOURCES) \ $(TRACKER_SOURCES) \ $(NULL) @@ -237,7 +238,6 @@ CLEANFILES = \ $(BUILT_SOURCES) \ $(schema_DATA) \ $(gsettings_SCHEMAS) \ - $(convert_DATA) \ caja-marshal.list \ $(NULL) diff --git a/libcaja-private/caja-cell-renderer-text-ellipsized.c b/libcaja-private/caja-cell-renderer-text-ellipsized.c index ad535a5d..414bdc9d 100644 --- a/libcaja-private/caja-cell-renderer-text-ellipsized.c +++ b/libcaja-private/caja-cell-renderer-text-ellipsized.c @@ -40,7 +40,7 @@ caja_cell_renderer_text_ellipsized_init (CajaCellRendererTextEllipsized *cell) } static void -nautilus_cell_renderer_text_ellipsized_get_preferred_width (GtkCellRenderer *cell, +caja_cell_renderer_text_ellipsized_get_preferred_width (GtkCellRenderer *cell, GtkWidget *widget, gint *minimum_size, gint *natural_size) @@ -51,7 +51,7 @@ nautilus_cell_renderer_text_ellipsized_get_preferred_width (GtkCellRenderer *cel NULL); GTK_CELL_RENDERER_CLASS - (nautilus_cell_renderer_text_ellipsized_parent_class)->get_preferred_width (cell, widget, + (caja_cell_renderer_text_ellipsized_parent_class)->get_preferred_width (cell, widget, minimum_size, natural_size); g_object_set (cell, diff --git a/libcaja-private/caja-directory-background.c b/libcaja-private/caja-directory-background.c index 58e78d72..3d7441fc 100644 --- a/libcaja-private/caja-directory-background.c +++ b/libcaja-private/caja-directory-background.c @@ -39,7 +39,7 @@ #include <gtk/gtk.h> #include <string.h> #define MATE_DESKTOP_USE_UNSTABLE_API -#include <libmateui/mate-bg.h> +#include <libmate-desktop/mate-bg.h> static void caja_background_changed_cb (EelBackground *background, GdkDragAction action, diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 1958fafc..85f8a9ce 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -4276,7 +4276,9 @@ caja_file_get_icon (CajaFile *file, pixbuf = caja_icon_info_get_pixbuf (icon); if (pixbuf != NULL) { - caja_ui_frame_image (&pixbuf); + if (!file->details->is_launcher && !gdk_pixbuf_get_has_alpha (pixbuf)) { + caja_ui_frame_image (&pixbuf); + } g_object_unref (icon); icon = caja_icon_info_new_for_pixbuf (pixbuf); @@ -4320,7 +4322,14 @@ caja_file_get_icon (CajaFile *file, MAX (h * scale, 1), GDK_INTERP_BILINEAR); - caja_ui_frame_image (&scaled_pixbuf); + /* Render frames only for thumbnails of non-image files + and for images with no alpha channel. */ + gboolean is_image = strncmp(eel_ref_str_peek (file->details->mime_type), "image/", 6) == 0; + if (!is_image || + is_image && !gdk_pixbuf_get_has_alpha (raw_pixbuf)) { + caja_ui_frame_image (&scaled_pixbuf); + } + g_object_unref (raw_pixbuf); /* Don't scale up if more than 25%, then read the original @@ -7149,7 +7158,7 @@ caja_file_is_binary (CajaFile *file) gboolean is_binary = FALSE; int c; - int i; + int i = 0; FILE *fp; /* Check the first 4096 bytes of the files. If these contains a 0, @@ -7158,15 +7167,21 @@ caja_file_is_binary (CajaFile *file) */ fp = g_fopen (g_file_get_path (caja_file_get_location (file)), "r"); - for (i = 0; i < 4096; i++) { - c = fgetc(fp); - if (c == EOF) { + if (fp == NULL) + { + return FALSE; + } + + while (!feof (fp)) { + if (i > 4096) { break; } - else if (c == 0) { + c = fgetc(fp); + if (c == 0) { is_binary = TRUE; break; } + i++; } fclose(fp); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index e7c421c2..eb069406 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -4551,7 +4551,11 @@ realize (GtkWidget *widget) set on it is drawn by X. */ if (container->details->is_desktop) { +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_x11_window_get_xid (gtk_layout_get_bin_window (GTK_LAYOUT (widget))); +#else gdk_x11_drawable_get_xid (gtk_layout_get_bin_window (GTK_LAYOUT (widget))); +#endif } /* Set up DnD. */ diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c index bc9ee396..6971d2d9 100644 --- a/libcaja-private/caja-program-choosing.c +++ b/libcaja-private/caja-program-choosing.c @@ -322,7 +322,24 @@ caja_launch_application_from_command (GdkScreen *screen, } else { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkAppLaunchContext *launch_context; + GAppInfo *app_info = NULL; + app_info = g_app_info_create_from_commandline (full_command, + NULL, + G_APP_INFO_CREATE_NONE, + NULL); + if (app_info != NULL) + { + launch_context = gdk_app_launch_context_new (); + gdk_app_launch_context_set_screen (launch_context, screen); + g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), NULL); + g_object_unref (launch_context); + g_object_unref (app_info); + } +#else gdk_spawn_command_line_on_screen (screen, full_command, NULL); +#endif } g_free (full_command); @@ -370,7 +387,24 @@ caja_launch_application_from_command_array (GdkScreen *screen, } else { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkAppLaunchContext *launch_context; + GAppInfo *app_info = NULL; + app_info = g_app_info_create_from_commandline (full_command, + NULL, + G_APP_INFO_CREATE_NONE, + NULL); + if (app_info != NULL) + { + launch_context = gdk_app_launch_context_new (); + gdk_app_launch_context_set_screen (launch_context, screen); + g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (launch_context), NULL); + g_object_unref (launch_context); + g_object_unref (app_info); + } +#else gdk_spawn_command_line_on_screen (screen, full_command, NULL); +#endif } g_free (full_command); diff --git a/libcaja-private/caja-thumbnails.c b/libcaja-private/caja-thumbnails.c index cbb5f7dc..7e279858 100644 --- a/libcaja-private/caja-thumbnails.c +++ b/libcaja-private/caja-thumbnails.c @@ -45,7 +45,7 @@ #include <sys/wait.h> #include <unistd.h> #include <signal.h> -#include <libmateui/mate-desktop-thumbnail.h> +#include <libmate-desktop/mate-desktop-thumbnail.h> #include "caja-file-private.h" diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c index e1cb7bad..294d78a4 100644 --- a/libcaja-private/caja-tree-view-drag-dest.c +++ b/libcaja-private/caja-tree-view-drag-dest.c @@ -1045,7 +1045,11 @@ set_direct_save_uri (CajaTreeViewDragDest *dest, g_object_unref (child); /* Change the property */ +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_property_change (gdk_drag_context_get_source_window (context), +#else gdk_property_change (GDK_DRAWABLE (gdk_drag_context_get_source_window (context)), +#endif gdk_atom_intern (CAJA_ICON_DND_XDNDDIRECTSAVE_TYPE, FALSE), gdk_atom_intern ("text/plain", FALSE), 8, GDK_PROP_MODE_REPLACE, (const guchar *) uri, diff --git a/libcaja-private/caja-ui-utilities.c b/libcaja-private/caja-ui-utilities.c index 9732b6d9..8077e975 100644 --- a/libcaja-private/caja-ui-utilities.c +++ b/libcaja-private/caja-ui-utilities.c @@ -287,21 +287,12 @@ caja_ui_frame_image (GdkPixbuf **pixbuf) { GdkPixbuf *pixbuf_with_frame, *frame; int left_offset, top_offset, right_offset, bottom_offset; - int size; frame = caja_get_thumbnail_frame (); if (frame == NULL) { return; } - size = MAX (gdk_pixbuf_get_width (*pixbuf), - gdk_pixbuf_get_height (*pixbuf)); - - /* We don't want frames around small icons */ - if (size < 128 && gdk_pixbuf_get_has_alpha (*pixbuf)) { - return; - } - left_offset = CAJA_THUMBNAIL_FRAME_LEFT; top_offset = CAJA_THUMBNAIL_FRAME_TOP; right_offset = CAJA_THUMBNAIL_FRAME_RIGHT; diff --git a/libcaja-private/caja-undostack-manager.h b/libcaja-private/caja-undostack-manager.h index e360a9a6..df08d58c 100644 --- a/libcaja-private/caja-undostack-manager.h +++ b/libcaja-private/caja-undostack-manager.h @@ -29,7 +29,7 @@ #include <glib.h> #include <glib-object.h> -#include <gtk/gtkwidget.h> +#include <gtk/gtk.h> #include <gio/gio.h> /* Begin action structures */ |