From 5724de82961d6b06e0d0e79bc17bb6ec2ac2d8ff49f20f3974a600bb3e15cdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Fri, 12 May 2023 05:53:22 +0000 Subject: [PATCH] Accepting request 1086647 from GNOME:Next - Add upstream bug fix patches: + 0e5b4c34.patch general: Use GtkSwitch active property consistently. app-chooser sets the state instead of active property. Similar to d7af60161d30c885ebab69c58b346896f1565387, we really meant to set active (whether the switch is toggled) and not the state (i.e. the color of the switch). Use gtk_switch_set_active(). In properties we've already fixed this, but there's a lingering call to gtk_switch_get_state(). This is probably fine because state is in sync with active when the default handler is used, but let's get :active, to be consistent and safe. + 6e37d15f.patch window-slot: Manage search props set with action. Manages search property change through "search-visible" action. The action triggers other related functions that if not executed will causes buggy behavior. Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2875 OBS-URL: https://build.opensuse.org/request/show/1086647 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/nautilus?expand=0&rev=376 --- 0e5b4c34.patch | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 6e37d15f.patch | 39 +++++++++++++++++++++++++++++++++++++++ nautilus.changes | 20 ++++++++++++++++++++ nautilus.spec | 6 ++++++ 4 files changed, 113 insertions(+) create mode 100644 0e5b4c34.patch create mode 100644 6e37d15f.patch diff --git a/0e5b4c34.patch b/0e5b4c34.patch new file mode 100644 index 0000000..cf3c408 --- /dev/null +++ b/0e5b4c34.patch @@ -0,0 +1,48 @@ +From 0e5b4c34960f3481d1e2e74a73f0f876bf49e354 Mon Sep 17 00:00:00 2001 +From: Corey Berla +Date: Mon, 24 Apr 2023 08:36:13 -0700 +Subject: [PATCH] general: Use GtkSwitch active property consistently + +app-chooser sets the state instead of active property. Similar to +d7af60161d30c885ebab69c58b346896f1565387, we really meant to set active +(whether the switch is toggled) and not the state (i.e. the color of the +switch). Use gtk_switch_set_active() + +In properties we've already fixed this, but there's a lingering call +to gtk_switch_get_state(). This is probably fine because state is +in sync with active when the default handler is used, but let's get +:active, to be consistent and safe. +--- + src/nautilus-app-chooser.c | 2 +- + src/nautilus-properties-window.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/nautilus-app-chooser.c b/src/nautilus-app-chooser.c +index 579ba1e1bc..9e4e1dcebb 100644 +--- a/src/nautilus-app-chooser.c ++++ b/src/nautilus-app-chooser.c +@@ -105,7 +105,7 @@ on_application_selected (GtkAppChooserWidget *widget, + default_app = g_app_info_get_default_for_type (self->content_type, FALSE); + is_default = default_app != NULL && g_app_info_equal (info, default_app); + +- gtk_switch_set_state (GTK_SWITCH (self->set_as_default_switch), is_default); ++ gtk_switch_set_active (GTK_SWITCH (self->set_as_default_switch), is_default); + gtk_widget_set_sensitive (GTK_WIDGET (self->set_as_default_switch), !is_default); + } + +diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c +index 98fae514c8..529abfa1cb 100644 +--- a/src/nautilus-properties-window.c ++++ b/src/nautilus-properties-window.c +@@ -2961,7 +2961,7 @@ execution_bit_changed (NautilusPropertiesWindow *self, + const FilterType filter_type = FILES_ONLY; + + /* if activated from switch, switch state is already toggled, thus invert value via XOR. */ +- gboolean active = gtk_switch_get_state (self->execution_switch) ^ GTK_IS_SWITCH (widget); ++ gboolean active = gtk_switch_get_active (self->execution_switch) ^ GTK_IS_SWITCH (widget); + gboolean set_executable = !active; + + update_permissions (self, +-- +GitLab + diff --git a/6e37d15f.patch b/6e37d15f.patch new file mode 100644 index 0000000..7214e03 --- /dev/null +++ b/6e37d15f.patch @@ -0,0 +1,39 @@ +From 6e37d15fe663107d280f6a516232c20f6d6c48fa Mon Sep 17 00:00:00 2001 +From: Khalid Abu Shawarib +Date: Tue, 25 Apr 2023 22:52:24 +0000 +Subject: [PATCH] window-slot: Manage search props set with action + +Manages search property change thorugh "search-visible" +action. The action triggers other related functions that if not +executed will causes buggy behavior. + +Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2875 +--- + src/nautilus-window-slot.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c +index 785386ea13..1768675fe4 100644 +--- a/src/nautilus-window-slot.c ++++ b/src/nautilus-window-slot.c +@@ -738,7 +738,16 @@ nautilus_window_slot_set_property (GObject *object, + + case PROP_SEARCHING: + { +- nautilus_window_slot_set_searching (self, g_value_get_boolean (value)); ++ /* Should be nautilus_window_slot_set_searching(), but then ++ * the search-visible action would get out of sync with this ++ * property. See discussion in https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1157 ++ */ ++ nautilus_window_slot_set_search_visible (self, g_value_get_boolean (value)); ++ /* The previous call should have already caused the action ++ * to call nautilus_window_slot_set_searching(), but it ++ * doesn't hurt to make sure we set our boolean propperly. ++ */ ++ self->searching = g_value_get_boolean (value); + } + break; + +-- +GitLab + diff --git a/nautilus.changes b/nautilus.changes index 1dac961..14b1a78 100644 --- a/nautilus.changes +++ b/nautilus.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Wed May 10 17:25:20 UTC 2023 - Bjørn Lie + +- Add upstream bug fix patches: + + 0e5b4c34.patch general: Use GtkSwitch active property + consistently. app-chooser sets the state instead of active + property. Similar to d7af60161d30c885ebab69c58b346896f1565387, + we really meant to set active (whether the switch is toggled) + and not the state (i.e. the color of the switch). Use + gtk_switch_set_active(). + In properties we've already fixed this, but there's a lingering + call to gtk_switch_get_state(). This is probably fine because + state is in sync with active when the default handler is used, + but let's get :active, to be consistent and safe. + + 6e37d15f.patch window-slot: Manage search props set with + action. Manages search property change through "search-visible" + action. The action triggers other related functions that if not + executed will causes buggy behavior. + Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2875 + ------------------------------------------------------------------- Sun Apr 23 08:57:36 UTC 2023 - Bjørn Lie diff --git a/nautilus.spec b/nautilus.spec index 07c327d..5d31edc 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -28,6 +28,12 @@ Source0: https://download.gnome.org/sources/nautilus/44/%{name}-%{version Source1: mount-archive.desktop Source2: set_trusted.desktop Source3: set_trusted.sh + +# PATCH-FIX-UPSTREAM 0e5b4c34.patch -- general: Use GtkSwitch active property consistently +Patch1: https://gitlab.gnome.org/GNOME/nautilus/-/commit/0e5b4c34.patch +# PATCH-FIX-UPSTREAM 6e37d15f.patch -- window-slot: Manage search props set with action +Patch2: https://gitlab.gnome.org/GNOME/nautilus/-/commit/6e37d15f.patch + # needed for directory ownership BuildRequires: dbus-1 BuildRequires: fdupes