Sync from SUSE:SLFO:Main tecla-keyboard-layout-viewer revision 2a67b6021902e9f6c03353b21d500a9f

This commit is contained in:
Adrian Schröter 2024-07-22 17:46:28 +02:00
commit ed58394f75
6 changed files with 215 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
tecla-45.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
commit 931112aec0ba5a626327d8cb490b0b86e4c0b55c
Author: Carlos Garnacho <carlosg@gnome.org>
Date: Thu Sep 21 13:23:00 2023 +0200
application: Handle TeclaModel constructor possibly returning NULL
This might be the case if an unknown keymap name is passed as a
commandline argument. We ATM just show a window with empty keys,
so there's room for improvement in the future (e.g. state that
the keymap does not exist).
diff -Nura tecla-45.0/src/tecla-application.c tecla-45.0_new/src/tecla-application.c
--- tecla-45.0/src/tecla-application.c 2023-09-17 01:02:57.000000000 +0800
+++ tecla-45.0_new/src/tecla-application.c 2024-03-31 16:28:22.603133598 +0800
@@ -375,11 +375,14 @@
if (tecla_app->layout) {
tecla_app->main_model =
tecla_model_new_from_layout_name (tecla_app->layout);
- connect_model (tecla_app->main_window,
- tecla_app->main_view,
- tecla_app->main_model);
- g_clear_pointer (&tecla_app->layout, g_free);
- update_title (tecla_app->main_window, tecla_app->main_model);
+
+ if (tecla_app->main_model) {
+ connect_model (tecla_app->main_window,
+ tecla_app->main_view,
+ tecla_app->main_model);
+ g_clear_pointer (&tecla_app->layout, g_free);
+ update_title (tecla_app->main_window, tecla_app->main_model);
+ }
}
gtk_window_present (tecla_app->main_window);

View File

@ -0,0 +1,51 @@
-------------------------------------------------------------------
Mon Mar 25 17:59:06 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add tecla-return-NULL-if-no-xkb_keymap.patch:
Backporting d6760195 from upstream, Fix tecla crash in Czech(QWERTY)
keyboard in SLE. avoid to return NULL if no xkb_keymap could be
created due to does not know about the given name/variant.
(bsc#1220208)
-------------------------------------------------------------------
Mon Mar 25 17:50:12 UTC 2024 - Cliff Zhao <qzhao@suse.com>
- Add tecla-handle-TeclaModel-constructor-returning-NULL.patch:
Backporting 931112ae from upstream, Fix tecla crash in Czech(QWERTY)
keyboard in SLE. This might be the case if an unknown keymap name
is passed as a commandline argument. We ATM just show a window with
empty keys.
(bsc#1220208)
-------------------------------------------------------------------
Sat Sep 16 15:34:13 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 45.0:
+ Added shortcuts to exit the dialog
+ Fix UI in RTL environments
+ Fix a11y initialization
+ Updated translations.
-------------------------------------------------------------------
Wed Sep 6 03:27:17 UTC 2023 - Luciano Santos <luc14n0@opensuse.org>
- Update to version 45.rc:
+ Handle 105 key layouts.
+ Handle keymap variants in commandline arguments.
+ Fix overeager keymap listener overriding commandline arguments.
+ Fix included license.
+ Updated translations.
- Update GPL-3.0-only License tag to GPL-2.0-only following
upstream amend.
-------------------------------------------------------------------
Fri Aug 11 10:34:53 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 45.beta:
+ Updated translations.
- Add lang package macro, package the translations now available.
-------------------------------------------------------------------
Sat Jul 22 11:47:50 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>
- Initial release.

View File

@ -0,0 +1,66 @@
#
# spec file for package tecla-keyboard-layout-viewer
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: tecla-keyboard-layout-viewer
Version: 45.0
Release: 0
Summary: A keyboard layout viewer
License: GPL-2.0-only
URL: https://gitlab.gnome.org/GNOME/tecla
Source: https://download.gnome.org/sources/tecla/45/tecla-%{version}.tar.xz
# PATCH-FIX-UPSTREAM tecla-handle-TeclaModel-constructor-returning-NULL.patch bsc#1220208 qzhao@suse.com -- Handle TeclaModel constructor possibly returning NULL.
Patch0: tecla-handle-TeclaModel-constructor-returning-NULL.patch
# PATCH-FIX-UPSTREAM tecla-return-NULL-if-no-xkb_keymap.patch bsc#1220208 qzhao@suse.com -- Return NULL if no xkb_keymap could be created to avoid tecla crash.
Patch1: tecla-return-NULL-if-no-xkb_keymap.patch
BuildRequires: c_compiler
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: pkgconfig(gtk4)
BuildRequires: pkgconfig(gtk4-wayland)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(libadwaita-1) >= 1.4
BuildRequires: pkgconfig(xkbcommon)
%description
%{summary} from the GNOME project.
%lang_package
%prep
%autosetup -p1 -n tecla-%{version}
%build
%meson
%meson_build
%install
%meson_install
%find_lang tecla %{?no_lang_C}
%files
%license LICENSE
%doc NEWS README.md
%{_bindir}/tecla
%{_datadir}/applications/org.gnome.Tecla.desktop
%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Tecla.svg
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Tecla-symbolic.svg
%{_datadir}/pkgconfig/tecla.pc
%files lang -f tecla.lang
%changelog

View File

@ -0,0 +1,38 @@
commit d6760195ab13d29bce1c6590638e4200cd6632f2 (HEAD -> d6760195ab13d29bce1c6590638e4200cd6632f2)
Author: Carlos Garnacho <carlosg@gnome.org>
Date: Thu Sep 21 13:24:58 2023 +0200
model: Return NULL if no xkb_keymap could be created
Right now we are somewhat optimistic that the passed keymap
name does exist, triggering crashes if it does not. Make
TeclaModel constructors return NULL if XKB does not know
about the given name/variant.
Closes: https://gitlab.gnome.org/GNOME/tecla/-/issues/16
diff -Nura tecla-45.0/src/tecla-model.c tecla-45.0_new/src/tecla-model.c
--- tecla-45.0/src/tecla-model.c 2023-09-17 01:02:57.000000000 +0800
+++ tecla-45.0_new/src/tecla-model.c 2024-03-31 16:46:54.193944659 +0800
@@ -299,7 +299,7 @@
TeclaModel *
tecla_model_new_from_layout_name (const gchar *name)
{
- TeclaModel *model;
+ TeclaModel *model = NULL;
struct xkb_context *xkb_context;
struct xkb_keymap *xkb_keymap;
g_autofree gchar *layout = NULL;
@@ -325,8 +325,10 @@
xkb_keymap = xkb_keymap_new_from_names (xkb_context, &rule_names, 0);
xkb_context_unref (xkb_context);
- model = tecla_model_new_from_xkb_keymap (xkb_keymap);
- xkb_keymap_unref (xkb_keymap);
+ if (xkb_keymap) {
+ model = tecla_model_new_from_xkb_keymap (xkb_keymap);
+ xkb_keymap_unref (xkb_keymap);
+ }
return model;
}