diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-11 15:04:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-11 20:30:58 +0200 |
commit | bed1bd821384f00ee02ec80594ee0fc4c5f15abe (patch) | |
tree | 3c471ecbdc6b5d6bccd5fe504d5da757a7c491a5 | |
parent | be2f539012d818eaa2d40a9cf199b53d32e1dee4 (diff) |
allow tabbing between native widgets in floating windows
i.e. in the calc autofilter menu-alike popups
Change-Id: I93fc74325b8d39807e5126fc694addd3d0a50d53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96127
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 5f2ec2a152b2..62307f5deef0 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3087,16 +3087,23 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f return false; } +// change of focus between native widgets within the toplevel void GtkSalFrame::signalSetFocus(GtkWindow*, GtkWidget* pWidget, gpointer frame) { - // do not propagate focus get/lose if floats are open - if (m_nFloats) - return; - // change of focus between native widgets within the toplevel GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame); + + GtkWidget* pGrabWidget; + if (GTK_IS_EVENT_BOX(pThis->m_pWindow)) + pGrabWidget = GTK_WIDGET(pThis->m_pWindow); + else + pGrabWidget = GTK_WIDGET(pThis->m_pFixedContainer); + // tdf#129634 interpret losing focus as focus passing explicitly to another widget - bool bLoseFocus = pWidget && pWidget != GTK_WIDGET(pThis->m_pFixedContainer); + bool bLoseFocus = pWidget && pWidget != pGrabWidget; + + // do not propagate focus get/lose if floats are open pThis->CallCallbackExc(bLoseFocus ? SalEvent::LoseFocus : SalEvent::GetFocus, nullptr); + gtk_widget_set_can_focus(GTK_WIDGET(pThis->m_pFixedContainer), !bLoseFocus); } |