summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-07-25 13:08:14 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2023-07-25 14:48:38 +0200
commit609ed2944b030a692c942428afa8bf7c3ac93672 (patch)
treebeb94400dc28f4293ccdc809498112c75b6fd221 /vcl
parentf3a4b6e1d71ed40d84ef65c6626fb7eb77a13545 (diff)
tdf#155414 win a11y: Honor system setting to disable animations
Use `SPI_GETCLIENTAREAANIMATION`, the "client area animation parameter [that] indicates whether the user wants to disable animations in UI elements" [1] to determine whether animations should be disabled. The parameter can be set in Windows, as documented in MDN docs for the "prefers-reduced-motion" CSS media feature [2]: > * In Windows 10: Settings > Ease of Access > Display > Show animations in Windows. > * In Windows 11: Settings > Accessibility > Visual Effects > Animation Effects On top of commit 9d68c794d67259a38de1465090f6f1e7fb588d62 Author: Patrick Luby <plubius@neooffice.org> Date: Fri Jul 21 19:55:02 2023 -0400 tdf#155414 include system "reduce animation" preferences , this implements the Windows equivalent of what that change does for macOS. [1] https://learn.microsoft.com/en-us/windows/win32/winauto/client-area-animation [2] https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion Change-Id: I1485cd7dc97b7d93abdeab78ec330874f2a5cb98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154889 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/win/salframe.h1
-rw-r--r--vcl/win/window/salframe.cxx7
2 files changed, 8 insertions, 0 deletions
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index 676c70c1eca0..564872e65d2c 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -141,6 +141,7 @@ public:
virtual void EndSetClipRegion() override;
virtual void UpdateDarkMode() override;
virtual bool GetUseDarkMode() const override;
+ virtual bool GetUseReducedAnimation() const override;
constexpr vcl::WindowState state() const { return m_eState; }
void UpdateFrameState();
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index c911fff0840f..d68178ea022f 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -3126,6 +3126,13 @@ bool WinSalFrame::GetUseDarkMode() const
return UseDarkMode();
}
+bool WinSalFrame::GetUseReducedAnimation() const
+{
+ BOOL bEnableAnimation = FALSE;
+ SystemParametersInfoW(SPI_GETCLIENTAREAANIMATION, 0, &bEnableAnimation, 0);
+ return !bEnableAnimation;
+}
+
static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{