diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-27 14:58:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-28 13:31:44 +0100 |
commit | 794d5a3bb225bbfaced4dd968734783f073ba70b (patch) | |
tree | 3cf7e9224e3bc8b0345bfc44e5958e45c4186f61 /svtools | |
parent | 270d134752568158ddad9cd8c783879203684a06 (diff) |
don't put focus into unmapped windows
defer until the color selectors are activated to grab focus, otherwise
esc doesn't work to close a dialog under gtk3 until focus is put
into some visible widget
Change-Id: I297c2738c4103024bbefd70bbcb5d72b8429dd3e
Reviewed-on: https://gerrit.libreoffice.org/83917
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit e55a1dc163165cb79fc9113101d16ee8d3db7298)
Reviewed-on: https://gerrit.libreoffice.org/83966
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 61d1d9e729ac..8efb03a0e568 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1536,6 +1536,7 @@ SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl) m_xTopLevel->connect_focus_in(LINK(this, SvtLineListBox, FocusHdl)); m_xControl->set_popover(m_xTopLevel.get()); + m_xControl->connect_toggled(LINK(this, SvtLineListBox, ToggleHdl)); // lock size to these maxes height/width so it doesn't jump around in size m_xControl->set_label(GetLineStyleName(SvxBorderLineStyle::NONE)); @@ -1563,6 +1564,12 @@ IMPL_LINK_NOARG(SvtLineListBox, FocusHdl, weld::Widget&, void) m_xLineSet->GrabFocus(); } +IMPL_LINK(SvtLineListBox, ToggleHdl, weld::ToggleButton&, rButton, void) +{ + if (rButton.get_active()) + FocusHdl(*m_xTopLevel); +} + IMPL_LINK_NOARG(SvtLineListBox, NoneHdl, weld::Button&, void) { SelectEntry(SvxBorderLineStyle::NONE); @@ -1595,15 +1602,9 @@ sal_Int32 SvtLineListBox::GetStylePos( sal_Int32 nListPos ) void SvtLineListBox::SelectEntry(SvxBorderLineStyle nStyle) { if (nStyle == SvxBorderLineStyle::NONE) - { m_xLineSet->SetNoSelection(); - m_xNoneButton->grab_focus(); - } else - { m_xLineSet->SelectItem(static_cast<sal_Int16>(nStyle) + 1); - m_xLineSet->GrabFocus(); - } UpdatePreview(); } |