mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[MouseUtils]check queue dispatcher initialization (#15948)
This commit is contained in:
@@ -598,6 +598,12 @@ public:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Runtime objects already created. Should update in the owner thread.
|
// Runtime objects already created. Should update in the owner thread.
|
||||||
|
if (m_dispatcherQueueController == nullptr)
|
||||||
|
{
|
||||||
|
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||||
|
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||||
FindMyMouseSettings localSettings = settings;
|
FindMyMouseSettings localSettings = settings;
|
||||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||||
|
|||||||
@@ -277,6 +277,12 @@ void InclusiveCrosshairs::ApplySettings(InclusiveCrosshairsSettings& settings, b
|
|||||||
if (applyToRunTimeObjects)
|
if (applyToRunTimeObjects)
|
||||||
{
|
{
|
||||||
// Runtime objects already created. Should update in the owner thread.
|
// Runtime objects already created. Should update in the owner thread.
|
||||||
|
if (m_dispatcherQueueController == nullptr)
|
||||||
|
{
|
||||||
|
Logger::warn("Tried accessing the dispatch queue controller before it was initialized.");
|
||||||
|
// No dispatcher Queue Controller? Means initialization still hasn't run, so settings will be applied then.
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
auto dispatcherQueue = m_dispatcherQueueController.DispatcherQueue();
|
||||||
InclusiveCrosshairsSettings localSettings = settings;
|
InclusiveCrosshairsSettings localSettings = settings;
|
||||||
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
bool enqueueSucceeded = dispatcherQueue.TryEnqueue([=]() {
|
||||||
|
|||||||
Reference in New Issue
Block a user