Fix loop of FocusIn events

Authored by elvisangelaccio on Jun 3 2018, 12:53 PM.

Description

Fix loop of FocusIn events

Summary:
Commit 43da84eefc7d 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

Details

Committed
elvisangelaccioJun 13 2018, 7:39 PM
Differential Revision
D13152: Fix loop of FocusIn events
Parents
R318:2f6635f4e8c2: [KBalooRolesProvider] Support properties of type QStringList
Branches
Unknown
Tags
Unknown