vcl/source/app/salvtables.cxx | 9 ++++++++- vcl/unx/gtk3/gtk3gtkinst.cxx | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit 3a8bf7fdf6c07cfc5df919263676fdece658aada Author: Caolán McNamara <[email protected]> AuthorDate: Sat Mar 23 20:34:52 2019 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Mar 23 22:47:11 2019 +0100 ComboBoxes have subwidgets in them, combine together for has_focus Change-Id: Id57190ebf478641ad2a1ac79ef6a01fbb69af1ed Reviewed-on: https://gerrit.libreoffice.org/69592 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b645b0384ae5..6a27b64f2974 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -667,7 +667,7 @@ void SalInstanceWidget::HandleEventListener(VclWindowEvent& rEvent) bool SalInstanceWidget::HandleKeyEventListener(VclWindowEvent& rEvent) { // we get all key events here, ignore them unless we have focus - if (!m_xWidget->HasFocus()) + if (!has_focus()) return false; if (rEvent.GetId() == VclEventId::WindowKeyInput) { @@ -3849,6 +3849,13 @@ public: return static_cast<const OUString*>(m_xComboBox->GetEntryData(index)); } + // ComboBoxes are comprised of multiple subwidgets, consider the lot as + // one thing for focus + virtual bool has_focus() const override + { + return m_xWidget->HasChildPathFocus(); + } + virtual OUString get_active_id() const override { sal_Int32 nPos = m_xComboBox->GetSelectedEntryPos(); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index e0fda96cafac..18aaf556223d 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8369,6 +8369,11 @@ public: weld::Widget::connect_focus_out(rLink); } + virtual bool has_focus() const override + { + return gtk_widget_has_focus(m_pToggleButton) || GtkInstanceWidget::has_focus(); + } + virtual ~GtkInstanceComboBox() override { if (m_nAutoCompleteIdleId) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
