include/vcl/window.hxx | 2 +- vcl/source/window/accessibility.cxx | 22 +++------------------- vcl/source/window/brdwin.cxx | 9 +++------ vcl/source/window/window.cxx | 2 +- vcl/source/window/window2.cxx | 12 ++++++++++++ 5 files changed, 20 insertions(+), 27 deletions(-)
New commits: commit eb812cb94f20dd04fa4cf3ec89df8bb813811359 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 16 19:07:54 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 18 06:04:44 2023 +0200 Rename Window::ImplIsAccessibleNativeFrame and make it public The way to determine whether this window is a "native frame" doesn't look particularly specific to a11y, so rename it to just `Window::IsNativeFrame` and make it public in order to reuse it in a follow-up commit. Also move the implementation out of the source file that implements accessibility-specific Window methods for consistency. Change-Id: I980f251cacce6a601e86fc6261a231b799b30317 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155798 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 2d64be451370..0f9c6f3f45b5 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -779,6 +779,7 @@ public: bool IsDialog() const; bool IsMenuFloatingWindow() const; bool IsToolbarFloatingWindow() const; + bool IsNativeFrame() const; bool IsTopWindow() const; SystemWindow* GetSystemWindow() const; @@ -1187,7 +1188,6 @@ protected: private: SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const; - SAL_DLLPRIVATE bool ImplIsAccessibleNativeFrame() const; ///@} /* diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index 0656720b6986..3c6103ac31d9 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -95,24 +95,12 @@ bool Window::ImplIsAccessibleCandidate() const if( !mpWindowImpl->mbBorderWin ) return true; - return ImplIsAccessibleNativeFrame(); -} - -bool Window::ImplIsAccessibleNativeFrame() const -{ - if( mpWindowImpl->mbFrame ) - // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable - if( mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) - return true; - else - return false; - else - return false; + return IsNativeFrame(); } vcl::Window* Window::GetAccessibleParentWindow() const { - if (!mpWindowImpl || ImplIsAccessibleNativeFrame()) + if (!mpWindowImpl || IsNativeFrame()) return nullptr; vcl::Window* pParent = mpWindowImpl->mpParent; @@ -327,7 +315,7 @@ sal_uInt16 Window::getDefaultAccessibleRole() const case WindowType::BORDERWINDOW: case WindowType::SYSTEMCHILDWINDOW: default: - if (ImplIsAccessibleNativeFrame() ) + if (IsNativeFrame() ) nRole = accessibility::AccessibleRole::FRAME; else if( IsScrollable() ) nRole = accessibility::AccessibleRole::SCROLL_PANE; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f7920f793f43..869516b45902 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -157,7 +157,7 @@ void Window::dispose() CallEventListeners( VclEventId::ObjectDying ); // do not send child events for frames that were registered as native frames - if( !ImplIsAccessibleNativeFrame() && mpWindowImpl->mbReallyVisible ) + if( !IsNativeFrame() && mpWindowImpl->mbReallyVisible ) if ( ImplIsAccessibleCandidate() && GetAccessibleParentWindow() ) GetAccessibleParentWindow()->CallEventListeners( VclEventId::WindowChildDestroyed, this ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 5e9ffd2ef529..c9720139585d 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1040,6 +1040,18 @@ bool Window::IsToolbarFloatingWindow() const return mpWindowImpl && mpWindowImpl->mbToolbarFloatingWindow; } +bool Window::IsNativeFrame() const +{ + if( mpWindowImpl->mbFrame ) + // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable + if( mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) + return true; + else + return false; + else + return false; +} + void Window::EnableAllResize() { mpWindowImpl->mbAllResize = true; commit 756febf9a889cc969c3c7812806ef999d0befb95 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 16 18:02:27 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 18 06:04:36 2023 +0200 vcl: Reuse existing Window::ImplIsAccessibleNativeFrame ... instead of duplicating what it does in `Window::ImplIsAccessibleCandidate`. Change-Id: If422597046447bbf30a0488ceed2cf1d2fa49c5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155797 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index cd6e50eddfe5..0656720b6986 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -94,12 +94,8 @@ bool Window::ImplIsAccessibleCandidate() const { if( !mpWindowImpl->mbBorderWin ) return true; - else - // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menus!) are closeable - if( mpWindowImpl->mbFrame && mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) - return true; - else - return false; + + return ImplIsAccessibleNativeFrame(); } bool Window::ImplIsAccessibleNativeFrame() const commit c192c46d3f2be5e48783d590313f875e1f0477a1 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 16 17:57:33 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 18 06:04:29 2023 +0200 vcl: Deduplicate 2 common lines for border win frames These 2 members are set the same way for all of the 3 branches. Change-Id: I2acbb519e30926eb5798bb52e1ef95dceca47b5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155796 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index f0d8e3bed83f..e7b569364021 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1519,22 +1519,19 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, mbSmallOutBorder = false; if ( nTypeStyle & BorderWindowStyle::Frame ) { + mpWindowImpl->mbOverlapWin = true; + mpWindowImpl->mbFrame = true; + if( nStyle & WB_SYSTEMCHILDWINDOW ) { - mpWindowImpl->mbOverlapWin = true; - mpWindowImpl->mbFrame = true; mbFrameBorder = false; } else if( nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP) ) { - mpWindowImpl->mbOverlapWin = true; - mpWindowImpl->mbFrame = true; mbFrameBorder = (nOrgStyle & WB_NOBORDER) == 0; } else { - mpWindowImpl->mbOverlapWin = true; - mpWindowImpl->mbFrame = true; mbFrameBorder = false; // closeable windows may have a border as well, eg. system floating windows without caption if ( (nOrgStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE/* | WB_CLOSEABLE*/)) == WB_BORDER )