vcl/unx/gtk3/gtk3gtkframe.cxx | 30 ++
1 file changed, 22 insertions(+), 8 deletions(-)
New commits:
commit e828b6095c30a261b830592ead10fba673175c6e
Author: Caolán McNamara
AuthorDate: Fri Apr 23 11:18:01 2021 +0100
Commit: Aron Budea
CommitDate: Wed Dec 22 17:33:21 2021 +0100
Related: tdf#140659 improve F6 task pane switching
for native gtk widgets inside vcl docking windows. Put vcl focus in
container on F6 so cycling moves between expected panes.
Change-Id: I70bd54493a345ae5bdb801caf79d567bc1ae0438
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114543
Tested-by: Jenkins
Reviewed-by: Caolán McNamara
(cherry picked from commit 57138e6cfa1dec2c44d7cca55171dca40d45aaa3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127283
Tested-by: Jenkins CollaboraOffice
Reviewed-by: Aron Budea
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 8637acd77684..55fc9968e927 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3371,19 +3371,28 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget,
GdkEventKey* pEvent, gpointe
}
else
{
+bool bRestoreDisallowCycleFocusOut = false;
+
+VclPtr xOrigFrameFocusWin;
VclPtr xOrigFocusWin;
if (xTopLevelInterimWindow)
{
-// Focus is inside a full-app InterimItemWindow send unconsumed
+// Focus is inside an InterimItemWindow so send unconsumed
// keystrokes to by setting it as the mpFocusWin
VclPtr xVclWindow = pThis->GetWindow();
ImplFrameData* pFrameData =
xVclWindow->ImplGetWindowImpl()->mpFrameData;
-xOrigFocusWin = pFrameData->mpFocusWin;
+xOrigFrameFocusWin = pFrameData->mpFocusWin;
pFrameData->mpFocusWin = xTopLevelInterimWindow;
-if (pEvent->keyval == GDK_KEY_F6)
+
+ImplSVData* pSVData = ImplGetSVData();
+xOrigFocusWin = pSVData->mpWinData->mpFocusWin;
+pSVData->mpWinData->mpFocusWin = xTopLevelInterimWindow;
+
+if (pEvent->keyval == GDK_KEY_F6 &&
pThis->IsCycleFocusOutDisallowed())
{
// For F6, allow the focus to leave the InterimItemWindow
pThis->AllowCycleFocusOut();
+bRestoreDisallowCycleFocusOut = true;
}
}
@@ -3400,14 +3409,19 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget,
GdkEventKey* pEvent, gpointe
if (xTopLevelInterimWindow)
{
-// Focus was inside a full-app InterimItemWindow, restore the
original
-// focus win, unless the focus was changed away from the
InterimItemWindow
-// which should only be possible with F6
+// Focus was inside an InterimItemWindow, restore the original
+// focus win, unless the focus was changed away from the
+// InterimItemWindow which should only be possible with F6
VclPtr xVclWindow = pThis->GetWindow();
ImplFrameData* pFrameData =
xVclWindow->ImplGetWindowImpl()->mpFrameData;
if (pFrameData->mpFocusWin == xTopLevelInterimWindow)
-pFrameData->mpFocusWin = xOrigFocusWin;
-if (pEvent->keyval == GDK_KEY_F6)
+pFrameData->mpFocusWin = xOrigFrameFocusWin;
+
+ImplSVData* pSVData = ImplGetSVData();
+if (pSVData->mpWinData->mpFocusWin == xTopLevelInterimWindow)
+pSVData->mpWinData->mpFocusWin = xOrigFocusWin;
+
+if (bRestoreDisallowCycleFocusOut)
{
// undo the above AllowCycleFocusOut for F6
pThis->DisallowCycleFocusOut();