Bug 369278 - toolbar items should remain put where user left it (and maintain its visibility across restarts)
Summary: toolbar items should remain put where user left it (and maintain its visibili...
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: sublime (other bugs)
Version First Reported In: git master
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-24 10:17 UTC by RJVB
Modified: 2022-11-26 05:16 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
rjvbertin: Usability+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2016-09-24 10:17:06 UTC
The debugger toolbar has the nasty habit of reverting to its default location, and reappearing in views where it's supposed to be hidden

Reproducible: Sometimes

Steps to Reproduce:
1. Put the debugger toolbar where you want it to be, possibly hiding it in the standard code view
2. Quit the session
3. Reopen the session, possibly after having opened other sessions or with another session open that has been kept open.

Actual Results:  
The debugger toolbar may or may not restore its previous location and visibility.

Expected Results:  
The debugger toolbar reappears where it was told to be, and remains hidden if it was told so.

Locking the toolbars has no effect whatsoever contrary to what one might expect.

The "reset" appears to be triggered when anything else in the overall windowstate changed.
Comment 1 RJVB 2016-10-02 15:48:57 UTC
A bit more info on this one: apparently the debugger toolbar state is saved in more than 1 location. If it reappears against my instructions, I quit KDevelop and turn the debugger toolbar off in kdeveloprc, it will reappear consistently.

In Sublime::MainWindow::loadSettings() its visibility will be set to false, which also allows me to set a conditional breakpoint in QWidget::setVisible() to catch subsequent changes. And indeed, a bit later I get a whole series of hits with the backtraces below, suggesting that its a plugin restoring its view settings that causes this. Could that be the debugger plugin itself or is it just the plugin load order and what its idea bout debugger toolbar visibility is that determines whether it will ultimately be visible?

If so, why do so many plugins store a visibility state for this toolbar, and what can be done about it? This basically means that the toolbar's effective visibility at startup is almost purely random, and that doesn't apply for other toolbars.

1st:
* thread #1: tid = 0x1ba872e, 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=true) + 40 at qwidget.cpp:8112, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
    frame #0: 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=true) + 40 at qwidget.cpp:8112 [opt]
   8109 
   8110 void QWidget::setVisible(bool visible)
   8111 {
-> 8112     if (visible) { // show
   8113         if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
   8114             return;
   8115 
(lldb) bt
* thread #1: tid = 0x1ba872e, 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=true) + 40 at qwidget.cpp:8112, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  * frame #0: 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=true) + 40 at qwidget.cpp:8112 [opt]
    frame #1: 0x000000010cf6ed00 QtWidgets`QToolBarAreaLayout::restoreState(this=0x00007fd5fa8a2a38, stream=0x00007fff54bd5198, _toolBars=<unavailable>, tmarker=<unavailable>, testing=false) + 912 at qtoolbararealayout.cpp:1356 [opt]
    frame #2: 0x000000010ceda412 QtWidgets`QMainWindowLayoutState::restoreState(this=0x00007fd5fa8a2a20, _stream=<unavailable>, oldState=<unavailable>) + 642 at qmainwindowlayout.cpp:985 [opt]
    frame #3: 0x000000010cee1be2 QtWidgets`QMainWindowLayout::restoreState(this=0x00007fd5fa8a2a00, stream=<unavailable>) + 98 at qmainwindowlayout.cpp:2522 [opt]
    frame #4: 0x000000010ced62de QtWidgets`QMainWindow::restoreState(this=0x00007fd5fc9db3a0, state=<unavailable>, version=<unavailable>) + 142 at qmainwindow.cpp:1329 [opt]
    frame #5: 0x000000010c0ea769 libKF5XmlGui.5.dylib`KMainWindow::applyMainWindowSettings(KConfigGroup const&) + 1811
    frame #6: 0x000000010c11dac3 libKF5XmlGui.5.dylib`KXmlGuiWindow::applyMainWindowSettings(KConfigGroup const&) + 23
    frame #7: 0x000000010c11da98 libKF5XmlGui.5.dylib`KXmlGuiWindow::finalizeGUI(bool) + 98
    frame #8: 0x000000010c10f0e7 libKF5XmlGui.5.dylib`KXMLGUIFactory::addClient(KXMLGUIClient*) + 1169
    frame #9: 0x000000010b07aeb7 libKDevPlatformShell.10.dylib`KDevelop::MainWindowPrivate::addPlugin(this=0x00007fd5fa429a50, plugin=<unavailable>) + 439 at mainwindow_p.cpp:97 [opt]
    frame #10: 0x000000010df184b6 QtCore`QMetaObject::activate(QObject*, int, int, void**) [inlined] QtPrivate::QSlotObjectBase::call(this=<unavailable>, r=<unavailable>, a=<unavailable>) + 2054 at qobject_impl.h:124 [opt]
    frame #11: 0x000000010df1849b QtCore`QMetaObject::activate(sender=0x00007fd5fa439b80, signalOffset=<unavailable>, local_signal_index=<unavailable>, argv=<unavailable>) + 2027 at qobject.cpp:3715 [opt]
    frame #12: 0x000000010ba2cb7f libKDevPlatformInterfaces.10.dylib`KDevelop::IPluginController::pluginLoaded(this=<unavailable>, _t1=<unavailable>) + 63 at moc_iplugincontroller.cpp:235 [opt]
    frame #13: 0x000000010b083aac libKDevPlatformShell.10.dylib`KDevelop::PluginController::loadPluginInternal(this=<unavailable>, pluginId=<unavailable>) + 7916 at plugincontroller.cpp:578 [opt]
    frame #14: 0x000000010b08936b libKDevPlatformShell.10.dylib`KDevelop::PluginController::allPluginsForExtension(QString const&, QMap<QString, QVariant> const&) [inlined] KDevelop::PluginController::allPluginsForExtension(QString const&, QMap<QString, QVariant> const&)::$_9::operator()(KPluginMetaData const&) const + 85 at plugincontroller.cpp:658 [opt]
    frame #15: 0x000000010b089316 libKDevPlatformShell.10.dylib`KDevelop::PluginController::allPluginsForExtension(QString const&, QMap<QString, QVariant> const&) [inlined] void KDevelop::PluginControllerPrivate::foreachEnabledPlugin<KDevelop::PluginController::allPluginsForExtension(QString const&, QMap<QString, QVariant> const&)::$_9>(this=0x00007fd5fa4f2c60)::$_9, QString const&, QMap<QString, QVariant> const&, QString const&) + 790 at plugincontroller.cpp:220 [opt]
    frame #16: 0x000000010b089000 libKDevPlatformShell.10.dylib`KDevelop::PluginController::allPluginsForExtension(this=0x00007fd5fa439b80, extension=<Invalid>, constraints=<size=0>) + 64 at plugincontroller.cpp:655 [opt]
    frame #17: 0x000000010b0f7436 libKDevPlatformShell.10.dylib`KDevelop::DocumentationController::documentationProviders(this=<unavailable>) const + 86 at documentationcontroller.cpp:186 [opt]
    frame #18: 0x000000010b0f6e41 libKDevPlatformShell.10.dylib`KDevelop::DocumentationController::initialize(this=0x00007fd5fce99390) + 33 at documentationcontroller.cpp:125 [opt]
    frame #19: 0x000000010b092b9c libKDevPlatformShell.10.dylib`KDevelop::CorePrivate::initialize(this=<unavailable>, mode=<unavailable>, session=<unavailable>) + 5772 at core.cpp:290 [opt]
    frame #20: 0x000000010b0937dc libKDevPlatformShell.10.dylib`KDevelop::Core::initialize(splash=0x0000000000000000, mode=<unavailable>, session=<unavailable>) + 508 at core.cpp:363 [opt]
    frame #21: 0x000000010b03fbab kdevelop.bin`main(argc=<unavailable>, argv=0x00007fff54bd6270) + 42523 at main.cpp:769 [opt]


2nd:
* thread #1: tid = 0x1ba872e, 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=false) + 40 at qwidget.cpp:8112, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
    frame #0: 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=false) + 40 at qwidget.cpp:8112 [opt]
   8109 
   8110 void QWidget::setVisible(bool visible)
   8111 {
-> 8112     if (visible) { // show
   8113         if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
   8114             return;
   8115 
(lldb) bt
* thread #1: tid = 0x1ba872e, 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=false) + 40 at qwidget.cpp:8112, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  * frame #0: 0x000000010cdc69f8 QtWidgets`QWidget::setVisible(this=0x00007fd5fcd14590, visible=false) + 40 at qwidget.cpp:8112 [opt]
    frame #1: 0x000000010cf3eb9e QtWidgets`QToolBarPrivate::setWindowState(this=0x00007fd5fcd14e60, floating=false, unplug=true, rect=0x00007fff54bd30b0) + 78 at qtoolbar.cpp:146 [opt]
    frame #2: 0x000000010cf6ed19 QtWidgets`QToolBarAreaLayout::restoreState(this=0x00007fd5fa8a2a38, stream=0x00007fff54bd32e8, _toolBars=<unavailable>, tmarker=<unavailable>, testing=false) + 937 at qtoolbararealayout.cpp:1357 [opt]
    frame #3: 0x000000010ceda412 QtWidgets`QMainWindowLayoutState::restoreState(this=0x00007fd5fa8a2a20, _stream=<unavailable>, oldState=<unavailable>) + 642 at qmainwindowlayout.cpp:985 [opt]
    frame #4: 0x000000010cee1be2 QtWidgets`QMainWindowLayout::restoreState(this=0x00007fd5fa8a2a00, stream=<unavailable>) + 98 at qmainwindowlayout.cpp:2522 [opt]
    frame #5: 0x000000010ced62de QtWidgets`QMainWindow::restoreState(this=0x00007fd5fc9db3a0, state=<unavailable>, version=<unavailable>) + 142 at qmainwindow.cpp:1329 [opt]
    frame #6: 0x000000010c0ea769 libKF5XmlGui.5.dylib`KMainWindow::applyMainWindowSettings(KConfigGroup const&) + 1811
    frame #7: 0x000000010c11dac3 libKF5XmlGui.5.dylib`KXmlGuiWindow::applyMainWindowSettings(KConfigGroup const&) + 23
    frame #8: 0x000000010c11da98 libKF5XmlGui.5.dylib`KXmlGuiWindow::finalizeGUI(bool) + 98
    frame #9: 0x000000010c10f0e7 libKF5XmlGui.5.dylib`KXMLGUIFactory::addClient(KXMLGUIClient*) + 1169
    frame #10: 0x000000010b07aeb7 libKDevPlatformShell.10.dylib`KDevelop::MainWindowPrivate::addPlugin(this=0x00007fd5fa429a50, plugin=<unavailable>) + 439 at mainwindow_p.cpp:97 [opt]
    frame #11: 0x000000010df184b6 QtCore`QMetaObject::activate(QObject*, int, int, void**) [inlined] QtPrivate::QSlotObjectBase::call(this=<unavailable>, r=<unavailable>, a=<unavailable>) + 2054 at qobject_impl.h:124 [opt]
    frame #12: 0x000000010df1849b QtCore`QMetaObject::activate(sender=0x00007fd5fa439b80, signalOffset=<unavailable>, local_signal_index=<unavailable>, argv=<unavailable>) + 2027 at qobject.cpp:3715 [opt]
    frame #13: 0x000000010ba2cb7f libKDevPlatformInterfaces.10.dylib`KDevelop::IPluginController::pluginLoaded(this=<unavailable>, _t1=<unavailable>) + 63 at moc_iplugincontroller.cpp:235 [opt]
    frame #14: 0x000000010b083aac libKDevPlatformShell.10.dylib`KDevelop::PluginController::loadPluginInternal(this=<unavailable>, pluginId=<unavailable>) + 7916 at plugincontroller.cpp:578 [opt]
    frame #15: 0x000000010b08a3d8 libKDevPlatformShell.10.dylib`KDevelop::PluginController::loadProjectPlugins(this=<unavailable>) + 568 at plugincontroller.cpp:719 [opt]
    frame #16: 0x000000010b0a1b85 libKDevPlatformShell.10.dylib`KDevelop::ProjectControllerPrivate::importProject(this=<unavailable>, url_=<unavailable>) + 2021 at projectcontroller.cpp:303 [opt]
    frame #17: 0x000000010b0a135a libKDevPlatformShell.10.dylib`KDevelop::ProjectController::openProject(this=<unavailable>, projectFile=<unavailable>) + 3418 at projectcontroller.cpp:808 [opt]
    frame #18: 0x000000010b09fe5c libKDevPlatformShell.10.dylib`KDevelop::ProjectController::openProjects(this=<unavailable>, projects=<unavailable>) + 204 at projectcontroller.cpp:630 [opt]
    frame #19: 0x000000010df10de3 QtCore`QObject::event(this=<unavailable>, e=<unavailable>) + 659 at qobject.cpp:1256 [opt]
    frame #20: 0x000000010cd861e6 QtWidgets`QApplicationPrivate::notify_helper(this=<unavailable>, receiver=0x00007fd5fcf25a90, e=0x00007fd5fd0c4970) + 294 at qapplication.cpp:3804 [opt]
    frame #21: 0x000000010cd89726 QtWidgets`QApplication::notify(this=<unavailable>, receiver=<unavailable>, e=<unavailable>) + 8470 at qapplication.cpp:3767 [opt]
    frame #22: 0x000000010dee4567 QtCore`QCoreApplication::notifyInternal2(receiver=0x00007fd5fcf25a90, event=0x00007fd5fd0c4970) + 167 at qcoreapplication.cpp:1020 [opt]
    frame #23: 0x000000010dee5166 QtCore`QCoreApplicationPrivate::sendPostedEvents(receiver=0x0000000000000000, event_type=0, data=0x00007fd5fa500d40) + 566 at qcoreapplication.h:225 [opt]
    frame #24: 0x000000011851b92e libqcocoa.dylib`QCocoaEventDispatcherPrivate::processPostedEvents(this=0x00007fd5fa4cc2d0) + 190 at qcocoaeventdispatcher.mm:883 [opt]
    frame #25: 0x000000011851c211 libqcocoa.dylib`QCocoaEventDispatcherPrivate::postedEventsSourceCallback(info=0x00007fd5fa4cc2d0) + 33 at qcocoaeventdispatcher.mm:920 [opt]
    frame #26: 0x00007fff8bb905b1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame #27: 0x00007fff8bb81c62 CoreFoundation`__CFRunLoopDoSources0 + 242
    frame #28: 0x00007fff8bb813ef CoreFoundation`__CFRunLoopRun + 831
    frame #29: 0x00007fff8bb80e75 CoreFoundation`CFRunLoopRunSpecific + 309
    frame #30: 0x00007fff8c2cca0d HIToolbox`RunCurrentEventLoopInMode + 226
    frame #31: 0x00007fff8c2cc685 HIToolbox`ReceiveNextEventCommon + 173
    frame #32: 0x00007fff8c2cc5bc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 65
    frame #33: 0x00007fff8589c24e AppKit`_DPSNextEvent + 1434
    frame #34: 0x00007fff8589b89b AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    frame #35: 0x00007fff8588f99c AppKit`-[NSApplication run] + 553
    frame #36: 0x000000011851b08d libqcocoa.dylib`QCocoaEventDispatcher::processEvents(this=0x00007fd5fa4cb090, flags=<unavailable>) + 2189 at qcocoaeventdispatcher.mm:416 [opt]
    frame #37: 0x000000010dee0981 QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) [inlined] QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 401 at qeventloop.cpp:128 [opt]
    frame #38: 0x000000010dee0964 QtCore`QEventLoop::exec(this=0x00007fff54bd5e50, flags=<unavailable>) + 372 at qeventloop.cpp:204 [opt]
    frame #39: 0x000000010dee4bf5 QtCore`QCoreApplication::exec() + 325 at qcoreapplication.cpp:1290 [opt]
    frame #40: 0x000000010b0424da kdevelop.bin`main(argc=<unavailable>, argv=0x00007fd5fce257d0) + 53066 at main.cpp:893 [opt]
Comment 2 RJVB 2016-10-03 10:09:11 UTC
I've changed the bug title because I think that same multi-level restore apparent from the backtraces above causes other items to be restored when they shouldn't.

For instance, I have been trying to get rid of the "Documentation" toolbar item because I don't use it (for a large part because using it tends to make its window reappear persistently). The "Documentation" toolbar item also keeps restoring itself.

In fact, it does that much more persistently than the debugger toolbar:
1- open a session in KDevelop
2- remove the DOcumentation button from any toolbar it may be on, in all areas (code, review, debug)
3- quit KDevelop
4- restart KDevelop
5- back to 2)
Comment 3 RJVB 2016-12-20 11:07:47 UTC
Bump.

I changed the title once more and the concerned component to the one I think is the culprit.

The debugger tool continues to make itself visible and move to its apparently default location at random occasions in sessions where the debugger plugin hasn't been disabled completely.
The Documentation toolbar item continues to reactivate itself *systematically* each time I restart a session, and continues to slide open its view after each area change on one of my systems. In addition, the view doesn't remember the width to which I resized it but will reopen *systematically* to take up almost half my editing area.

I'd tackle this myself, but I haven't managed to find out even where to start. The only thing I have figured out is that areas apparently restore all toolviews multiple times, with the correct restore configuration at or near the start of a loop over (IIUC) individual plugin configuration settings. That explains why the final restore result can change, due to differences in the order in that loop changes, or if a random other session changed the settings for a plugin. In fact, if this interpretation is correct it's almost a miracle that one can get configuration changes to "stick" at all.

Re-reading my comment 1 above it may be that we simply need to call Sublime::MainWindow::loadSettings() to restore the current session settings once more to override any changes made during the first call to that method, but where?
Comment 4 Justin Zobel 2022-10-27 02:48:50 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 5 Bug Janitor Service 2022-11-11 05:18:21 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2022-11-26 05:16:00 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!