D7179: Mac: fixing sortedDocumentList menu doesn't change focus (WIP)

René J.V. Bertin noreply at phabricator.kde.org
Mon Aug 7 13:25:13 UTC 2017


rjvbb added a comment.


  So removing the signal blocker indeed leads to MainWindow::activateView() being called twice on Linux (when activating a different view with the sortedDocumentList menu):
  
    void Sublime::Container::setCurrentWidget(QWidget *) widget= KTextEditor::ViewPrivate(0x2ccec10)
    void Sublime::MainWindow::activateView(Sublime::View *, bool) view= KDevelop::TextView(0x2c63190) focus= true
    void Sublime::Container::setCurrentWidget(QWidget *) widget= KTextEditor::ViewPrivate(0x2ccec10)
    void Sublime::MainWindow::activateView(Sublime::View *, bool) view= KDevelop::TextView(0x2c63190) focus= true
    void Sublime::Container::setCurrentWidget(QWidget *) widget= KTextEditor::ViewPrivate(0x2ccec10)
  
  So the signal blocker cannot be removed on Linux at least.
  
  I wonder though, isn't there a risk anyway of these functions calling each other in a loop? Couldn't both functions just check if the given widget is already current (or given view is already the active one) and return immediately if that's the case?
  Removing the signal blocker would still lead to activeView() being called twice in that case, but at least the 2nd invocation shouldn't do anything in that case.

REPOSITORY
  R33 KDevPlatform

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

To: rjvbb, #kdevelop
Cc: kfunk, kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170807/e8310d43/attachment.html>


More information about the KDevelop-devel mailing list