Bug 446634

Summary: Selecting another workspace sometimes changes current palette (depending on the workspace?)
Product: [Applications] krita Reporter: tomtomtomreportingin
Component: Resource ManagementAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 5.0.0-beta5   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:

Description tomtomtomreportingin 2021-12-07 18:47:40 UTC
SUMMARY
Selecting another workspace will sometimes unnecessarily change the currently selected palette to some other palette. This is pretty annoying when selecting a different workspace that will change the palette, but going back to the old workspace will keep that changed palette instead of using the originally selected palette. 

See the IRC discussion for additional information.

This might be a problem of certain workspaces remembering the palette and others not. Palettes being saved to workspaces were a result of https://bugs.kde.org/show_bug.cgi?id=299033 for reference.

STEPS TO REPRODUCE
1. Select default workspace.
2. Change the palette.
3. Create a new workspace and select it.
4. Select the default workspace and observe the currently selected palette. It has changed from the palette designated in step 2 back to the default palette.
5. Select the workspace created in step 3.
6. The palette from step 2 isn't reselected.

OBSERVED RESULT
Whether workspaces will remember the palette isn't consistent.

EXPECTED RESULT
Either workspaces should never remember the palette or always remember the palette. As discussed in the IRC, it would be more consistent if workspaces did not remember the palette and thus didn't change palettes on selection, especially as workspaces don't remember other resources like brushes, and also since selecting palettes has gotten easier since the original report.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.12.11 (appimage)
Comment 1 Halla Rempt 2022-07-13 08:17:12 UTC
Setting the palette on the workspace apparently was intentional:

commit 9ef4d7f1f2131c7283607eba3f913bb0a92ae640
Author: Sven Langkamp <sven.langkamp@gmail.com>, Sun Jun 30 21:21:48 2013 +0200 (9 years ago)
Committer: Sven Langkamp <sven.langkamp@gmail.com>, Sun Jun 30 21:36:13 2013 +0200 (9 years ago)
Precedes: v2.99.88
Branches: <Expand>

save/load palette from workspace
Comment 2 Halla Rempt 2022-07-13 08:25:48 UTC
Okay, this actually is kinda logical... The Default workspace was saved with the Default palette, so switching to the Default workspace will load the Default palette. I cannot reproduce your step 5 and 6: the current palette was saved to my test workspace, and will always be selected if I select the test workspace.

Since nobody seems to have realized that the current palette is saved in the workspace, it looks random -- some workspaces have a palette, others don't, and which one they have is dependent on what the person creating the workspace did.
Comment 3 Halla Rempt 2022-07-13 08:39:26 UTC
Git commit 186a12624d85b00c8a6a9d5637bb4faecbb8b675 by Halla Rempt.
Committed on 13/07/2022 at 08:39.
Pushed by rempt into branch 'master'.

Remove the palettes from the provided workspaces

The question still remains: should we remove this nine year old
feature of saving the current palette into the workspace?

M  +1    -3    krita/data/workspaces/Animation.kws
M  +1    -3    krita/data/workspaces/Default.kws
M  +1    -3    krita/data/workspaces/Storyboarding.kws

https://invent.kde.org/graphics/krita/commit/186a12624d85b00c8a6a9d5637bb4faecbb8b675
Comment 4 Halla Rempt 2022-07-13 08:39:45 UTC
Git commit bb27b9c159fdd04f7eba0fb120c0ff57462073fc by Halla Rempt.
Committed on 13/07/2022 at 08:39.
Pushed by rempt into branch 'krita/5.1'.

Remove the palettes from the provided workspaces

The question still remains: should we remove this nine year old
feature of saving the current palette into the workspace?
(cherry picked from commit a7cd761f8aa6aff04a179d9b9fc5da94b73c5c4e)

M  +1    -3    krita/data/workspaces/Animation.kws
M  +1    -3    krita/data/workspaces/Default.kws
M  +1    -3    krita/data/workspaces/Storyboarding.kws

https://invent.kde.org/graphics/krita/commit/bb27b9c159fdd04f7eba0fb120c0ff57462073fc
Comment 5 Halla Rempt 2022-07-13 10:40:13 UTC
Git commit b6e859ccb7bd597394ec029711a318ea321ccc9d by Halla Rempt.
Committed on 13/07/2022 at 10:39.
Pushed by rempt into branch 'master'.

Remove saving the palette with the workspace

M  +0    -22   plugins/dockers/palettedocker/palettedocker_dock.cpp
M  +0    -3    plugins/dockers/palettedocker/palettedocker_dock.h

https://invent.kde.org/graphics/krita/commit/b6e859ccb7bd597394ec029711a318ea321ccc9d
Comment 6 Halla Rempt 2022-07-14 06:54:06 UTC
Git commit 9e99f018c0538cc97488f82113361e2e16b4bcff by Halla Rempt.
Committed on 14/07/2022 at 06:53.
Pushed by rempt into branch 'krita/5.1'.

Remove saving the palette with the workspace
(cherry picked from commit b6e859ccb7bd597394ec029711a318ea321ccc9d)

M  +0    -22   plugins/dockers/palettedocker/palettedocker_dock.cpp
M  +0    -3    plugins/dockers/palettedocker/palettedocker_dock.h

https://invent.kde.org/graphics/krita/commit/9e99f018c0538cc97488f82113361e2e16b4bcff