Skip to content
Commit 9616edbb authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Fix loop of FocusIn events

Summary:
Commit 43da84ee introduced the risk of entering an endless loop of
`FocusIn`/`FocusOut` events sent to two DolphinSearchBox instances when
opening a second tab (see D11871).

This happens because we deactivate the first tab when we open a new one, but
since the `setActive(true)` is delayed with a QTimer, both the old tab
and the new one become active and receive their own `FocusIn` event
(which starts the loop of focus in/out events).

To prevent this issue, we schedule the searchbox activation only if the
searchbox is not already active.

Test Plan:
- Search something in dolphin
- Open a new tab after the search ends
- Check that dolphin does not eat the CPU

Reviewers: #dolphin, anthonyfieroni

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D13152
parent 2f6635f4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment