diff options
author | Albert Vaca | 2018-04-29 21:12:57 +0200 |
---|---|---|
committer | Albert Vaca | 2018-04-29 21:26:35 +0200 |
commit | e0231fe0a29ae42eae7f039ac063bde5ce0f6277 (patch) | |
tree | a9c8f4d7687313744bef3899c698e537e736d668 | |
parent | 610bef614038e4b3b9a700360f6b2eb6c7ca254a (diff) | |
download | aur-e0231fe0a29ae42eae7f039ac063bde5ce0f6277.tar.gz |
Fixed patch
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | nautilus-restore-typeahead.patch | 117 |
2 files changed, 53 insertions, 66 deletions
@@ -20,7 +20,7 @@ _commit=784b3eaab6495515393e99bcbc22344bb9cd975f # tags/3.28.1^0 source=("git+https://gitlab.gnome.org/GNOME/nautilus.git#commit=$_commit" nautilus-restore-typeahead.patch) sha256sums=('SKIP' - 'd5eb01843d2758e74e25686f521f5fd72879e32595b494e9cabb8f8f1a2a87a5') + '52c546f8be2a586adabb80424aa511cbba6349bfa2680347bd935f1824ea3916') prepare() { cd $_pkgbase diff --git a/nautilus-restore-typeahead.patch b/nautilus-restore-typeahead.patch index 7ed3e727ee61..89814b9118c9 100644 --- a/nautilus-restore-typeahead.patch +++ b/nautilus-restore-typeahead.patch @@ -1,10 +1,10 @@ diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml -index 023035872..767c4748a 100644 +index 3c4ace4b7..37d63f7fc 100644 --- a/data/org.gnome.nautilus.gschema.xml +++ b/data/org.gnome.nautilus.gschema.xml -@@ -202,6 +202,11 @@ - <summary>Bulk rename utility</summary> - <description>If set, Nautilus will append URIs of selected files and treat the result as a command line for bulk renaming. Bulk rename applications can register themselves in this key by setting the key to a space-separated string of their executable name and any command line options. If the executable name is not set to a full path, it will be searched for in the search path.</description> +@@ -196,6 +196,11 @@ + <summary>What viewer should be used when searching</summary> + <description>When searching Nautilus will switch to the type of view in this setting.</description> </key> + <key name="enable-interactive-search" type="b"> + <default>true</default> @@ -15,33 +15,33 @@ index 023035872..767c4748a 100644 <default>true</default> <summary>Whether to open the hovered folder after a timeout when drag and drop operation</summary> diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h -index ce0b32c9d..a624e7551 100644 +index 89e6b2045..5c9c9e17f 100644 --- a/src/nautilus-global-preferences.h +++ b/src/nautilus-global-preferences.h -@@ -161,6 +161,9 @@ typedef enum +@@ -141,6 +141,9 @@ typedef enum /* Recent files */ #define NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED "remember-recent-files" - + +/* Interactive search (typeahead) */ +#define NAUTILUS_PREFERENCES_ENABLE_INTERACTIVE_SEARCH "enable-interactive-search" + /* Move to trash shorcut changed dialog */ #define NAUTILUS_PREFERENCES_SHOW_MOVE_TO_TRASH_SHORTCUT_CHANGED_DIALOG "show-move-to-trash-shortcut-changed-dialog" - + diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c -index 759e3b158..fbfbd6fee 100644 +index d2ba388e8..6cc0ef77e 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c -@@ -2762,6 +2762,7 @@ nautilus_list_view_set_selection (NautilusFilesView *view, - GList *node; +@@ -2916,6 +2916,7 @@ nautilus_list_view_set_selection (NautilusFilesView *view, + gboolean cursor_is_set_on_selection = FALSE; GList *iters, *l; NautilusFile *file; + GtkTreePath *path2 = NULL; - + list_view = NAUTILUS_LIST_VIEW (view); - tree_selection = gtk_tree_view_get_selection (list_view->details->tree_view); -@@ -2778,10 +2779,22 @@ nautilus_list_view_set_selection (NautilusFilesView *view, - { + model = list_view->details->model; +@@ -2947,10 +2948,22 @@ nautilus_list_view_set_selection (NautilusFilesView *view, + gtk_tree_selection_select_iter (tree_selection, (GtkTreeIter *) l->data); + if (!path2) @@ -50,7 +50,7 @@ index 759e3b158..fbfbd6fee 100644 + g_list_free_full (iters, g_free); } - + + if (path2) { + gtk_tree_view_set_cursor_on_cell (list_view->details->tree_view, + path2, @@ -63,7 +63,7 @@ index 759e3b158..fbfbd6fee 100644 g_signal_handlers_unblock_by_func (tree_selection, list_selection_changed_callback, view); nautilus_files_view_notify_selection_changed (view); } -@@ -3672,3 +3685,9 @@ nautilus_list_view_new (NautilusWindowSlot *slot) +@@ -3912,3 +3925,9 @@ nautilus_list_view_new (NautilusWindowSlot *slot) "window-slot", slot, NULL); } @@ -79,13 +79,13 @@ index 04989fa95..fc15f0986 100644 +++ b/src/nautilus-list-view.h @@ -39,5 +39,6 @@ struct _NautilusListView }; - + NautilusFilesView * nautilus_list_view_new (NautilusWindowSlot *slot); +GtkTreeView * nautilus_list_view_get_tree_view (NautilusListView *list_view); - + #endif /* NAUTILUS_LIST_VIEW_H */ diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c -index d364115a9..054edba8a 100644 +index c3260aeb0..ee4e2b1ef 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -124,6 +124,17 @@ typedef struct @@ -104,12 +104,12 @@ index d364115a9..054edba8a 100644 + guint isearch_timeout_id; + gulong isearch_configure_event_id; } NautilusWindowSlotPrivate; - + G_DEFINE_TYPE_WITH_PRIVATE (NautilusWindowSlot, nautilus_window_slot, GTK_TYPE_BOX); @@ -208,6 +219,98 @@ nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *self) return data; } - + + +/* Interactive search */ +static void isearch_ensure (NautilusWindowSlot *slot); @@ -205,10 +205,10 @@ index d364115a9..054edba8a 100644 gboolean nautilus_window_slot_handles_location (NautilusWindowSlot *self, GFile *location) -@@ -637,21 +740,86 @@ nautilus_window_slot_handle_event (NautilusWindowSlot *self, +@@ -636,21 +739,86 @@ nautilus_window_slot_handle_event (NautilusWindowSlot *self, } } - + - /* If the action is not enabled, don't try to handle search */ - if (g_action_get_enabled (action)) - { @@ -265,7 +265,7 @@ index d364115a9..054edba8a 100644 + gtk_widget_grab_focus (GTK_WIDGET (self)); + return TRUE; + } - + - if (retval) - { - nautilus_window_slot_set_search_visible (self, TRUE); @@ -285,10 +285,10 @@ index d364115a9..054edba8a 100644 + nautilus_window_slot_set_search_visible (self, TRUE); + } } - + return retval; } - + +/* static gboolean +configure_event_cb (GtkWidget *widget, + GdkEventConfigure *event, @@ -301,16 +301,16 @@ index d364115a9..054edba8a 100644 static void real_active (NautilusWindowSlot *self) { -@@ -680,10 +848,19 @@ static void +@@ -679,10 +847,19 @@ static void real_inactive (NautilusWindowSlot *self) { NautilusWindow *window; + NautilusWindowSlotPrivate *priv; - + + priv = nautilus_window_slot_get_instance_private (self); window = nautilus_window_slot_get_window (self); g_assert (self == nautilus_window_get_active_slot (window)); - + + isearch_hide (self, NULL); + if (priv->isearch_configure_event_id != 0) { + g_signal_handler_disconnect (GTK_WIDGET (priv->window), @@ -320,11 +320,11 @@ index d364115a9..054edba8a 100644 + gtk_widget_insert_action_group (GTK_WIDGET (window), "slot", NULL); } - -@@ -976,9 +1153,30 @@ nautilus_window_slot_init (NautilusWindowSlot *self) + +@@ -975,6 +1152,14 @@ nautilus_window_slot_init (NautilusWindowSlot *self) nautilus_application_set_accelerator (app, "slot.files-view-mode(uint32 0)", "<control>2"); nautilus_application_set_accelerator (app, "slot.search-visible", "<control>f"); - + + priv->isearch_enable = g_settings_get_boolean (nautilus_preferences, + NAUTILUS_PREFERENCES_ENABLE_INTERACTIVE_SEARCH); + @@ -335,41 +335,28 @@ index d364115a9..054edba8a 100644 + priv->view_mode_before_search = NAUTILUS_VIEW_INVALID_ID; } - -+static void -+nautilus_window_slot_finalize (GObject *object) -+{ -+ NautilusWindowSlot *slot; -+ slot = NAUTILUS_WINDOW_SLOT (object); -+ -+ g_signal_handlers_disconnect_by_func (nautilus_preferences, -+ isearch_enable_changed, -+ slot); -+ -+ G_OBJECT_CLASS (nautilus_window_slot_parent_class)->finalize (object); -+} -+ - #define DEBUG_FLAG NAUTILUS_DEBUG_WINDOW - #include "nautilus-debug.h" - -@@ -2782,6 +2980,7 @@ nautilus_window_slot_dispose (GObject *object) - + +@@ -2778,6 +2963,7 @@ nautilus_window_slot_dispose (GObject *object) + self = NAUTILUS_WINDOW_SLOT (object); priv = nautilus_window_slot_get_instance_private (self); + isearch_dispose (self); - - nautilus_window_slot_clear_forward_list (self); - nautilus_window_slot_clear_back_list (self); -@@ -2873,6 +3072,7 @@ nautilus_window_slot_class_init (NautilusWindowSlotClass *klass) - oclass->constructed = nautilus_window_slot_constructed; - oclass->set_property = nautilus_window_slot_set_property; - oclass->get_property = nautilus_window_slot_get_property; -+ oclass->finalize = nautilus_window_slot_finalize; - - widget_class->grab_focus = nautilus_window_slot_grab_focus; - -@@ -3295,3 +3495,792 @@ nautilus_window_slot_get_loading (NautilusWindowSlot *self) - + + g_signal_handlers_disconnect_by_data (nautilus_trash_monitor_get (), self); + +@@ -2824,6 +3010,10 @@ nautilus_window_slot_finalize (GObject *object) + self = NAUTILUS_WINDOW_SLOT (object); + priv = nautilus_window_slot_get_instance_private (self); + ++ g_signal_handlers_disconnect_by_func (nautilus_preferences, ++ isearch_enable_changed, ++ self); ++ + g_clear_pointer (&priv->title, g_free); + + G_OBJECT_CLASS (nautilus_window_slot_parent_class)->finalize (object); +@@ -3292,3 +3482,792 @@ nautilus_window_slot_get_loading (NautilusWindowSlot *self) + return priv->loading; } + |