! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[enh] Type-ahead find for Desktop icons
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfdesktop
Component:
General

Comments

Description Alan Ott 2014-09-09 06:00:08 CEST
It would be great to be able to click on the desktop, and then use type-ahead find to select files which exist on the desktop, similar to what other desktops do, and similar to what is done in Thunar.

Currently:
1. click desktop,
2. Start typing the name of a file which exists on the desktop,
2a. Observe that the typing has no effect on which file is selected.

Desired use case:
1. Click desktop,
2. Start typing the name of a file which exists on the desktop,
2a. Observe the selected file moves to match the characters typed.

Thanks!
Comment 1 Julien [nodiscc] editbugs 2014-11-28 15:58:59 CET
Confirmed and annoying in 4.10.2-3
Comment 2 Helder 2015-01-07 19:02:50 CET
Still happening on Ubuntu Studio 14.10.
Comment 3 Boris Astardzhiev 2020-02-15 15:22:30 CET
Created attachment 9458 
feature implementation

Here's what I've managed to implement in my spare time.
Type-ahead find for Desktop icons.
1. Click on desktop,
2. Press a letter key,
3. Observe the selection of an icon matched by the typed key,
3a. On pressing the same key select the next matched icon.
It supports utf8 labels.
Future enhancement may be to track down delay of input and thus several types could be treated as a whole name.
Comment 4 alexxcons editbugs 2020-02-15 17:54:48 CET
Created attachment 9461 
did some cosmetics

Thanks alot for that patch, works very well for me !

Regarding the code:
I simplified the logic in "xfdesktop_icon_view_type_ahead_find_icon" a bit and made it more readable by using a variable .. fine for you like that ?

And I shortened the commit message + added a link to the bug
Apart from these cosmetics, from my POV, it's fine to get pushed.
Comment 5 Boris Astardzhiev 2020-02-15 18:24:22 CET
Great, now it's clearer. It seems OK to me.
Comment 6 Git Bot editbugs 2020-02-16 21:06:51 CET
Boris Astardzhiev referenced this bugreport in commit 27254aae7fe6b1311497001e1c2c4fc8076823b6

Added type-ahead find for Desktop icons (Bug #11149)

https://git.xfce.org/xfce/xfdesktop/commit?id=27254aae7fe6b1311497001e1c2c4fc8076823b6
Comment 7 alexxcons editbugs 2020-02-16 21:10:13 CET
Just pushed it to master, will be available in xfdesktop 4.15 / 4.16

Thanks alot for your contribuition !
Comment 8 Boris Astardzhiev 2020-02-16 21:19:00 CET
Nice Alex, I hope that others will also benefit. Regards.
Comment 9 Theo Linkspfeifer editbugs 2020-02-16 23:05:09 CET
Nice feature!


I noticed that pressing ctrl+c may highlight a different file afterwards (if one starting with C is present).

https://git.xfce.org/xfce/xfdesktop/tree/src/xfdesktop-file-icon-manager.c#n2590
Comment 10 alexxcons editbugs 2020-02-17 00:00:18 CET
(In reply to Theo Linkspfeifer from comment #9)
> Nice feature!
> 
> 
> I noticed that pressing ctrl+c may highlight a different file afterwards (if
> one starting with C is present).
> 
> https://git.xfce.org/xfce/xfdesktop/tree/src/xfdesktop-file-icon-manager.
> c#n2590
Uh, good point. Probably we should only go for "Type-ahead find" if GTK_SHIFT_MASK  and GTK_CONTROL_MASK are disabled
Comment 11 Boris Astardzhiev 2020-02-17 09:17:35 CET
Created attachment 9464 
ignore combo/modifier keys

Ignore all modifier key events in type-ahead find icons as noted by Theo Linkspfeifer
Comment 12 Boris Astardzhiev 2020-02-17 11:46:49 CET
Created attachment 9465 
ignore a set of combo/modifier keys

It seems that ignoring all modifier events is not a good idea.
For example if Numlock is pressed feature doesn't work since evt->state has GDK_MOD2_MASK set.
It's because on my desktop:
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

I'm posting another patch as Alex suggested to only ignore SHIFT and CTRL.
Yet I added GDK_SUPER_MASK, GDK_HYPER_MASK, GDK_META_MASK to the list.
I hope it's better now. If you have any precaution against SUPER,HYPER,META give some feedback.

Regards
Comment 13 alexxcons editbugs 2020-02-17 11:59:18 CET
Thanks for the modifier patch !

A possible way to prevent Numlock (and  CapsLock) while still checking for all other valid modifiers could be to use gtk_accelerator_get_default_mod_mask()  .. though I did not have time to take a try so far.

Here more info on it: https://developer.gnome.org/gtk3/stable/checklist-modifiers.html
Comment 14 Boris Astardzhiev 2020-02-17 13:05:30 CET
Created attachment 9466 
ignore a set of combo/modifier keys2

You're right Alex. Consider the following patch.
On my setup gtk_accelerator_get_default_mod_mask() returns 0x1c00000d.
This would be:
GDK_SHIFT_MASK
GDK_CONTROL_MASK
GDK_MOD1_MASK (which I missed with previous patch)
GDK_SUPER_MASK
GDK_HYPER_MASK
GDK_META_MASK
Numlock and Caplock are OK now.
Regards
Comment 15 Git Bot editbugs 2020-02-17 17:57:33 CET
Boris Astardzhiev referenced this bugreport in commit 6f85effe2336e4514d41f49ec53df168bca0132d

Ignore modifier key events in type-ahead find (Bug #11149)

https://git.xfce.org/xfce/xfdesktop/commit?id=6f85effe2336e4514d41f49ec53df168bca0132d
Comment 16 alexxcons editbugs 2020-02-17 18:00:10 CET
Thanks alot, seems to work fine now!
I just used the correct return type for gtk_accelerator_get_default_mod_mask() and shortened the commit message a bit.
Comment 17 Boris Astardzhiev 2020-02-17 18:46:55 CET
Great and thanks for the prompt review. Regards.
Comment 18 alexxcons editbugs 2020-05-14 21:45:11 CEST
*** Bug 16843 has been marked as a duplicate of this bug. ***

Bug #11149

Reported by:
Alan Ott
Reported on: 2014-09-09
Last modified on: 2020-05-14
Duplicates (1):
  • 16843 Feature request: Choosing files/icons/folders on Desktop using keyboard

People

Assignee:
alexxcons
CC List:
6 users

Version

Version:
4.10.0

Attachments

feature implementation (4.13 KB, patch)
2020-02-15 15:22 CET , Boris Astardzhiev
no flags
did some cosmetics (3.63 KB, patch)
2020-02-15 17:54 CET , alexxcons
no flags
ignore combo/modifier keys (1.45 KB, patch)
2020-02-17 09:17 CET , Boris Astardzhiev
no flags
ignore a set of combo/modifier keys (1.81 KB, patch)
2020-02-17 11:46 CET , Boris Astardzhiev
no flags
ignore a set of combo/modifier keys2 (1.70 KB, patch)
2020-02-17 13:05 CET , Boris Astardzhiev
no flags

Additional information