Resolves: rhbz#2021063 merge in fedora 34 changes

This commit is contained in:
Caolán McNamara 2021-11-08 20:40:26 +00:00
parent 60066a9a28
commit 574946824c
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,63 @@
From ea6cfca48017b76bfeb8898e6d9e47b3011a3add Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Sat, 6 Nov 2021 21:32:21 +0000
Subject: [PATCH] Resolves: tdf#145567 restore focus to the usual frame focus
widget
when tearing down the start center. Don't leave the focus in an
arbitrary widget.
Change-Id: I82c30c94121dc43b2ea1b4fbc66a0a3e79f7e664
---
vcl/unx/gtk3/gtk3gtkinst.cxx | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index a5d233e2f95e..0fddb27aaa2d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1899,6 +1899,26 @@ GdkDragAction VclToGdk(sal_Int8 dragOperation)
return eRet;
}
+GtkWindow* get_active_window()
+{
+ GtkWindow* pFocus = nullptr;
+
+ GList* pList = gtk_window_list_toplevels();
+
+ for (GList* pEntry = pList; pEntry; pEntry = pEntry->next)
+ {
+ if (gtk_window_has_toplevel_focus(GTK_WINDOW(pEntry->data)))
+ {
+ pFocus = GTK_WINDOW(pEntry->data);
+ break;
+ }
+ }
+
+ g_list_free(pList);
+
+ return pFocus;
+}
+
class GtkInstanceWidget : public virtual weld::Widget
{
protected:
@@ -16635,6 +16655,14 @@ private:
// rehook handler and let vcl cycle its own way through this widget's
// children
pFrame->AllowCycleFocusOut();
+
+ // tdf#145567 if the focus is in this hierarchy then, now that we are tearing down,
+ // move focus to the usual focus candidate for the frame
+ GtkWindow* pFocusWin = get_active_window();
+ GtkWidget* pFocus = pFocusWin ? gtk_window_get_focus(pFocusWin) : nullptr;
+ bool bHasFocus = pFocus && gtk_widget_is_ancestor(pFocus, pTopLevel);
+ if (bHasFocus)
+ pFrame->GrabFocus();
}
static void signalUnmap(GtkWidget*, gpointer user_data)
--
2.33.1

View File

@ -50,7 +50,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 1%{?libo_prerelease}%{?dist}
Release: 2%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/
@ -259,6 +259,7 @@ Patch10: 0001-rhbz-1980800-allow-convert-to-csv-to-write-each-shee.patch
Patch11: 0001-make-with-idlc-cpp-cpp-work-for-gcc-cpp-as-a-ucpp-re.patch
Patch12: 0001-Revert-tdf-101630-gdrive-support-w-oAuth-and-Drive-A.patch
Patch13: 0001-document-new-shouldn-t-get-prefixed-to-become-libreo.patch
Patch14: 0001-Resolves-tdf-145567-restore-focus-to-the-usual-frame.patch
# not upstreamed
Patch500: 0001-disable-libe-book-support.patch
@ -2245,6 +2246,9 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor &>/dev/null || :
%{_includedir}/LibreOfficeKit
%changelog
* Mon Nov 08 2021 Caolán McNamara <caolanm@redhat.com> - 1:7.1.7.2-2
- Resolves: tdf#145567 restore start center focus to the right widget
* Fri Oct 29 2021 Caolán McNamara <caolanm@redhat.com> - 1:7.1.7.2-1
- Resolves: rhbz#2014990 upgrade to 7.1.7