gnome-terminal/gnome-terminal-3.45.90-nautilus-extension.patch
2022-08-17 11:28:46 +01:00

191 lines
6.1 KiB
Diff

From 699ad74e98cf0d757798fdc0eeed53dd13207ea3 Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@src.gnome.org>
Date: Wed, 10 Aug 2022 18:12:39 +0200
Subject: [PATCH 1/4] build: Update nautilus extension build req
With the nautilus gtk4 port, the pkg-config name has changed.
---
meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 7a892ed1..eeb14c4b 100644
--- a/meson.build
+++ b/meson.build
@@ -56,7 +56,7 @@ gtk_min_req_version = '3.18'
gtk_max_allowed_version = '3.24'
dconf_req_version = '0.14.0'
-libnautilus_ext_req_version = '3.28.0'
+libnautilus_ext_req_version = '43'
pcre2_req_version = '10.00'
schemas_req_version = '0.1.0'
@@ -333,7 +333,7 @@ schemas_dep = dependency('gsettings-desktop-schemas',
uuid_dep = dependency('uuid')
if get_option('nautilus_extension')
- libnautilus_extension_dep = dependency('libnautilus-extension', version: '>=' + libnautilus_ext_req_version,)
+ libnautilus_extension_dep = dependency('libnautilus-extension-4', version: '>=' + libnautilus_ext_req_version,)
else
libnautilus_extension_dep = dependency('', required: false,)
endif
--
2.37.2
From f0b0354f59def21c4cf077dd6b87ba711b21e4a5 Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@src.gnome.org>
Date: Wed, 10 Aug 2022 18:37:26 +0200
Subject: [PATCH 2/4] build: Fix nautilus extension install directory
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index eeb14c4b..0b5e8282 100644
--- a/meson.build
+++ b/meson.build
@@ -85,7 +85,7 @@ gt_schemadir = gt_datadir / 'glib-2.0' / 'schemas'
gt_searchproviderdir = gt_datadir / 'gnome-shell' / 'search-providers'
-gt_nautilusextensiondir = gt_libdir / 'nautilus' / 'extensions-3.0'
+gt_nautilusextensiondir = gt_libdir / 'nautilus' / 'extensions-4'
gt_dbusinterfacedir = gt_datadir / 'dbus-1' / 'interfaces'
gt_dbusservicedir = gt_datadir / 'dbus-1' / 'services'
--
2.37.2
From 388d8d2c1ed87c6dcf60e22c2da1482b9cbafd5d Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@src.gnome.org>
Date: Mon, 15 Aug 2022 20:56:17 +0200
Subject: [PATCH 3/4] nautilus: Don't include gdk headers in the nautilus
extension
https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7916
---
src/meson.build | 1 +
src/terminal-client-utils.cc | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/meson.build b/src/meson.build
index 99f47f82..97271278 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -358,6 +358,7 @@ if get_option('nautilus_extension')
]
nautilus_cxxflags = glib_version_cxxflags + [
+ '-DTERMINAL_NAUTILUS',
'-DTERM_LOCALEDIR="@0@"'.format(gt_prefix / gt_localedir),
]
diff --git a/src/terminal-client-utils.cc b/src/terminal-client-utils.cc
index acd1719f..9158d65c 100644
--- a/src/terminal-client-utils.cc
+++ b/src/terminal-client-utils.cc
@@ -29,10 +29,12 @@
#include <gio/gio.h>
+#ifndef TERMINAL_NAUTILUS
#include <gdk/gdk.h>
#if defined(TERMINAL_COMPILATION) && defined(GDK_WINDOWING_X11)
#include <gdk/gdkx.h>
#endif
+#endif
/**
* terminal_client_append_create_instance_options:
@@ -268,6 +270,8 @@ terminal_client_append_exec_options (GVariantBuilder *builder,
}
}
+#ifndef TERMINAL_NAUTILUS
+
/**
* terminal_client_get_fallback_startup_id:
*
@@ -333,6 +337,8 @@ out:
return nullptr;
}
+#endif /* !TERMINAL_NAUTILUS */
+
GSettings*
terminal_g_settings_new_with_path (GSettingsSchemaSource* source,
char const* schema_id,
--
2.37.2
From 7946c7fc0f0ea24c9501667e965a355c388a2da9 Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@src.gnome.org>
Date: Tue, 16 Aug 2022 23:19:34 +0200
Subject: [PATCH 4/4] nautilus: Try to fix the build with nautilus 43
Remove all use of gtk/gdk from the nautilus extension.
https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/7916
---
src/terminal-nautilus.cc | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/terminal-nautilus.cc b/src/terminal-nautilus.cc
index 4b4bbd8d..9a3ea78a 100644
--- a/src/terminal-nautilus.cc
+++ b/src/terminal-nautilus.cc
@@ -22,7 +22,6 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
-#include <gtk/gtk.h>
/* Work around https://gitlab.gnome.org/GNOME/nautilus/-/issues/1884 */
extern "C" {
@@ -325,7 +324,7 @@ create_terminal (ExecData *data /* transfer full */)
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
terminal_client_append_create_instance_options (&builder,
- gdk_display_get_name (gdk_display_get_default ()),
+ nullptr, // display name. FIXMEgtk4?
startup_id,
nullptr /* geometry */,
nullptr /* role */,
@@ -461,11 +460,7 @@ terminal_nautilus_menu_item_activate (NautilusMenuItem *item)
data = g_new (ExecData, 1);
data->nautilus = (TerminalNautilus*)g_object_ref (nautilus);
-#if GTK_CHECK_VERSION (4, 0, 0)
- data->timestamp = GDK_CURRENT_TIME; /* FIXMEgtk4 */
-#else
- data->timestamp = gtk_get_current_event_time ();
-#endif
+ data->timestamp = 0; // GDK_CURRENT_TIME
data->path = path;
data->uri = uri;
data->info = info;
@@ -587,7 +582,6 @@ terminal_nautilus_menu_item_new (TerminalNautilus *nautilus,
static GList *
terminal_nautilus_get_background_items (NautilusMenuProvider *provider,
- GtkWidget *window,
NautilusFileInfo *file_info)
{
TerminalNautilus *nautilus = TERMINAL_NAUTILUS (provider);
@@ -636,7 +630,6 @@ terminal_nautilus_get_background_items (NautilusMenuProvider *provider,
static GList *
terminal_nautilus_get_file_items (NautilusMenuProvider *provider,
- GtkWidget *window,
GList *files)
{
TerminalNautilus *nautilus = TERMINAL_NAUTILUS (provider);
--
2.37.2