Bug 504463

Summary: Floating toolbars dissapeared after closing, restarting Krita - 5.2.9, 5.3, 6.0.0
Product: [Applications] krita Reporter: Wolfgang Baer <info>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: penguinflyer2222
Priority: NOR    
Version First Reported In: 5.2.9   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Wolfgang Baer 2025-05-18 11:54:58 UTC
Tested with Krita 5.2.9, 5.3, 6.0.0 on Windows 11.

Floating toolbars dissapeared after closing, opening Krita.

Reproduce:
- Undock a toolbar
- Close Krita
- Open Krita

Result:
Toolbar is not visible anymore (even though still active in “Toolbar shown” settings).

Expected:
Toolbar is visible.

Only way to get it back is hacking the krita5.xmlgui file.

Workaround - hacking the krita5.xmlgui:
    close Krita
    open the xmlgui in a text editor
    cut the part with the dissapeared toolbar out of the xmlgui
    save the xmlgui
    start Krita
    do nothing in Krita
    close Krita
    open the xmlgui again
    paste the previously cut toolbar back into the xmlgui
    save the xmlgui
    start Krita
    go to “Toolbars shown” menu and activate the “missing” toolbar

It now appears again at the top right of the UI.

See also: https://krita-artists.org/t/undocked-toolbar-gone-after-restart/123963
Comment 1 Freya Lupen 2025-05-18 16:18:52 UTC
Confirmed that the floating toolbar disappears on restart, and modifying the toolbar with Configure Toolbars causes it to reappear where I left it. (Krita 6.0.0-prealpha-0eb46a21c)

For some reason the toolbar's updatesEnabled is false, which causes it to not receive paint events. This script causes it to appear, if the floated toolbar was File ('mainToolBar'):
> from krita import *
> 
> Krita.instance().activeWindow().qwindow().findChild(QToolBar,'mainToolBar').setUpdatesEnabled(True)
Comment 2 Dmitry Kazakov 2025-05-30 13:24:09 UTC
Git commit 3ad7e6625d9f2bddbf5618c1a94ed68c36963896 by Dmitry Kazakov, on behalf of Freya Lupen.
Committed on 30/05/2025 at 13:23.
Pushed by dkazakov into branch 'master'.

Fix floating toolbars disappearing on restart

Make sure the toolbar state gets loaded on the welcome page,
otherwise it'll be loaded in (un)showWelcomeScreen
in between the updatesEnabled toggles, causing floating toolbars
to be stuck with updates disabled as they become top-level widgets
no longer affected by setUpdatesEnabled on their parent.

M  +1    -2    libs/ui/KisMainWindow.cpp

https://invent.kde.org/graphics/krita/-/commit/3ad7e6625d9f2bddbf5618c1a94ed68c36963896