summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-12-09 09:41:50 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-12-10 14:26:04 +0100
commit55fe27bf56360c63b4349f2889734e964a2a0b68 (patch)
treef1c6273f19f11852d496d7f969dc284a9ad7195a /vcl
parent399d0559cbb721c1e0ca6b302e11889ddee97f90 (diff)
jsdialog: send info about initial focus in dialog
Change-Id: I9daef497cb083e863d45a2acfd7eee3ee92bdc38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126565 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 54d12e8945db..4adcce7180d1 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1299,7 +1299,7 @@ void Dialog::ImplSetModalInputMode( bool bModal )
}
}
-void Dialog::GrabFocusToFirstControl()
+vcl::Window* Dialog::GetFirstControlForFocus()
{
vcl::Window* pFocusControl = nullptr;
vcl::Window* pFirstOverlapWindow = ImplGetFirstOverlapWindow();
@@ -1323,6 +1323,13 @@ void Dialog::GrabFocusToFirstControl()
{
pFocusControl = ImplGetDlgWindow( 0, GetDlgWindowType::First );
}
+
+ return pFocusControl;
+}
+
+void Dialog::GrabFocusToFirstControl()
+{
+ vcl::Window* pFocusControl = GetFirstControlForFocus();
if ( pFocusControl )
pFocusControl->ImplControlFocus( GetFocusFlags::Init );
}
@@ -1672,6 +1679,10 @@ void Dialog::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
rJsonWriter.put("response", rResponse.second);
}
}
+
+ vcl::Window* pFocusControl = GetFirstControlForFocus();
+ if (pFocusControl)
+ rJsonWriter.put("init_focus_id", pFocusControl->get_id());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */