[Xfce-bugs] [Bug 15119] Custom action keyboard shortcut doesn't use the current, selected, path and file.
bugzilla-daemon at xfce.org
bugzilla-daemon at xfce.org
Fri Sep 20 14:33:55 CEST 2019
https://bugzilla.xfce.org/show_bug.cgi?id=15119
Reuben Green <reubengreen73 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reubengreen73 at gmail.com
--- Comment #3 from Reuben Green <reubengreen73 at gmail.com> ---
Created attachment 9043
--> https://bugzilla.xfce.org/attachment.cgi?id=9043&action=edit
attempt at a fix
Here is my go at fixing this. However, I'm certainly not an expert in gtk, so
please treat with caution!
After a little debugging, I think the problem is that the function
thunar_standard_view_merge_custom_actions, which generates the menu items which
are activated by pressing keys when a file is selected, is currently being run
only during thunar_standard_view_context_menu, with the result that the menu
items are only refreshed when a context menu is run. Thus the menu items are
not updated to reflect a change in the file selection.
The attached patch solves this by moving the call to
thunar_standard_view_merge_custom_actions into
thunar_standard_view_selection_changed, so that the menu items are regenerated
whenever the selection changes and thus should always have the correct path. I
have also removed the selected_items argument to
thunar_standard_view_merge_custom_actions, since at the moment this parameter
is not really being used. Indeed, the existing code just gets the list of
selected items from the ThunarStandardView immediately before passing this
directly to thunar_standard_view_merge_custom_actions, so I've changed
thunar_standard_view_merge_custom_actions to retrieve the selected items
itself.
One more thing: while testing this patch, I noticed that when running thunar in
a terminal in "View as Detailed List" mode, I get a variable (i.e. between none
and lots) number of xfconf-WARNINGs of the form
(thunar:12028): xfconf-WARNING **: 13:26:13.116: Failed to set property
"thunar::/last-details-view-column-widths": Operation was cancelled
I don't think these are caused by my patch, since I also get them with a thunar
compiled from the master branch. It's *possible* that after applying my patch
there are slightly more of these warnings, but the number of them is highly
variable both with and without the patch so I can't really tell. In any case, I
don't think my patch is the root cause of them. I'll open another bug for this.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Xfce-bugs
mailing list