fsearch icon indicating copy to clipboard operation
fsearch copied to clipboard

Search focus

Open tonypachino opened this issue 3 years ago • 22 comments

Can you please add the feature that when i click on fsearch icon that is minimized in taskbar that i can start to type right away and don't have to click on search window?

tonypachino avatar Nov 08 '21 13:11 tonypachino

That's already how it's supposed to work and does on my systems (GNOME). Which desktop environment do you use?

cboxdoerfer avatar Nov 10 '21 17:11 cboxdoerfer

It sort-of does at the start but not when already running?... my fix is to close fsearch prior to re-opening it - then I have focus and can gnarl away at the keyboard feverishly. Suggest OP enables close after double-click.

tomachinz avatar Dec 07 '21 16:12 tomachinz

This is something that I'm interested in. I use a shortcut (Ctrl Alt E) to bring up FSearch (that's because it's the same shortcut I used in Voidtools/Everything for toggling the maximizing of the screen). Would be great if the focus could stay in the search bar when FSearch is re-maximized. I am on Cinnamon Desktop. Also, one other request and is for FSearch to remember the column width -- particularly the name column. FSearch already remembers the column positions -- would just like to add the feature of remembering the column width. Thanks Christian for a great and very useful Linux app! -Allen

kajodowe avatar Dec 11 '21 21:12 kajodowe

I would love this feature (KDE user). When fsearch is already running and I call it with a hotkey or by clicking on the window, I can't type to search right away. I need to press ctrl-f first (or click on the search field).

sicherist avatar Jan 10 '22 18:01 sicherist

Hi sicherist -- Yes, I totally agree. If that is fixed then FSearch will be perfect and receive a score of 100%! It is so useful to me -- I love it. I am not a programmer but I think it's possible to clear the search field and highlight it / give it focus when a new FSearch query starts.

kajodowe avatar Jan 10 '22 18:01 kajodowe

Just another comment regarding this issue. I have the same issue as tonypachino (who originated this issue) -- I am using the Cinnamon desktop environment. and, as noted by sicherist in the above comment, I have to type CTRL-F or click on the search field to start a new search. I use a keyboard shortcut/hotkey (Ctrl-Alt-E) to bring up FSearch. I, like many others, used the Everything / Voidtools Windows search utility for a long time, and within Everything, you can set a shortcut in the field titled 'toggle window hotkey.' With this setting, the cursor always remains in the search window but is not highlighted, and there is no previous search text in the search area. Would love to see this feature implemented in FSearch. Thank you Christian for all your work on FSearch!

kajodowe avatar Jan 22 '22 11:01 kajodowe

@kajodowe, I just made some changes, so the search entry should now always get focus when you activate the main window. Let me know if it works for you.

cboxdoerfer avatar Jan 22 '22 15:01 cboxdoerfer

Hi Christian -- I tried it and it doesn't seem to have changed. Would I need to install a new daily build? I tried that and reinstalled fsearch but it's the same as before. It looks like the last build was on the 16th. Let me know if I'm doing something wrong. It would be great if it would toggle (maximize and minimize) every time you use the shortcut/hotkey and then put the cursor in the search field and also clear the search field. Thanks again.

kajodowe avatar Jan 22 '22 17:01 kajodowe

The daily builds should be updated automatically in the next 24 hours. If you want to test it right now, you'd need to build it manually.

cboxdoerfer avatar Jan 22 '22 18:01 cboxdoerfer

Thanks Christian -- I will check for the daily build tomorrow. -Allen

kajodowe avatar Jan 22 '22 23:01 kajodowe

Christian -- I installed the daily build but nothing seems to have changed. I shut down FSearch and re-opened but the behavior is the same. The search field is still populated with the last search terms so you need to press Ctrl-F to initiate a new search. I copy my text from the above post for what I believe would be the ideal situation for searching: "It would be great if it would toggle (maximize and minimize) every time you use the shortcut/hotkey and then put the cursor in the search field and also clear the search field. Thanks again." Thank you for your efforts. -Allen

kajodowe avatar Jan 24 '22 17:01 kajodowe

@kajodowe: What is the output of apt show fsearch?

cboxdoerfer avatar Jan 24 '22 17:01 cboxdoerfer

Christian -- here is the output: Package: fsearch Version: 20220123+r1546.377c56a~ubuntu20.04.1 Priority: optional Section: utils Maintainer: Christian Boxdörfer [email protected] Installed-Size: 961 kB Depends: libc6 (>= 2.29), libcairo2 (>= 1.2.4), libglib2.0-0 (>= 2.59.0), libgtk-3-0 (>= 3.21.5), libicu66 (>= 66.1-1~), libpango-1.0-0 (>= 1.14.0), libpcre3 Breaks: fsearch-trunk Replaces: fsearch-trunk Download-Size: 187 kB APT-Manual-Installed: yes APT-Sources: http://ppa.launchpad.net/christian-boxdoerfer/fsearch-daily/ubuntu focal/main amd64 Packages Description: A fast graphical file search utility FSearch is a fast file search utility, based on GTK3. It supports regular expressions, wildcards, fast sorting, instant results with millions of files and more.

kajodowe avatar Jan 24 '22 18:01 kajodowe

Thanks for the patch! For me it works as intended (version 20220123+r1546.377c56a~ubuntu21.10.1; KDE). When fsearch is running in the background and I call it to the foreground with my shortcut the cursor is now in the search field. That wasn't the case in the prior version. (However when calling fsearch by clicking on the taskbar it doesn't, but I don't mind having to click into the search field when my hand is on the mouse anyway).

I have one suggestion that would make it even better: The old search text in the search field could become highlighted. That way you could easily overwrite it with a new search term without having to backspace-delete the old one first.

sicherist avatar Jan 24 '22 18:01 sicherist

I have one suggestion that would make it even better: The old search text in the search field could become highlighted. That way you could easily overwrite it with a new search term without having to backspace-delete the old one first.

That's actually what the patch is supposed to do and I'm not sure yet why it doesn't work reliably. I'll have a look at it.

cboxdoerfer avatar Jan 24 '22 18:01 cboxdoerfer

Hm, to me this almost looks like a GTK bug. When the window is out of focus and the whole text gets selected, it immediately gets deselected again for some reason.

Edit: I just hacked together a simple GTK application and this issue also happens there, so this is most certainly a GTK bug. So for the moment there's nothing I can do about that, but I'll report it to GTK and hopefully this can get fixed soon.

cboxdoerfer avatar Jan 24 '22 19:01 cboxdoerfer

Now it works with highlighting. Thank you very much!

sicherist avatar Jan 26 '22 08:01 sicherist

Thanks Christian. What if you just delete the text rather than trying to preserve it? In the Windows app "Voidtools/Everything" when you are in toggle mode the toggling of the page does not preserve the text -- the text disappears. I understand that some may prefer to preserve the text -- but I would have no problem with the text being deleted. -Allen

kajodowe avatar Jan 26 '22 19:01 kajodowe

Thanks Christian. What if you just delete the text rather than trying to preserve it? In the Windows app "Voidtools/Everything" when you are in toggle mode the toggling of the page does not preserve the text -- the text disappears. I understand that some may prefer to preserve the text -- but I would have no problem with the text being deleted. -Allen

I think focusing the entry and selecting the full text is the better solution, because it works for both use cases:

  • those who want to be able to do a new search can start typing right away, just as if the text was deleted. Because the selected text gets replaced with the newly typed characters automatically
  • and at the same time it preserves the old search text and results for all those who need it

The latest build should now work as expected (the search entry gets focused and selected), except when you use Wayland. So everyone on Ubuntu, Linux Mint, ... should be fine. On Wayland there seems to be a bug, which I've reported and hopefully gets fixed soon.

cboxdoerfer avatar Jan 27 '22 13:01 cboxdoerfer

@sicherist

Now it works with highlighting. Thank you very much!

No problem :)

cboxdoerfer avatar Jan 27 '22 13:01 cboxdoerfer

Working for me also -- thanks again Christian! Great work!

kajodowe avatar Jan 27 '22 18:01 kajodowe

Just a comment with an additional solution, for people who land here looking for a solution to this problem.

I had the same problem on KDE Plasma 5.18.8 and the latest Fsearch 0.2alpha: If there's no Fsearch window, a keyboard shortcut creates it with the focus already on the search field; but if the Fsearch window is already opened and under other windows, the keyboard shortcut does nothing – the window remains buried under the others.

The problem in my case was that in System settings the "Focus stealing prevention" was set to "low". If this setting is set no "none" instead, then Fsearch will always come on top when called. An alternative is to open the "Configure special application settings" menu through the Fsearch titlebar (usually by right-click), and on the tab "Appearance & Fixes" set "Focus stealing prevention" to "Force/None".

Thank you for this fantastic tool!

pglpm avatar Jul 12 '22 16:07 pglpm