D5919: Fix crash when closing tabs with search box open

Elvis Angelaccio noreply at phabricator.kde.org
Fri May 19 17:13:28 BST 2017


elvisangelaccio created this revision.
Restricted Application added subscribers: Dolphin, Konqueror.

REVISION SUMMARY
  Fixes a regression introduced by https://phabricator.kde.org/R318:6af0dad2eeba82929c2299f66ea81e5d0140a251.
  DolphinViewContainer::setActive() unconditionally calls setActive() on
  the url navigator, view and search box. However this has side effects,
  as DolphinSearchBox activates itself if it receives a FocusIn event.
  
  This is what happens in the bug:
  
  1. The searchbox of the first tab gets disactivated (as side effect of disactivating its container).
  2. Second tab gets closed, we call removeTab(1) in the tab widget.
  3. The searchbox of the first tab gets a FocusIn event and calls setActive(true).
  4. Since it was disabled, it emits activated() and this results in the activeViewChanged() signal which causes the crash because the currentIndex() of the tab page is still 1 but its widget has already been invalidated.
  
  This patch prevents step 1. from happening, so when the searchbox gets
  the FocusIn event, it's already activated, i.e. doesn't emit activated().
  
  BUG: 379135
  FIXED-IN: 17.04.2

TEST PLAN
  Open dolphin, open the search box, open a new tab, close the new tab.

REPOSITORY
  R318 Dolphin

BRANCH
  bug/379135 (branched from Applications/17.04)

REVISION DETAIL
  https://phabricator.kde.org/D5919

AFFECTED FILES
  src/dolphintabwidget.cpp

To: elvisangelaccio, anthonyfieroni, emmanuelp
Cc: #konqueror, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20170519/8745b51b/attachment.htm>


More information about the kfm-devel mailing list