commit ed58394f75b4b3c279d78cbe2c314f5c190cdbf9f2f851be32daf622330f0a24 Author: Adrian Schröter Date: Mon Jul 22 17:46:28 2024 +0200 Sync from SUSE:SLFO:Main tecla-keyboard-layout-viewer revision 2a67b6021902e9f6c03353b21d500a9f diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/tecla-45.0.tar.xz b/tecla-45.0.tar.xz new file mode 100644 index 0000000..3e952f5 --- /dev/null +++ b/tecla-45.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c02bb4019b1cffb5663da6107503eff853836a8783dd4705dd04a49f7adc25b +size 33404 diff --git a/tecla-handle-TeclaModel-constructor-returning-NULL.patch b/tecla-handle-TeclaModel-constructor-returning-NULL.patch new file mode 100644 index 0000000..04b08c0 --- /dev/null +++ b/tecla-handle-TeclaModel-constructor-returning-NULL.patch @@ -0,0 +1,34 @@ +commit 931112aec0ba5a626327d8cb490b0b86e4c0b55c +Author: Carlos Garnacho +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); diff --git a/tecla-keyboard-layout-viewer.changes b/tecla-keyboard-layout-viewer.changes new file mode 100644 index 0000000..9b913b9 --- /dev/null +++ b/tecla-keyboard-layout-viewer.changes @@ -0,0 +1,51 @@ +------------------------------------------------------------------- +Mon Mar 25 17:59:06 UTC 2024 - Cliff Zhao + +- 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 + +- 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 + +- 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 + +- 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 + +- 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 + +- Initial release. diff --git a/tecla-keyboard-layout-viewer.spec b/tecla-keyboard-layout-viewer.spec new file mode 100644 index 0000000..f16767e --- /dev/null +++ b/tecla-keyboard-layout-viewer.spec @@ -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 diff --git a/tecla-return-NULL-if-no-xkb_keymap.patch b/tecla-return-NULL-if-no-xkb_keymap.patch new file mode 100644 index 0000000..8c21cc6 --- /dev/null +++ b/tecla-return-NULL-if-no-xkb_keymap.patch @@ -0,0 +1,38 @@ +commit d6760195ab13d29bce1c6590638e4200cd6632f2 (HEAD -> d6760195ab13d29bce1c6590638e4200cd6632f2) +Author: Carlos Garnacho +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; + }