summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-11-10 18:06:23 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-11-11 01:47:42 +0100
commit343c63fd02a8685a01444659261c43d609fa5398 (patch)
tree6dd021b0404b814dddda3ecddf84281d2bf47b39 /vcl/qt5
parent62baf23796132d6c0e17ae1ff37c3b9ee0556cf0 (diff)
tdf#130857 qt weld: Implement QtInstanceWindow::has_toplevel_focus
Change-Id: I62099b15349c6fec52a79c3f59f85492ec325dff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176350 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/QtInstanceWindow.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx
index aecfa7618c5d..de4fa43285d6 100644
--- a/vcl/qt5/QtInstanceWindow.cxx
+++ b/vcl/qt5/QtInstanceWindow.cxx
@@ -63,7 +63,13 @@ AbsoluteScreenPixelRectangle QtInstanceWindow::get_monitor_workarea() const
void QtInstanceWindow::set_centered_on_parent(bool) {}
-bool QtInstanceWindow::has_toplevel_focus() const { return true; }
+bool QtInstanceWindow::has_toplevel_focus() const
+{
+ SolarMutexGuard g;
+ bool bFocus;
+ GetQtInstance().RunInMainThread([&] { bFocus = QApplication::activeWindow() == getQWidget(); });
+ return bFocus;
+}
void QtInstanceWindow::present()
{