diff --git a/nautilus-42.beta-dropshadow.patch b/nautilus-42.beta-dropshadow.patch new file mode 100644 index 0000000..9e20a24 --- /dev/null +++ b/nautilus-42.beta-dropshadow.patch @@ -0,0 +1,93 @@ +From 18dd71d10e2960d62caf590724715973ac9e5684 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= +Date: Mon, 28 Feb 2022 13:05:40 +0000 +Subject: [PATCH] list-view: Draw shadow instead of doing style class changes + +--- + src/nautilus-list-view.c | 55 +++++++++++++++++++++++++++------------- + 1 file changed, 37 insertions(+), 18 deletions(-) + +diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c +index 77278fab1..c1cef11f2 100644 +--- a/src/nautilus-list-view.c ++++ b/src/nautilus-list-view.c +@@ -1578,16 +1578,6 @@ starred_cell_data_func (GtkTreeViewColumn *column, + g_autofree gchar *text = NULL; + g_autofree gchar *uri = NULL; + NautilusFile *file; +- GtkStyleContext *context; +- +- /* The "thumbnail" style class is set before rendering each icon cell with +- * a thumbnail. However, style classes are not applied to each cell, but +- * alwyas to the whole GtkTreeView widget. So, before the star icon is +- * rendered, we must ensure that the style is not set, otherwise the star +- * icon is going to get the styles meant only for thumbnail icons. +- */ +- context = gtk_widget_get_style_context (GTK_WIDGET (view)); +- gtk_style_context_remove_class (context, "thumbnail"); + + gtk_tree_model_get (model, iter, + view->details->file_name_column_num, &text, +@@ -1659,10 +1649,6 @@ icon_cell_data_func (GtkTreeViewColumn *column, + &file, + -1); + +- /* Hack: Set/unset the style class in advance of rendering. This makes a +- * major assumption that's all but clearly stated in the documentation of +- * GtkCellLayout: that the DataFunc is called before rendering each cell. +- */ + is_thumbnail = FALSE; + if (zoom_level_is_enough_for_thumbnails (view) && file != NULL) + { +@@ -1678,11 +1664,44 @@ icon_cell_data_func (GtkTreeViewColumn *column, + + if (is_thumbnail) + { ++ cairo_surface_t *new_surface; ++ cairo_t *cr; ++ ++ /* The shadow extends 1px up, 3px down, and 2px left and right. ++ * ++ * ************************* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *# #* ++ * *#######################* ++ * *#######################* ++ * ************************* ++ * ++ * Therefore, final surface is 4px taller and 4px wider, with the ++ * original icon starting at (2,1). ++ */ ++ new_surface = cairo_surface_create_similar (surface, ++ CAIRO_CONTENT_COLOR_ALPHA, ++ cairo_image_surface_get_width (surface) + 4, ++ cairo_image_surface_get_height (surface) + 4); ++ cr = cairo_create (new_surface); ++ ++ gtk_style_context_save (context); + gtk_style_context_add_class (context, "thumbnail"); +- } +- else +- { +- gtk_style_context_remove_class (context, "thumbnail"); ++ gtk_render_icon_surface (context, cr, surface, 2, 1); ++ gtk_style_context_restore (context); ++ ++ cairo_destroy (cr); ++ ++ cairo_surface_destroy (surface); ++ surface = new_surface; + } + + g_object_set (renderer, +-- +GitLab + diff --git a/nautilus.spec b/nautilus.spec index 51607d1..881c579 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -6,12 +6,14 @@ Name: nautilus Version: 42~beta -Release: 1%{?dist} +Release: 2%{?dist} Summary: File manager for GNOME License: GPLv3+ URL: https://wiki.gnome.org/Apps/Nautilus Source0: https://download.gnome.org/sources/%{name}/42/%{name}-%{tarball_version}.tar.xz +# https://gitlab.gnome.org/GNOME/nautilus/-/issues/2169 +Patch0: nautilus-42.beta-dropshadow.patch BuildRequires: desktop-file-utils BuildRequires: gcc @@ -144,6 +146,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop %doc %{_datadir}/gtk-doc/html/libnautilus-extension/ %changelog +* Mon Feb 28 2022 David King - 42~beta-2 +- Fix thumbnail drop shadow refresh bug + * Sun Feb 13 2022 David King - 42~beta-1 - Update to 42.beta