Keep new ShimMetaContext type private

Related: #2055366
This commit is contained in:
Florian Müllner 2022-04-05 17:19:54 +02:00
parent 8fcd3f19f6
commit a94de387fa
2 changed files with 53 additions and 54 deletions

View File

@ -2,7 +2,7 @@
Name: gnome-shell Name: gnome-shell
Version: 40.9 Version: 40.9
Release: 4%{?dist} Release: 5%{?dist}
Summary: Window management and application launching for GNOME Summary: Window management and application launching for GNOME
License: GPLv2+ License: GPLv2+
@ -261,6 +261,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%{_mandir}/man1/gnome-shell.1* %{_mandir}/man1/gnome-shell.1*
%changelog %changelog
* Tue Apr 05 2022 Florian Müllner <fmuellner@redhat.com>- 40.9-5
- Keep new ShimMetaContext type private
Related: #2055366
* Fri Apr 01 2022 Florian Müllner <fmuellner@redhat.com>- 40.9-4 * Fri Apr 01 2022 Florian Müllner <fmuellner@redhat.com>- 40.9-4
- Restrict D-Bus callers - Restrict D-Bus callers
Resolves: #2055366 Resolves: #2055366

View File

@ -1,4 +1,4 @@
From 71a4197471cdd482e4f7f7b2379598bb3d55dc2b Mon Sep 17 00:00:00 2001 From eb26ea5e1bb0c6fc978aae5db99ed3427b34175b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 1 Apr 2022 19:40:31 +0200 Date: Fri, 1 Apr 2022 19:40:31 +0200
Subject: [PATCH 01/12] shell/global: Expose shim context property Subject: [PATCH 01/12] shell/global: Expose shim context property
@ -10,23 +10,32 @@ property that was added in GNOME 41 to expose the MetaContext
To prepare for that, expose a small shim object as context To prepare for that, expose a small shim object as context
property that mimicks the expected upstream API. property that mimicks the expected upstream API.
--- ---
src/shell-global.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++ src/shell-global.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++
src/shell-global.h | 3 ++ 1 file changed, 92 insertions(+)
2 files changed, 92 insertions(+)
diff --git a/src/shell-global.c b/src/shell-global.c diff --git a/src/shell-global.c b/src/shell-global.c
index 24e771f52..3f765602d 100644 index 24e771f52..805c73145 100644
--- a/src/shell-global.c --- a/src/shell-global.c
+++ b/src/shell-global.c +++ b/src/shell-global.c
@@ -54,6 +54,7 @@ struct _ShellGlobal { @@ -47,6 +47,9 @@
static ShellGlobal *the_object = NULL;
+#define SHIM_TYPE_META_CONTEXT shim_meta_context_get_type ()
+G_DECLARE_FINAL_TYPE (ShimMetaContext, shim_meta_context, SHIM, META_CONTEXT, GObject)
+
struct _ShellGlobal {
GObject parent;
@@ -54,6 +57,7 @@ struct _ShellGlobal {
MetaBackend *backend; MetaBackend *backend;
MetaDisplay *meta_display; MetaDisplay *meta_display;
+ ShellShimMetaContext *meta_context; + ShimMetaContext *meta_context;
MetaWorkspaceManager *workspace_manager; MetaWorkspaceManager *workspace_manager;
Display *xdisplay; Display *xdisplay;
@@ -92,6 +93,7 @@ enum { @@ -92,6 +96,7 @@ enum {
PROP_SESSION_MODE, PROP_SESSION_MODE,
PROP_BACKEND, PROP_BACKEND,
@ -34,7 +43,7 @@ index 24e771f52..3f765602d 100644
PROP_DISPLAY, PROP_DISPLAY,
PROP_WORKSPACE_MANAGER, PROP_WORKSPACE_MANAGER,
PROP_SCREEN_WIDTH, PROP_SCREEN_WIDTH,
@@ -235,6 +237,9 @@ shell_global_get_property(GObject *object, @@ -235,6 +240,9 @@ shell_global_get_property(GObject *object,
case PROP_BACKEND: case PROP_BACKEND:
g_value_set_object (value, global->backend); g_value_set_object (value, global->backend);
break; break;
@ -44,7 +53,7 @@ index 24e771f52..3f765602d 100644
case PROP_DISPLAY: case PROP_DISPLAY:
g_value_set_object (value, global->meta_display); g_value_set_object (value, global->meta_display);
break; break;
@@ -514,6 +519,13 @@ shell_global_class_init (ShellGlobalClass *klass) @@ -514,6 +522,13 @@ shell_global_class_init (ShellGlobalClass *klass)
"MetaBackend object", "MetaBackend object",
META_TYPE_BACKEND, META_TYPE_BACKEND,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
@ -53,20 +62,20 @@ index 24e771f52..3f765602d 100644
+ g_param_spec_object ("context", + g_param_spec_object ("context",
+ "Context", + "Context",
+ "MetaContext object", + "MetaContext object",
+ SHELL_TYPE_SHIM_META_CONTEXT, + G_TYPE_OBJECT,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_DISPLAY, PROP_DISPLAY,
g_param_spec_object ("display", g_param_spec_object ("display",
@@ -996,6 +1008,7 @@ _shell_global_set_plugin (ShellGlobal *global, @@ -996,6 +1011,7 @@ _shell_global_set_plugin (ShellGlobal *global,
display = meta_plugin_get_display (plugin); display = meta_plugin_get_display (plugin);
global->meta_display = display; global->meta_display = display;
+ global->meta_context = g_object_new (SHELL_TYPE_SHIM_META_CONTEXT, NULL); + global->meta_context = g_object_new (SHIM_TYPE_META_CONTEXT, NULL);
global->workspace_manager = meta_display_get_workspace_manager (display); global->workspace_manager = meta_display_get_workspace_manager (display);
global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display)); global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
@@ -1888,3 +1901,79 @@ _shell_global_locate_pointer (ShellGlobal *global) @@ -1888,3 +1904,79 @@ _shell_global_locate_pointer (ShellGlobal *global)
{ {
g_signal_emit (global, shell_global_signals[LOCATE_POINTER], 0); g_signal_emit (global, shell_global_signals[LOCATE_POINTER], 0);
} }
@ -81,18 +90,18 @@ index 24e771f52..3f765602d 100644
+ +
+static GParamSpec *shim_obj_props [N_SHIM_PROPS]; +static GParamSpec *shim_obj_props [N_SHIM_PROPS];
+ +
+struct _ShellShimMetaContext +struct _ShimMetaContext
+{ +{
+ GObject parent_instance; + GObject parent_instance;
+}; +};
+ +
+G_DEFINE_TYPE (ShellShimMetaContext, shell_shim_meta_context, G_TYPE_OBJECT); +G_DEFINE_TYPE (ShimMetaContext, shim_meta_context, G_TYPE_OBJECT);
+ +
+static void +static void
+shell_shim_meta_context_get_property (GObject *object, +shim_meta_context_get_property (GObject *object,
+ guint prop_id, + guint prop_id,
+ GValue *value, + GValue *value,
+ GParamSpec *pspec) + GParamSpec *pspec)
+{ +{
+ switch (prop_id) + switch (prop_id)
+ { + {
@ -110,10 +119,10 @@ index 24e771f52..3f765602d 100644
+} +}
+ +
+static void +static void
+shell_shim_meta_context_set_property (GObject *object, +shim_meta_context_set_property (GObject *object,
+ guint prop_id, + guint prop_id,
+ const GValue *value, + const GValue *value,
+ GParamSpec *pspec) + GParamSpec *pspec)
+{ +{
+ switch (prop_id) + switch (prop_id)
+ { + {
@ -126,12 +135,12 @@ index 24e771f52..3f765602d 100644
+} +}
+ +
+static void +static void
+shell_shim_meta_context_class_init (ShellShimMetaContextClass *klass) +shim_meta_context_class_init (ShimMetaContextClass *klass)
+{ +{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ +
+ object_class->get_property = shell_shim_meta_context_get_property; + object_class->get_property = shim_meta_context_get_property;
+ object_class->set_property = shell_shim_meta_context_set_property; + object_class->set_property = shim_meta_context_set_property;
+ +
+ shim_obj_props[SHIM_PROP_UNSAFE_MODE] = + shim_obj_props[SHIM_PROP_UNSAFE_MODE] =
+ g_param_spec_boolean ("unsafe-mode", + g_param_spec_boolean ("unsafe-mode",
@ -143,28 +152,14 @@ index 24e771f52..3f765602d 100644
+} +}
+ +
+static void +static void
+shell_shim_meta_context_init (ShellShimMetaContext *self) +shim_meta_context_init (ShimMetaContext *self)
+{ +{
+} +}
diff --git a/src/shell-global.h b/src/shell-global.h
index 60bda7131..35e72b4da 100644
--- a/src/shell-global.h
+++ b/src/shell-global.h
@@ -13,6 +13,9 @@ G_BEGIN_DECLS
#define SHELL_TYPE_GLOBAL (shell_global_get_type ())
G_DECLARE_FINAL_TYPE (ShellGlobal, shell_global, SHELL, GLOBAL, GObject)
+#define SHELL_TYPE_SHIM_META_CONTEXT shell_shim_meta_context_get_type ()
+G_DECLARE_FINAL_TYPE (ShellShimMetaContext, shell_shim_meta_context, SHELL, SHIM_META_CONTEXT, GObject)
+
ShellGlobal *shell_global_get (void);
ClutterStage *shell_global_get_stage (ShellGlobal *global);
-- --
2.35.1 2.35.1
From 784a0fc843837f584a2e056c77d9492b105e7e61 Mon Sep 17 00:00:00 2001 From 20fcc7bc78a3c227304e89deddc57266e560175c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 2 Sep 2021 17:15:36 +0200 Date: Thu, 2 Sep 2021 17:15:36 +0200
Subject: [PATCH 02/12] panel: Show warning indicator when unsafe-mode is on Subject: [PATCH 02/12] panel: Show warning indicator when unsafe-mode is on
@ -226,7 +221,7 @@ index 380480744..c57c3ba8e 100644
2.35.1 2.35.1
From 2d31984c43ed017322c78d1f4b62d2eb7e9317c9 Mon Sep 17 00:00:00 2001 From 158eeebc1d3a243e75de550cf5711e38a9f77f7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 17 Jun 2021 01:50:50 +0200 Date: Thu, 17 Jun 2021 01:50:50 +0200
Subject: [PATCH 03/12] shellDBus: Use MetaContext:unsafe-mode to restrict Subject: [PATCH 03/12] shellDBus: Use MetaContext:unsafe-mode to restrict
@ -268,7 +263,7 @@ index 734ca4fc7..5a6edec74 100644
2.35.1 2.35.1
From 32000b5cccd25bdce59c67747c0d31acbbfb9d62 Mon Sep 17 00:00:00 2001 From 0882e04a11fe8db7abf05a5d7c786664dc54ad4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 2 Sep 2021 16:23:38 +0200 Date: Thu, 2 Sep 2021 16:23:38 +0200
Subject: [PATCH 04/12] introspect: Make invocation check error-based Subject: [PATCH 04/12] introspect: Make invocation check error-based
@ -337,7 +332,7 @@ index e46a7e8c5..318955be2 100644
2.35.1 2.35.1
From e6c14cbb6863030d17873087a9ab480918e561e4 Mon Sep 17 00:00:00 2001 From 33c3c3846f62cc4737f0029455f9dcd838876bca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 1 Sep 2021 21:18:42 +0200 Date: Wed, 1 Sep 2021 21:18:42 +0200
Subject: [PATCH 05/12] introspect: Use MetaContext:unsafe-mode instead of Subject: [PATCH 05/12] introspect: Use MetaContext:unsafe-mode instead of
@ -401,7 +396,7 @@ index 318955be2..967e7b830 100644
2.35.1 2.35.1
From 2c19455575a26053c2982c2976c4a546c445a4b1 Mon Sep 17 00:00:00 2001 From 4238128ba403da2cc788b0b249ee34acbea5d743 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 1 Sep 2021 21:25:26 +0200 Date: Wed, 1 Sep 2021 21:25:26 +0200
Subject: [PATCH 06/12] data: Remove now unused "introspect" setting Subject: [PATCH 06/12] data: Remove now unused "introspect" setting
@ -436,7 +431,7 @@ index d5ea1e35f..6f1c424ba 100644
2.35.1 2.35.1
From 15a2854c82766c0e00c218eb7bd47865d52e6ae0 Mon Sep 17 00:00:00 2001 From f6af47b55fa2a52c7cdfecf1bb7e83d7f435a6bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 16 Jun 2021 19:09:42 +0200 Date: Wed, 16 Jun 2021 19:09:42 +0200
Subject: [PATCH 07/12] introspect: Split out DBusSenderChecker Subject: [PATCH 07/12] introspect: Split out DBusSenderChecker
@ -602,7 +597,7 @@ index 802398d18..e6c183fbf 100644
2.35.1 2.35.1
From 01bc238d02785cef23e7481e8cd7c3ec3468eda9 Mon Sep 17 00:00:00 2001 From c6679a876a3c73c2c691333a5b987e27965231f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 17 Jun 2021 15:29:42 +0200 Date: Thu, 17 Jun 2021 15:29:42 +0200
Subject: [PATCH 08/12] shellDBus: Implement all methods asynchronously Subject: [PATCH 08/12] shellDBus: Implement all methods asynchronously
@ -683,7 +678,7 @@ index 5a6edec74..aa5b4dc3c 100644
2.35.1 2.35.1
From d830d87e781de15e6170af85c78086487cf53398 Mon Sep 17 00:00:00 2001 From 3ad733997eecb069be543f1a4452d7a7916a0962 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Thu, 17 Jun 2021 15:29:42 +0200 Date: Thu, 17 Jun 2021 15:29:42 +0200
Subject: [PATCH 09/12] shellDBus: Restrict callers Subject: [PATCH 09/12] shellDBus: Restrict callers
@ -866,7 +861,7 @@ index aa5b4dc3c..c511314f9 100644
2.35.1 2.35.1
From fbe05ef154492d9da9b3cc8e1cacfdd617f4223b Mon Sep 17 00:00:00 2001 From 5b87782b4950742b6ae1b29777e7812c93892ad7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Wed, 16 Jun 2021 22:11:50 +0200 Date: Wed, 16 Jun 2021 22:11:50 +0200
Subject: [PATCH 10/12] screenshot: Restrict callers Subject: [PATCH 10/12] screenshot: Restrict callers
@ -956,7 +951,7 @@ index 81ab516b1..bf537b7d6 100644
2.35.1 2.35.1
From f637187b816435dc4b347144a03c0d72e880780c Mon Sep 17 00:00:00 2001 From b02e721663ed1481ff7b4cf40cae3a34d059d90c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Sat, 25 Sep 2021 14:15:32 +0200 Date: Sat, 25 Sep 2021 14:15:32 +0200
Subject: [PATCH 11/12] screenshot: Unrestrict PickColor Subject: [PATCH 11/12] screenshot: Unrestrict PickColor
@ -1014,7 +1009,7 @@ index bf537b7d6..ae1156f47 100644
2.35.1 2.35.1
From f5d1dbfa38b9a3e7b6c9c5eec3b48d24e18e5732 Mon Sep 17 00:00:00 2001 From 9e8073afbf30aaea87aefd8201fc5e04f94edaf8 Mon Sep 17 00:00:00 2001
From: Sebastian Keller <skeller@gnome.org> From: Sebastian Keller <skeller@gnome.org>
Date: Tue, 23 Nov 2021 02:48:04 +0100 Date: Tue, 23 Nov 2021 02:48:04 +0100
Subject: [PATCH 12/12] util: Wait for initial name owners in DBusSenderCheck Subject: [PATCH 12/12] util: Wait for initial name owners in DBusSenderCheck