vcl/qt5/QtInstanceWindow.cxx |   61 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 49 insertions(+), 12 deletions(-)

New commits:
commit fc53fdc8c3ce611c4e4effdb696a967aa042f00d
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sun Nov 10 18:20:03 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Nov 11 01:47:53 2024 +0100

    tdf#130857 qt weld: Assert in more unimplemented methods
    
    Add asserts, so that it becomes clear if any dialog
    wants to use logic that's not implemented yet, rather
    than just not doing what was requested.
    
    This helps prioritize what to implement while
    adding support for more dialogs.
    
    Change-Id: Iee708d96260d836879974b65e240ba7343b205f6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176351
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx
index de4fa43285d6..301c175823c7 100644
--- a/vcl/qt5/QtInstanceWindow.cxx
+++ b/vcl/qt5/QtInstanceWindow.cxx
@@ -48,20 +48,33 @@ OUString QtInstanceWindow::get_title() const
     return toOUString(getQWidget()->windowTitle());
 }
 
-void QtInstanceWindow::window_move(int, int) {}
+void QtInstanceWindow::window_move(int, int) { assert(false && "Not 
implemented yet"); }
 
-bool QtInstanceWindow::get_resizable() const { return true; }
+bool QtInstanceWindow::get_resizable() const
+{
+    assert(false && "Not implemented yet");
+    return true;
+}
 
-Size QtInstanceWindow::get_size() const { return Size(); }
+Size QtInstanceWindow::get_size() const
+{
+    assert(false && "Not implemented yet");
+    return Size();
+}
 
-Point QtInstanceWindow::get_position() const { return Point(); }
+Point QtInstanceWindow::get_position() const
+{
+    assert(false && "Not implemented yet");
+    return Point();
+}
 
 AbsoluteScreenPixelRectangle QtInstanceWindow::get_monitor_workarea() const
 {
+    assert(false && "Not implemented yet");
     return AbsoluteScreenPixelRectangle();
 }
 
-void QtInstanceWindow::set_centered_on_parent(bool) {}
+void QtInstanceWindow::set_centered_on_parent(bool) { assert(false && "Not 
implemented yet"); }
 
 bool QtInstanceWindow::has_toplevel_focus() const
 {
@@ -80,34 +93,52 @@ void QtInstanceWindow::present()
     });
 }
 
-void QtInstanceWindow::change_default_widget(weld::Widget*, weld::Widget*) {}
+void QtInstanceWindow::change_default_widget(weld::Widget*, weld::Widget*)
+{
+    assert(false && "Not implemented yet");
+}
 
-bool QtInstanceWindow::is_default_widget(const weld::Widget*) const { return 
true; }
+bool QtInstanceWindow::is_default_widget(const weld::Widget*) const
+{
+    assert(false && "Not implemented yet");
+    return true;
+}
 
-void QtInstanceWindow::set_window_state(const OUString&) {}
+void QtInstanceWindow::set_window_state(const OUString&) { assert(false && 
"Not implemented yet"); }
 
-OUString QtInstanceWindow::get_window_state(vcl::WindowDataMask) const { 
return OUString(); }
+OUString QtInstanceWindow::get_window_state(vcl::WindowDataMask) const
+{
+    assert(false && "Not implemented yet");
+    return OUString();
+}
 
 css::uno::Reference<css::awt::XWindow> QtInstanceWindow::GetXWindow()
 {
+    assert(false && "Not implemented yet");
     return css::uno::Reference<css::awt::XWindow>();
 }
 
 SystemEnvData QtInstanceWindow::get_system_data() const
 {
+    assert(false && "Not implemented yet");
     const SystemEnvData* pEnvData = nullptr;
 
     return *pEnvData;
 }
 
-void QtInstanceWindow::resize_to_request() {}
+void QtInstanceWindow::resize_to_request() { assert(false && "Not implemented 
yet"); }
 
 weld::ScreenShotCollection QtInstanceWindow::collect_screenshot_data()
 {
+    assert(false && "Not implemented yet");
     return weld::ScreenShotCollection();
 }
 
-VclPtr<VirtualDevice> QtInstanceWindow::screenshot() { return nullptr; }
+VclPtr<VirtualDevice> QtInstanceWindow::screenshot()
+{
+    assert(false && "Not implemented yet");
+    return nullptr;
+}
 
 const vcl::ILibreOfficeKitNotifier* QtInstanceWindow::GetLOKNotifier() { 
return nullptr; }
 
commit 343c63fd02a8685a01444659261c43d609fa5398
Author:     Michael Weghorn <[email protected]>
AuthorDate: Sun Nov 10 18:06:23 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Nov 11 01:47:42 2024 +0100

    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 <[email protected]>

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()
 {

Reply via email to