magnifier: Stop exposing D-Bus interface
Screen magnification is the compositor's business, not that of "random" unprivileged tools. And for cases where a more specialised behavior is wanted, an extension likely does a better job than a consumer of the D-Bus API. In addition to that, exporting the interface has been broken for an unknown time, because the object that holds the implementation isn't referenced and thus ends up being garbage collected, whoops. And last but not least, this gets rid of the last public D-Bus name that isn't clearly in the system namespace (org.gnome.Shell, org.gnome.Mutter, org.gtk). https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3452 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1523>
This commit is contained in:
41
src/main.c
41
src/main.c
@ -27,7 +27,6 @@
|
||||
extern GType gnome_shell_plugin_get_type (void);
|
||||
|
||||
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
|
||||
#define MAGNIFIER_DBUS_SERVICE "org.gnome.Magnifier"
|
||||
|
||||
#define WM_NAME "GNOME Shell"
|
||||
#define GNOME_WM_KEYBINDINGS "Mutter,GNOME Shell"
|
||||
@ -74,35 +73,6 @@ shell_dbus_acquire_name (GDBusProxy *bus,
|
||||
g_variant_unref (request_name_variant);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_dbus_acquire_names (GDBusProxy *bus,
|
||||
guint32 request_name_flags,
|
||||
const gchar *name,
|
||||
gboolean fatal, ...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
static void
|
||||
shell_dbus_acquire_names (GDBusProxy *bus,
|
||||
guint32 request_name_flags,
|
||||
const gchar *name,
|
||||
gboolean fatal, ...)
|
||||
{
|
||||
va_list al;
|
||||
guint32 request_name_result;
|
||||
va_start (al, fatal);
|
||||
for (;;)
|
||||
{
|
||||
shell_dbus_acquire_name (bus,
|
||||
request_name_flags,
|
||||
&request_name_result,
|
||||
name, fatal);
|
||||
name = va_arg (al, gchar *);
|
||||
if (!name)
|
||||
break;
|
||||
fatal = va_arg (al, gboolean);
|
||||
}
|
||||
va_end (al);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_dbus_init (gboolean replace)
|
||||
{
|
||||
@ -149,17 +119,6 @@ shell_dbus_init (gboolean replace)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* We always specify REPLACE_EXISTING to ensure we kill off
|
||||
* the existing service if it was running.
|
||||
*/
|
||||
request_name_flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE;
|
||||
|
||||
shell_dbus_acquire_names (bus,
|
||||
request_name_flags,
|
||||
/* Also grab the org.gnome.Magnifier service. */
|
||||
MAGNIFIER_DBUS_SERVICE, FALSE,
|
||||
NULL);
|
||||
g_object_unref (bus);
|
||||
g_object_unref (session);
|
||||
}
|
||||
|
Reference in New Issue
Block a user