Fix opacity restore for command palette previews#12229
Conversation
| } | ||
|
|
||
| void ControlCore::AdjustOpacity(const int32_t& opacity, const bool& relative) | ||
| void ControlCore::AdjustOpacity(const double opacityAdjust, const bool relative) |
There was a problem hiding this comment.
I wrote the reason for this in the commit description:
It includes an additional change in order to make the AdjustOpacity setter consistent and symmetric with the Opacity getter.
Let me know what you all think. 🙂
| const auto cleanup = wil::scope_exit([this]() { | ||
| _restorePreviewFuncs.clear(); | ||
| }); |
There was a problem hiding this comment.
Just in case a f() call below fails. This ensures the correct behavior for
const auto backup = _restorePreviewFuncs.empty();
zadjii-msft
left a comment
There was a problem hiding this comment.
Ah okay. So only the first preview action now emplaces the revert. That makes enough sense I suppose.
|
@msftbot merge this in 10 minutes |
|
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
More fallout from the settings refactor. Probably because testing on a Windows 10 device is hard, because you actually need a physical machine to get acrylic to behave correctly. Basically, the code is simpler now, but we missed the windows 10 only edge case where acrylic can get turned on, but we forget to enable the acrylic brush, so it just stays off. Refer to #11619 where this regressed, and #11643, #12229, because this is just a hard problem apparently * [x] Closes #11743. Technically OP is complaining about behavior that's by-design, but it made me realize this regressed in 1.12. * [ ] No tests on this part of the TermControl unfortunately. * [x] Hauled out my old Win10 laptop to verify that opacity works right: - [x] A fresh profile isn't created with any opacity - [x] Mouse wheeling turns on acrylic - [x] Using `opacity` only in the settings still stealthily enables acrylic
More fallout from the settings refactor. Probably because testing on a Windows 10 device is hard, because you actually need a physical machine to get acrylic to behave correctly. Basically, the code is simpler now, but we missed the windows 10 only edge case where acrylic can get turned on, but we forget to enable the acrylic brush, so it just stays off. Refer to #11619 where this regressed, and #11643, #12229, because this is just a hard problem apparently * [x] Closes #11743. Technically OP is complaining about behavior that's by-design, but it made me realize this regressed in 1.12. * [ ] No tests on this part of the TermControl unfortunately. * [x] Hauled out my old Win10 laptop to verify that opacity works right: - [x] A fresh profile isn't created with any opacity - [x] Mouse wheeling turns on acrylic - [x] Using `opacity` only in the settings still stealthily enables acrylic
More fallout from the settings refactor. Probably because testing on a Windows 10 device is hard, because you actually need a physical machine to get acrylic to behave correctly. Basically, the code is simpler now, but we missed the windows 10 only edge case where acrylic can get turned on, but we forget to enable the acrylic brush, so it just stays off. Refer to #11619 where this regressed, and #11643, #12229, because this is just a hard problem apparently * [x] Closes #11743. Technically OP is complaining about behavior that's by-design, but it made me realize this regressed in 1.12. * [ ] No tests on this part of the `TermControl` unfortunately. * [x] Hauled out my old Win10 laptop to verify that opacity works right: - [x] A fresh profile isn't created with any opacity - [x] Mouse wheeling turns on acrylic - [x] Using `opacity` only in the settings still stealthily enables acrylic
This commit correctly restores the previous opacity when the command palette
preview is cancelled. It includes an additional change in order to make the
AdjustOpacitysetter consistent and symmetric with theOpacitygetter.PR Checklist
Validation Steps Performed