[gnome-shell] magnifier: Stop exposing D-Bus interface



commit cb8b19939d4d74043b3e1f3e2287f59db849b475
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Dec 6 06:00:10 2020 +0100

    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>

 .../org.gnome.Magnifier.ZoomRegion.xml             |  26 --
 data/dbus-interfaces/org.gnome.Magnifier.xml       |  54 ----
 data/gnome-shell-dbus-interfaces.gresource.xml     |   2 -
 js/js-resources.gresource.xml                      |   1 -
 js/ui/magnifier.js                                 |   3 -
 js/ui/magnifierDBus.js                             | 351 ---------------------
 src/main.c                                         |  41 ---
 7 files changed, 478 deletions(-)
---
diff --git a/data/gnome-shell-dbus-interfaces.gresource.xml b/data/gnome-shell-dbus-interfaces.gresource.xml
index 69bc67458c..e740700390 100644
--- a/data/gnome-shell-dbus-interfaces.gresource.xml
+++ b/data/gnome-shell-dbus-interfaces.gresource.xml
@@ -26,8 +26,6 @@
     <file preprocess="xml-stripblanks">org.freedesktop.realmd.Service.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.UPower.Device.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.UPower.xml</file>
-    <file preprocess="xml-stripblanks">org.gnome.Magnifier.xml</file>
-    <file preprocess="xml-stripblanks">org.gnome.Magnifier.ZoomRegion.xml</file>
     <file preprocess="xml-stripblanks">org.gnome.Mutter.ScreenCast.xml</file>
     <file preprocess="xml-stripblanks">org.gnome.ScreenSaver.xml</file>
     <file preprocess="xml-stripblanks">org.gnome.SessionManager.EndSessionDialog.xml</file>
diff --git a/js/js-resources.gresource.xml b/js/js-resources.gresource.xml
index 26878daf8f..e7c0dda007 100644
--- a/js/js-resources.gresource.xml
+++ b/js/js-resources.gresource.xml
@@ -71,7 +71,6 @@
     <file>ui/locatePointer.js</file>
     <file>ui/lookingGlass.js</file>
     <file>ui/magnifier.js</file>
-    <file>ui/magnifierDBus.js</file>
     <file>ui/main.js</file>
     <file>ui/messageTray.js</file>
     <file>ui/messageList.js</file>
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 7cfe06fd4d..75cc1f9013 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -7,7 +7,6 @@ const Signals = imports.signals;
 const Background = imports.ui.background;
 const FocusCaretTracker = imports.ui.focusCaretTracker;
 const Main = imports.ui.main;
-const MagnifierDBus = imports.ui.magnifierDBus;
 const Params = imports.misc.params;
 const PointerWatcher = imports.ui.pointerWatcher;
 
@@ -117,8 +116,6 @@ var Magnifier = class Magnifier {
             this.setActive(St.Settings.get().magnifier_active);
         });
 
-        // Export to dbus.
-        new MagnifierDBus.ShellMagnifier();
         this.setActive(St.Settings.get().magnifier_active);
     }
 
diff --git a/src/main.c b/src/main.c
index ceb50482b2..8c59f9c095 100644
--- a/src/main.c
+++ b/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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]