[Accessibility]Turn animations off based on Windows settings (#28128)

* FindMyMouse: switch animations on/off based on global windows settings

* Fancy Zones: enable/disable animations based on global Windows settings

* Shortcut Guide: enabling/disabling animations based on global Windows settings

* spell checker

* Making MouseUtils settings dependent on global windows settings, AnimationEffects. If the global settings is disabled the MouseUtils animation settings is disabled too, description shows the reason.

* Adding error detection, log on SystemParametersInfo call.

* Adding infobar instead of changing description of the settingsbar.

* spell checker

* moving native constant into NativeMethods class
This commit is contained in:
Laszlo Nemeth
2023-09-05 15:25:24 +02:00
committed by GitHub
parent 298a5eba2a
commit 83bb573223
10 changed files with 68 additions and 5 deletions

View File

@@ -7,6 +7,7 @@
#include "common/utils/game_mode.h"
#include "common/utils/process_path.h"
#include "common/utils/excluded_apps.h"
#include "common/utils/MsWindowsSettings.h"
#include <vector>
#ifdef COMPOSITION
@@ -648,6 +649,8 @@ struct CompositionSpotlight : SuperSonar<CompositionSpotlight>
void SetSonarVisibility(bool visible)
{
m_batch = m_compositor.GetCommitBatch(winrt::CompositionBatchTypes::Animation);
BOOL isEnabledAnimations = GetAnimationsEnabled();
m_animation.Duration(std::chrono::milliseconds{ isEnabledAnimations ? m_fadeDuration : 1 });
m_batch.Completed([hwnd = m_hwnd](auto&&, auto&&) {
PostMessage(hwnd, WM_OPACITY_ANIMATION_COMPLETED, 0, 0);
});

View File

@@ -5,6 +5,7 @@
#include "start_visible.h"
#include <common/utils/resources.h>
#include <common/utils/window.h>
#include <common/utils/MsWindowsSettings.h>
#include "shortcut_guide.h"
#include "trace.h"
@@ -269,11 +270,12 @@ D2D1_RECT_F D2DOverlaySVG::get_snap_right() const
D2DOverlayWindow::D2DOverlayWindow() :
total_screen({}),
background_animation(0.3),
global_windows_shortcuts_animation(0.3),
taskbar_icon_shortcuts_animation(0.3),
D2DWindow()
{
BOOL isEnabledAnimations = GetAnimationsEnabled();
background_animation = isEnabledAnimations? 0.3f : 0.f;
global_windows_shortcuts_animation = isEnabledAnimations ? 0.3f : 0.f;
taskbar_icon_shortcuts_animation = isEnabledAnimations ? 0.3f : 0.f;
tasklist_thread = std::thread([&] {
while (running)
{

View File

@@ -7,6 +7,7 @@
#include <vector>
#include <common/logger/logger.h>
#include <common/utils/MsWindowsSettings.h>
namespace
{
@@ -125,6 +126,12 @@ ZonesOverlay::RenderResult ZonesOverlay::Render()
return RenderResult::AnimationEnded;
}
BOOL isEnabledAnimations = GetAnimationsEnabled();
if (!isEnabledAnimations)
{
animationAlpha = 1.f;
}
m_renderTarget->BeginDraw();
// Draw backdrop