diff --git a/_service b/_service
index 525fca1..59e5a44 100644
--- a/_service
+++ b/_service
@@ -5,7 +5,7 @@
git
@PARENT_TAG@
enable
- refs/tags/3.46.3
+ refs/tags/3.46.4
diff --git a/_servicedata b/_servicedata
index 8a69af8..3fe4baa 100644
--- a/_servicedata
+++ b/_servicedata
@@ -1,4 +1,4 @@
https://gitlab.gnome.org/GNOME/gnome-terminal.git
- bce00598029491f06a0681834014409dc264bf27
\ No newline at end of file
+ 44d55c8626d609d61905ef5cf11f0af2d7b7acd4
\ No newline at end of file
diff --git a/f06e6e5.patch b/f06e6e5.patch
new file mode 100644
index 0000000..b94ff17
--- /dev/null
+++ b/f06e6e5.patch
@@ -0,0 +1,79 @@
+From f06e6e5821a1a718431d25ccd8d08225ba66dd58 Mon Sep 17 00:00:00 2001
+From: Christian Persch
+Date: Sun, 6 Nov 2022 15:58:05 +0100
+Subject: [PATCH] util: Fix interpretation of TryExec desktop entry key
+
+The TryExec key is optional, so only evalute it if it is present.
+Also, it may contain an abolute path, in which case we skip searching
+the PATH for the executable.
+
+Fixes: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7944
+(cherry picked from commit 78971c71992e7dcf021743dc8873a2088245335c)
+---
+ src/terminal-util.cc | 39 +++++++++++++++++++++++++++------------
+ 1 file changed, 27 insertions(+), 12 deletions(-)
+
+diff --git a/src/terminal-util.cc b/src/terminal-util.cc
+index fcdd939a..3ee8f51b 100644
+--- a/src/terminal-util.cc
++++ b/src/terminal-util.cc
+@@ -1626,29 +1626,44 @@ xte_data_check_one(char const* file,
+ return false;
+ }
+
+- // As per the XDG desktop entry spec, the TryExec key contains the name
+- // of an executable that can be used to determine if the programme is
+- // actually present.
++ // As per the XDG desktop entry spec, the (optional) TryExec key contains
++ // the name of an executable that can be used to determine if the programme
++ // is actually present.
+ gs_free auto try_exec = g_key_file_get_string(kf,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_TRY_EXEC,
+ nullptr);
+- if (!try_exec) {
++ if (try_exec && try_exec[0]) {
+ _terminal_debug_print(TERMINAL_DEBUG_DEFAULT,
+ "Desktop file \"%s\" has no TryExec field.\n",
+ file);
+
+- return false;
+- }
++ // TryExec may be an abolute path, or be searched in $PATH
++ gs_free char* exec_path = nullptr;
++ if (g_path_is_absolute(try_exec))
++ exec_path = g_strdup(try_exec);
++ else
++ exec_path = g_find_program_in_path(try_exec);
+
+- gs_free auto exec_path = g_find_program_in_path(try_exec);
+- auto const exists = exec_path != nullptr;
++ auto const exists = exec_path != nullptr &&
++ g_file_test(exec_path, GFileTest(G_FILE_TEST_IS_EXECUTABLE));
+
+- _terminal_debug_print(TERMINAL_DEBUG_DEFAULT,
+- "Desktop file \"%s\" is %sinstalled.\n",
+- file, exists ? "" : "not ");
++ _terminal_debug_print(TERMINAL_DEBUG_DEFAULT,
++ "Desktop file \"%s\" is %sinstalled (TryExec).\n",
++ file, exists ? "" : "not ");
++
++ if (!exists)
++ return false;
++ } else {
++ // TryExec is not present. We could fall back to parsing the Exec
++ // key and look if its first argument points to an executable that
++ // exists on the system, but that may also fail if the desktop file
++ // is DBusActivatable=true in which case we would need to find
++ // out if the D-Bus service corresponding to the name of the desktop
++ // file (without the .desktop extension) is activatable.
++ }
+
+- return exists;
++ return true;
+ }
+
+ static bool
+--
+GitLab
+
diff --git a/gnome-terminal-3.46.3.obscpio b/gnome-terminal-3.46.3.obscpio
deleted file mode 100644
index 2b70b40..0000000
--- a/gnome-terminal-3.46.3.obscpio
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:0dbd7a2b1d200e1716eba069a33b8c36736f58bcf9b4e7b647173101c9285698
-size 13940237
diff --git a/gnome-terminal-3.46.4.obscpio b/gnome-terminal-3.46.4.obscpio
new file mode 100644
index 0000000..da9f475
--- /dev/null
+++ b/gnome-terminal-3.46.4.obscpio
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:43895d4a1dea5777c8e117992e6be9ba2d166b6f0a30619c76174baa56631b57
+size 13939725
diff --git a/gnome-terminal.changes b/gnome-terminal.changes
index 7b6e862..3099183 100644
--- a/gnome-terminal.changes
+++ b/gnome-terminal.changes
@@ -1,3 +1,18 @@
+-------------------------------------------------------------------
+Mon Nov 07 20:02:37 UTC 2022 - bjorn.lie@gmail.com
+
+- Update to version 3.46.4:
+ * all: backport: Implement xdg-terminal-exec support.
+ * docs:
+ - Fix some wrong info in README.
+ - Fix some typos in README.
+ * Updated translations.
+- Add f06e6e5.patch: util: Fix interpretation of TryExec desktop
+ entry key.
+- Add appstream-glib and desktop-file-utils BuildRequires and a
+ check section with meson_test macro, validate appdata and desktop
+ files and run tests during build.
+
-------------------------------------------------------------------
Thu Oct 27 11:11:44 UTC 2022 - bjorn.lie@gmail.com
diff --git a/gnome-terminal.obsinfo b/gnome-terminal.obsinfo
index 4ed8512..ab7fa1b 100644
--- a/gnome-terminal.obsinfo
+++ b/gnome-terminal.obsinfo
@@ -1,4 +1,4 @@
name: gnome-terminal
-version: 3.46.3
-mtime: 1666369620
-commit: bce00598029491f06a0681834014409dc264bf27
+version: 3.46.4
+mtime: 1667331403
+commit: 44d55c8626d609d61905ef5cf11f0af2d7b7acd4
diff --git a/gnome-terminal.spec b/gnome-terminal.spec
index 4a9dde4..ab3df76 100644
--- a/gnome-terminal.spec
+++ b/gnome-terminal.spec
@@ -18,14 +18,18 @@
%bcond_without nautilus_extension
Name: gnome-terminal
-Version: 3.46.3
+Version: 3.46.4
Release: 0
Summary: GNOME Terminal
License: GPL-3.0-or-later AND LGPL-2.1-or-later
Group: System/X11/Terminals
URL: https://wiki.gnome.org/Apps/Terminal
Source0: %{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM f06e6e5.patch -- util: Fix interpretation of TryExec desktop entry key
+Patch0: https://gitlab.gnome.org/GNOME/gnome-terminal/-/commit/f06e6e5.patch
+BuildRequires: appstream-glib
+BuildRequires: desktop-file-utils
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
@@ -101,6 +105,13 @@ rm %{buildroot}/usr/share/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml
%find_lang %{name} %{?no_lang_C}
%fdupes %{buildroot}%{_datadir}
+%check
+appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/org.gnome.Terminal*.metainfo.xml
+desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Terminal.desktop
+desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Terminal.Preferences.desktop
+desktop-file-validate %{buildroot}%{_datadir}/xdg-terminals/org.gnome.Terminal.desktop
+%meson_test
+
%files
%license COPYING
%doc %{_datadir}/help/C/%{name}/
@@ -108,6 +119,8 @@ rm %{buildroot}/usr/share/metainfo/org.gnome.Terminal.Nautilus.metainfo.xml
%{_datadir}/metainfo/org.gnome.Terminal.metainfo.xml
%{_datadir}/applications/org.gnome.Terminal.desktop
%{_datadir}/applications/org.gnome.Terminal.Preferences.desktop
+%dir %{_datadir}/xdg-terminals
+%{_datadir}/xdg-terminals/org.gnome.Terminal.desktop
%{_libexecdir}/gnome-terminal-server
%{_datadir}/dbus-1/services/org.gnome.Terminal.service
%{_datadir}/glib-2.0/schemas/org.gnome.Terminal.gschema.xml