summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2024-04-27 14:14:04 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-05-16 12:50:31 +0200
commite0b930e1ddf008d202c3620fdc6652483f914835 (patch)
treef874309168eb7f3ceefc088e55cd25a985e1a277 /vcl/source/window/window.cxx
parent7fc7d3b9fe6eabeddf43fbf72a041854fda51b27 (diff)
VCL: Windows: more usecases for FlashWindow() API to inform on changes
FlashWindow() can be used to bring user attention to application in background. Right now in LO it has implementation only for Windows. Here some new cases were added when flashing is used: * dialog window did open * document loaded * LO started Some redesign of previous solution is also performed: no manual search for top window, let's reuse existing code. Changed behavior for bringing LO window to foreground: it is made always and not depending on current value of NewDocumentHandling:ForceFocusAndToFront. It has no sense to tweak this behavior: if user clicks on document in file explorer, LO should came to foreground, no exceptions. Change-Id: I22b5b4e2b170cd25632083a55b3e9f0358bcae03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166615 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3cb43a8a4a05..8411888fe9ee 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2316,14 +2316,20 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
// If it is a SystemWindow it automatically pops up on top of
// all other windows if needed.
- if ( ImplIsOverlapWindow() && !(nFlags & ShowFlags::NoActivate) )
+ if (ImplIsOverlapWindow())
{
- ImplStartToTop(( nFlags & ShowFlags::ForegroundTask ) ? ToTopFlags::ForegroundTask : ToTopFlags::NONE );
- ImplFocusToTop( ToTopFlags::NONE, false );
- }
+ if (!(nFlags & ShowFlags::NoActivate))
+ {
+ ImplStartToTop((nFlags & ShowFlags::ForegroundTask) ? ToTopFlags::ForegroundTask
+ : ToTopFlags::NONE);
+ ImplFocusToTop(ToTopFlags::NONE, false);
- if (!HasFocus() && GetParent()) {
- GetParent()->FlashWindow();
+ if (!(nFlags & ShowFlags::ForegroundTask))
+ {
+ // Inform user about window if we did not popup it at foreground
+ FlashWindow();
+ }
+ }
}
// adjust mpWindowImpl->mbReallyVisible