vcl/inc/win/salframe.h | 1 + vcl/win/window/salframe.cxx | 7 +++++++ 2 files changed, 8 insertions(+)
New commits: commit 609ed2944b030a692c942428afa8bf7c3ac93672 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 25 13:08:14 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Jul 25 14:48:38 2023 +0200 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 <plub...@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.wegh...@posteo.de> 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 ) {