From 3b772a30a7decb4e57f40a3a991ce6aded6eade6 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 27 May 2015 13:27:30 +0900 Subject: [PATCH] Fix return value on mime_exec_file() (bgo#749833, #745454) - Some backport fix --- ...nder-1.4.6-fix-ret-value-on-patch100.patch | 25 ++++++ ...nder-1.4.6-set-focus-on-searchdialog.patch | 85 +++++++++++++++++++ ...commander-1.4.6-set-focus-when-found.patch | 19 +++++ gnome-commander.spec | 17 +++- 4 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 gnome-commander-1.4.6-fix-ret-value-on-patch100.patch create mode 100644 gnome-commander-1.4.6-set-focus-on-searchdialog.patch create mode 100644 gnome-commander-1.4.6-set-focus-when-found.patch diff --git a/gnome-commander-1.4.6-fix-ret-value-on-patch100.patch b/gnome-commander-1.4.6-fix-ret-value-on-patch100.patch new file mode 100644 index 0000000..2c7b63d --- /dev/null +++ b/gnome-commander-1.4.6-fix-ret-value-on-patch100.patch @@ -0,0 +1,25 @@ +From a7239bd930cc840b59cbe2b1fed0a49301a78473 Mon Sep 17 00:00:00 2001 +From: Uwe Scholz +Date: Sat, 23 May 2015 21:43:52 +0200 +Subject: Only return true if mime_exec_single() is executed + + +diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc +index d46ed16..8f689a2 100644 +--- a/src/gnome-cmd-file-list.cc ++++ b/src/gnome-cmd-file-list.cc +@@ -1177,9 +1177,10 @@ inline gboolean mime_exec_file (GnomeCmdFile *f) + if (f->info->type == GNOME_VFS_FILE_TYPE_REGULAR) + { + mime_exec_single (f); ++ return TRUE; + } ++ return FALSE; + +- return TRUE; + } + + +-- +cgit v0.10.2 + diff --git a/gnome-commander-1.4.6-set-focus-on-searchdialog.patch b/gnome-commander-1.4.6-set-focus-on-searchdialog.patch new file mode 100644 index 0000000..0d37abe --- /dev/null +++ b/gnome-commander-1.4.6-set-focus-on-searchdialog.patch @@ -0,0 +1,85 @@ +From e47883cd16c914158b9d20da67b7b06d8c7265a7 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Thu, 21 May 2015 14:32:56 +0900 +Subject: set focus when showing search dialog + +https://bugzilla.gnome.org/show_bug.cgi?id=745454 + +To avoid GnomeCmdSearchDialog priv->result_list receive +"key-press-event", explicitly set focus on pattern_combo +when search dialog is raised. + +diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc +index 3c8407e..e2125a1 100644 +--- a/src/dialogs/gnome-cmd-search-dialog.cc ++++ b/src/dialogs/gnome-cmd-search-dialog.cc +@@ -1116,6 +1116,12 @@ static void gnome_cmd_search_dialog_class_init (GnomeCmdSearchDialogClass *klass + } + + ++void GnomeCmdSearchDialog::show_and_set_focus() ++{ ++ gtk_widget_show(*this); ++ priv->profile_component->set_focus(); ++} ++ + GnomeCmdSearchDialog::GnomeCmdSearchDialog(GnomeCmdData::SearchConfig &cfg): defaults(cfg) + { + gtk_window_set_default_size (*this, defaults.width, defaults.height); +diff --git a/src/dialogs/gnome-cmd-search-dialog.h b/src/dialogs/gnome-cmd-search-dialog.h +index f5b950c..84bc2bf 100644 +--- a/src/dialogs/gnome-cmd-search-dialog.h ++++ b/src/dialogs/gnome-cmd-search-dialog.h +@@ -55,6 +55,8 @@ struct GnomeCmdSearchDialog + + GnomeCmdData::SearchConfig &defaults; + ++ void show_and_set_focus(); ++ + GnomeCmdSearchDialog(GnomeCmdData::SearchConfig &defaults); + ~GnomeCmdSearchDialog(); + }; +diff --git a/src/gnome-cmd-selection-profile-component.cc b/src/gnome-cmd-selection-profile-component.cc +index 96d4a18..d56e450 100644 +--- a/src/gnome-cmd-selection-profile-component.cc ++++ b/src/gnome-cmd-selection-profile-component.cc +@@ -237,6 +237,11 @@ void GnomeCmdSelectionProfileComponent::copy(GnomeCmdData::Selection &profile) + profile.match_case = profile.content_search && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->case_check)); + } + ++void GnomeCmdSelectionProfileComponent::set_focus() ++{ ++ gtk_widget_grab_focus (priv->pattern_combo); ++} ++ + + void GnomeCmdSelectionProfileComponent::set_name_patterns_history(GList *history) + { +diff --git a/src/gnome-cmd-selection-profile-component.h b/src/gnome-cmd-selection-profile-component.h +index 1620703..95924c0 100644 +--- a/src/gnome-cmd-selection-profile-component.h ++++ b/src/gnome-cmd-selection-profile-component.h +@@ -55,6 +55,7 @@ struct GnomeCmdSelectionProfileComponent + void update(); + void copy(); // copies component to associated profile + void copy(GnomeCmdData::Selection &profile); // copies component to specified profile ++ void set_focus(); + + void set_name_patterns_history(GList *history); + void set_content_patterns_history(GList *history); +diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc +index b0bee29..f65ce53 100644 +--- a/src/gnome-cmd-user-actions.cc ++++ b/src/gnome-cmd-user-actions.cc +@@ -1023,7 +1023,7 @@ void edit_search (GtkMenuItem *menuitem, gpointer not_used) + if (!main_win->file_search_dlg) + main_win->file_search_dlg = new GnomeCmdSearchDialog(gnome_cmd_data.search_defaults); + +- gtk_widget_show (*main_win->file_search_dlg); ++ main_win->file_search_dlg->show_and_set_focus(); + } + + +-- +cgit v0.10.2 + diff --git a/gnome-commander-1.4.6-set-focus-when-found.patch b/gnome-commander-1.4.6-set-focus-when-found.patch new file mode 100644 index 0000000..638abbd --- /dev/null +++ b/gnome-commander-1.4.6-set-focus-when-found.patch @@ -0,0 +1,19 @@ +--- gnome-commander-1.4.6/src/dialogs/gnome-cmd-search-dialog.cc.debug 2015-05-26 09:59:43.955984728 +0900 ++++ gnome-commander-1.4.6/src/dialogs/gnome-cmd-search-dialog.cc 2015-05-26 10:30:48.683253817 +0900 +@@ -534,8 +534,14 @@ + gtk_dialog_set_response_sensitive (*data->dialog, GnomeCmdSearchDialog::GCMD_RESPONSE_FIND, TRUE); + gtk_dialog_set_default_response (*data->dialog, GnomeCmdSearchDialog::GCMD_RESPONSE_FIND); + +- if (matches) +- gtk_widget_grab_focus (*data->dialog->priv->result_list); // set focus to result list ++ if (matches) { ++ GnomeCmdFileList *fl = data->dialog->priv->result_list; ++ gtk_widget_grab_focus (*fl); // set focus to result list ++ // select one file, as matches is non-zero, there should be at least one entry ++ if (!fl->get_focused_file()) { ++ fl->select_row(0); ++ } ++ } + } + + return FALSE; // returning FALSE here stops the timeout callbacks diff --git a/gnome-commander.spec b/gnome-commander.spec index d34fac2..dfc1fc8 100644 --- a/gnome-commander.spec +++ b/gnome-commander.spec @@ -28,7 +28,7 @@ %global use_autotool 0 %global update_po 0 %global if_pre 0 -%global main_release 1 +%global main_release 1.110 #%%global extratag %{git_pull_JST}git%{shorthash} %undefine extratag %global mimeedit_rev 1958 @@ -68,6 +68,13 @@ Source10: mimeedit-svn%{mimeedit_rev}.sh Patch10: mimeedit-svn1958.diff # backport 5b0b3a469ab426feb596b0edfcc61cde4c0e6e80 Patch100: gnome-commander-1.4.6-add_sec_check_for_mime_exec_file.patch +# backport e47883cd16c914158b9d20da67b7b06d8c7265a7 +Patch101: gnome-commander-1.4.6-set-focus-on-searchdialog.patch +# backport a7239bd930cc840b59cbe2b1fed0a49301a78473 +Patch102: gnome-commander-1.4.6-fix-ret-value-on-patch100.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=749869 +# Pending +Patch103: gnome-commander-1.4.6-set-focus-when-found.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: desktop-file-utils @@ -145,6 +152,10 @@ ansluta till FTP-servrar och SMB-nätverk. #%{__cp} -p %SOURCE10 mimeedit.sh #%%patch10 -p0 %patch100 -p1 +%patch101 -p1 +%patch102 -p1 +# Pending +#%%patch103 -p1 %{__sed} -i.pylib \ -e 's|\$PY_EXEC_PREFIX/lib|%{_libdir}|' \ @@ -257,6 +268,10 @@ desktop-file-install \ %{_datadir}/pixmaps/%{name}/ %changelog +* Wed May 27 2015 Mamoru TASAKA - 4:1.4.6-2 +- Fix return value on mime_exec_file() (bgo#749833, #745454) +- Some backport fix + * Wed May 20 2015 Mamoru TASAKA - 4:1.4.6-1 - Update to 1.4.6