Bug 441800

Summary: Global selection mask changes layer focus
Product: [Applications] krita Reporter: rebuilderster
Component: Layer StackAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: halla
Priority: NOR    
Version First Reported In: 5.0.0-beta1   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description rebuilderster 2021-08-31 07:45:35 UTC
SUMMARY

When using a global selection mask, upon exiting the mask view, the active layer is changed to the topmost layer in the layer stack.

STEPS TO REPRODUCE
1.Create a document with two layers on top of the usual background layer 
2. Select the second-from-the-top layer
3. press 'Q' to show global selection mask
4. make some marks in the mask with a brush tool. 
5. Press 'Q' to hide the global selection mask

OBSERVED RESULT

The topmost layer is now the active layer.

EXPECTED RESULT
The active layer should be the layer that was active before showing global selection mask.

Note that if you already have a selection, then activate the desired layer, and then show global selection mask, this issue does not occur.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 rebuilderster 2021-09-16 18:35:09 UTC
This report may rely on custom keyboard shortcuts. Instead of pressing "Q", toggle "show global selection mask" under the select menu to reproduce this bug.
Comment 2 Halla Rempt 2022-06-28 12:03:43 UTC
I can confirm this happens. I am not sure, though whether it's fixable in the end -- we don't keep track of the history of activated layers anywhere.
Comment 3 rebuilderster 2022-09-28 05:36:32 UTC
This only happens if there is no selection active when "show global selection mask" is toggled. If a global selection already exists, focus is returned to the correct layer.

Also, if the "Activate previously selected layer" action is used instead of the normal way of exiting the global selection mask display, focus is returned to the correct layer.

This seems to mean the info about what layer to return to is available.