Skip to content

applets/kickoff: don't launch when clearing search

Christoph Wolk requested to merge cwo/plasma-desktop:kickoff-clear into master

Currently, the search field emits accepted when clearing user input using the button, which causes the visible previously focused entry, if any, to launch.

This change uses a propery of SearchField to inhibit sending that signal.

This MR requires libplasma!1171 (closed) to be merged. It is the simplest solution, making the accepted signal optional through a property. I can see other solutions in case this is not merged, but they come with significant downsides.

  • The search field instance could not call the currentItem.trigger() if the search field is empty. This should prevent the bug, but then users could not press Meta and immediately hit enter to launch the default app. This would probably work, but this solution is difficult to get to work with the complex input and focus handling in kickoff. See the discussions below.
  • The search field instance could overwrite the actions associated with the clear button. This seems ill-advised from the perspective of maintainability, as changes in that part of SearchField would need to be ported to kickoff, and any other applet that needs such functionality.
  • The search field instance could capture the enter and return keys, then the accepted signal could be ignored. This is how krunner does it, but would not work nicely with the way kickoff handles keyboard input now: it passes all keys to the TextArea first. This makes seamless integration of e.g. the arrow keys possible, which allow movement within the search field, but move to the next control if moving beyond the text. (Krunner does not allow moving focus to controls left or right of the searchField using the arrow keys)

BUG: 479233 FIXED-IN: 6.2.0

Edited by Christoph Wolk

Merge request reports