[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 18:31:38 UTC 2020
vcl/unx/gtk3/gtk3gtkframe.cxx | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
New commits:
commit bed1bd821384f00ee02ec80594ee0fc4c5f15abe
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 11 15:04:31 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 11 20:30:58 2020 +0200
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 at redhat.com>
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);
}
More information about the Libreoffice-commits
mailing list