[gnome-panel/wip/in-process-only: 1/3] panel: remove support for out-of-process applets



commit 7716d9ef85232bc2845c05c954af3ea2bd3b26d4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jul 26 21:32:07 2016 +0300

    panel: remove support for out-of-process applets

 gnome-panel/applet.c                               |    1 -
 .../panel-applet-container.c                       |   89 +---------
 .../panel-applet-container.h                       |    1 -
 .../panel-applet-frame-dbus.c                      |   65 +-------
 .../panel-applets-manager-dbus.c                   |   21 +--
 gnome-panel/panel-applet-frame.c                   |  178 --------------------
 gnome-panel/panel-applet-frame.h                   |   10 -
 gnome-panel/panel-background.c                     |   38 ----
 gnome-panel/panel-background.h                     |    3 -
 gnome-panel/panel-test-applets.c                   |   12 --
 gnome-panel/panel-toplevel.c                       |    1 -
 gnome-panel/panel-widget.c                         |   19 --
 gnome-panel/panel-widget.h                         |    5 +-
 gnome-panel/panel.c                                |   55 ------
 gnome-panel/panel.h                                |    1 -
 gnome-panel/xstuff.c                               |    9 -
 gnome-panel/xstuff.h                               |    2 -
 libpanel-applet/panel-applet-factory.c             |   19 +--
 libpanel-applet/panel-applet.c                     |    6 -
 19 files changed, 20 insertions(+), 515 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index a776fe1..a0ad84f 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -985,7 +985,6 @@ panel_applet_register (GtkWidget       *applet,
        gtk_widget_show (applet);
 
        orientation_change (info, panel);
-       back_change (info, panel);
 
        if (type != PANEL_OBJECT_APPLET)
                gtk_widget_grab_focus (applet);
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.c 
b/gnome-panel/libpanel-applet-private/panel-applet-container.c
index fea6bfe..8d300ec 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.c
@@ -31,16 +31,12 @@ struct _PanelAppletContainerPrivate {
        gchar      *bus_name;
 
        gchar      *iid;
-       gboolean    out_of_process;
-       guint32     xid;
        guint32     uid;
-       GtkWidget  *socket;
 
        GHashTable *pending_ops;
 };
 
 enum {
-       APPLET_BROKEN,
        APPLET_MOVE,
        APPLET_REMOVE,
        CHILD_PROPERTY_CHANGED,
@@ -58,7 +54,6 @@ static const AppletPropertyInfo applet_properties [] = {
        { "settings-path", "SettingsPath" },
        { "orient",        "Orient" },
        { "size-hints",    "SizeHints" },
-       { "background",    "Background" },
        { "flags",         "Flags" },
        { "locked-down",   "LockedDown" }
 };
@@ -71,8 +66,6 @@ static const AppletPropertyInfo applet_properties [] = {
 #define PANEL_APPLET_FACTORY_OBJECT_PATH "/org/gnome/panel/applet/%s"
 #define PANEL_APPLET_INTERFACE           "org.gnome.panel.applet.Applet"
 
-static gboolean panel_applet_container_plug_removed (PanelAppletContainer *container);
-
 G_DEFINE_TYPE (PanelAppletContainer, panel_applet_container, GTK_TYPE_EVENT_BOX);
 
 GQuark
@@ -95,23 +88,11 @@ panel_applet_container_init (PanelAppletContainer *container)
 static void
 panel_applet_container_setup (PanelAppletContainer *container)
 {
-       if (container->priv->out_of_process) {
-               container->priv->socket = gtk_socket_new ();
-
-               g_signal_connect_swapped (container->priv->socket,
-                                         "plug-removed",
-                                         G_CALLBACK (panel_applet_container_plug_removed),
-                                         container);
+       GtkWidget *applet;
 
-               gtk_container_add (GTK_CONTAINER (container), container->priv->socket);
-               gtk_widget_show (container->priv->socket);
-       } else {
-               GtkWidget *applet;
+       applet = panel_applets_manager_get_applet_widget (container->priv->iid, container->priv->uid);
 
-               applet = panel_applets_manager_get_applet_widget (container->priv->iid, container->priv->uid);
-
-               gtk_container_add (GTK_CONTAINER (container), applet);
-       }
+       gtk_container_add (GTK_CONTAINER (container), applet);
 }
 
 static void
@@ -176,16 +157,6 @@ panel_applet_container_class_init (PanelAppletContainerClass *klass)
 
        gobject_class->dispose = panel_applet_container_dispose;
 
-       signals[APPLET_BROKEN] =
-               g_signal_new ("applet-broken",
-                             G_TYPE_FROM_CLASS (klass),
-                             G_SIGNAL_RUN_LAST,
-                             G_STRUCT_OFFSET (PanelAppletContainerClass, applet_broken),
-                             NULL,
-                             NULL,
-                             g_cclosure_marshal_VOID__VOID,
-                             G_TYPE_NONE,
-                             0);
        signals[APPLET_MOVE] =
                g_signal_new ("applet-move",
                              G_TYPE_FROM_CLASS (klass),
@@ -245,35 +216,6 @@ panel_applet_container_new (void)
        return container;
 }
 
-static gboolean
-panel_applet_container_plug_removed (PanelAppletContainer *container)
-{
-       if (!container->priv->applet_proxy)
-               return FALSE;
-
-       panel_applet_container_cancel_pending_operations (container);
-
-       if (container->priv->name_watcher_id > 0) {
-               g_bus_unwatch_name (container->priv->name_watcher_id);
-               container->priv->name_watcher_id = 0;
-       }
-
-       g_object_unref (container->priv->applet_proxy);
-       container->priv->applet_proxy = NULL;
-
-       /* The "plug-removed" signal is also emitted when the socket is being
-        * unrealized (eg., when PanelAppletContainer is torn down during
-        * cleanup on exit). Only emit "applet-broken" if the socket is
-        * still realized. */
-       if (gtk_widget_get_realized (container->priv->socket))
-               g_signal_emit (container, signals[APPLET_BROKEN], 0);
-
-       /* Continue destroying, in case of reloading
-        * a new frame widget is created
-        */
-       return FALSE;
-}
-
 static void
 panel_applet_container_child_signal (GDBusProxy           *proxy,
                                     gchar                *sender_name,
@@ -359,12 +301,6 @@ on_proxy_appeared (GObject      *source_object,
        g_object_unref (task);
 
        panel_applet_container_setup (container);
-
-       if (container->priv->xid > 0) {
-               gtk_socket_add_id (GTK_SOCKET (container->priv->socket),
-                                  container->priv->xid);
-       }
-
        g_object_unref (container);
 }
 
@@ -391,11 +327,7 @@ get_applet_cb (GObject      *source_object,
 
        container = PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
 
-       g_variant_get (retvals,
-                      "(&obuu)",
-                      &applet_path,
-                      &container->priv->out_of_process,
-                      &container->priv->xid,
+       g_variant_get (retvals, "(&ou)", &applet_path,
                       &container->priv->uid);
 
        g_dbus_proxy_new (connection,
@@ -450,7 +382,7 @@ on_factory_appeared (GDBusConnection   *connection,
                                PANEL_APPLET_FACTORY_INTERFACE,
                                "GetApplet",
                                data->parameters,
-                               G_VARIANT_TYPE ("(obuu)"),
+                               G_VARIANT_TYPE ("(ou)"),
                                G_DBUS_CALL_FLAGS_NONE,
                                -1,
                                data->cancellable,
@@ -461,7 +393,6 @@ on_factory_appeared (GDBusConnection   *connection,
 
 static void
 panel_applet_container_get_applet (PanelAppletContainer *container,
-                                  GdkScreen            *screen,
                                   const gchar          *iid,
                                   GVariant             *props,
                                   GCancellable         *cancellable,
@@ -470,7 +401,6 @@ panel_applet_container_get_applet (PanelAppletContainer *container,
 {
        GTask              *task;
        AppletFactoryData  *data;
-       gint                screen_number;
        gchar              *bus_name;
        gchar              *factory_id;
        gchar              *applet_id;
@@ -492,14 +422,10 @@ panel_applet_container_get_applet (PanelAppletContainer *container,
        factory_id = g_strndup (iid, strlen (iid) - strlen (applet_id));
        applet_id += 2;
 
-       /* we can't use the screen of the container widget since it's not in a
-        * widget hierarchy yet */
-       screen_number = gdk_screen_get_number (screen);
-
        data = g_new (AppletFactoryData, 1);
        data->task = task;
        data->factory_id = factory_id;
-       data->parameters = g_variant_new ("(si*)", applet_id, screen_number, props);
+       data->parameters = g_variant_new ("(s*)", applet_id, props);
        data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
 
        bus_name = g_strdup_printf (PANEL_APPLET_BUS_NAME, factory_id);
@@ -519,7 +445,6 @@ panel_applet_container_get_applet (PanelAppletContainer *container,
 
 void
 panel_applet_container_add (PanelAppletContainer *container,
-                           GdkScreen            *screen,
                            const gchar          *iid,
                            GCancellable         *cancellable,
                            GAsyncReadyCallback   callback,
@@ -531,7 +456,7 @@ panel_applet_container_add (PanelAppletContainer *container,
 
        panel_applet_container_cancel_pending_operations (container);
 
-       panel_applet_container_get_applet (container, screen, iid, properties,
+       panel_applet_container_get_applet (container, iid, properties,
                                           cancellable, callback, user_data);
 }
 
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-container.h 
b/gnome-panel/libpanel-applet-private/panel-applet-container.h
index aac8c2b..aeea0b0 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-container.h
+++ b/gnome-panel/libpanel-applet-private/panel-applet-container.h
@@ -69,7 +69,6 @@ GtkWidget *panel_applet_container_new                     (void);
 
 
 void       panel_applet_container_add                     (PanelAppletContainer *container,
-                                                          GdkScreen            *screen,
                                                           const gchar          *iid,
                                                           GCancellable        *cancellable,
                                                           GAsyncReadyCallback  callback,
diff --git a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c 
b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
index f31a218..194deec 100644
--- a/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
+++ b/gnome-panel/libpanel-applet-private/panel-applet-frame-dbus.c
@@ -221,46 +221,6 @@ panel_applet_frame_dbus_change_orientation (PanelAppletFrame *frame,
 }
 
 static void
-container_child_background_set (GObject      *source_object,
-                               GAsyncResult *res,
-                               gpointer      user_data)
-{
-       PanelAppletContainer *container = PANEL_APPLET_CONTAINER (source_object);
-       PanelAppletFrameDBus *frame = PANEL_APPLET_FRAME_DBUS (user_data);
-
-       panel_applet_container_child_set_finish (container, res, NULL);
-
-       if (frame->priv->bg_cancellable)
-               g_object_unref (frame->priv->bg_cancellable);
-       frame->priv->bg_cancellable = NULL;
-}
-
-static void
-panel_applet_frame_dbus_change_background (PanelAppletFrame    *frame,
-                                          PanelBackgroundType  type)
-{
-       PanelAppletFrameDBus *dbus_frame = PANEL_APPLET_FRAME_DBUS (frame);
-       char *bg_str;
-
-       bg_str = _panel_applet_frame_get_background_string (
-                       frame, PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame))), type);
-
-       if (bg_str != NULL) {
-               if (dbus_frame->priv->bg_cancellable)
-                       g_cancellable_cancel (dbus_frame->priv->bg_cancellable);
-               dbus_frame->priv->bg_cancellable = g_cancellable_new ();
-
-               panel_applet_container_child_set (dbus_frame->priv->container,
-                                                 "background",
-                                                 g_variant_new_string (bg_str),
-                                                 dbus_frame->priv->bg_cancellable,
-                                                 container_child_background_set,
-                                                 dbus_frame);
-               g_free (bg_str);
-       }
-}
-
-static void
 panel_applet_frame_dbus_flags_changed (PanelAppletContainer *container,
                                       const gchar          *prop_name,
                                       GVariant             *value,
@@ -289,13 +249,6 @@ panel_applet_frame_dbus_size_hints_changed (PanelAppletContainer *container,
 }
 
 static void
-panel_applet_frame_dbus_applet_broken (PanelAppletContainer *container,
-                                      PanelAppletFrame     *frame)
-{
-       _panel_applet_frame_applet_broken (frame);
-}
-
-static void
 panel_applet_frame_dbus_applet_remove (PanelAppletContainer *container,
                                       PanelAppletFrame     *frame)
 {
@@ -341,9 +294,6 @@ panel_applet_frame_dbus_init (PanelAppletFrameDBus *frame)
        g_signal_connect (container, "child-property-changed::size-hints",
                          G_CALLBACK (panel_applet_frame_dbus_size_hints_changed),
                          frame);
-       g_signal_connect (container, "applet-broken",
-                         G_CALLBACK (panel_applet_frame_dbus_applet_broken),
-                         frame);
        g_signal_connect (container, "applet-remove",
                          G_CALLBACK (panel_applet_frame_dbus_applet_remove),
                          frame);
@@ -365,7 +315,6 @@ panel_applet_frame_dbus_class_init (PanelAppletFrameDBusClass *class)
        frame_class->popup_menu = panel_applet_frame_dbus_popup_menu;
        frame_class->popup_edit_menu = panel_applet_frame_dbus_popup_edit_menu;
        frame_class->change_orientation = panel_applet_frame_dbus_change_orientation;
-       frame_class->change_background = panel_applet_frame_dbus_change_background;
 
        g_type_class_add_private (class, sizeof (PanelAppletFrameDBusPrivate));
 }
@@ -394,9 +343,7 @@ panel_applet_frame_dbus_load (const gchar                 *iid,
        PanelAppletFrameDBus *dbus_frame;
        PanelAppletFrame     *frame;
        GVariantBuilder       builder;
-       GdkScreen            *screen;
        gchar                *settings_path;
-       gchar                *background;
        guint                 orient;
 
        g_return_val_if_fail (iid != NULL, FALSE);
@@ -409,12 +356,8 @@ panel_applet_frame_dbus_load (const gchar                 *iid,
        frame = PANEL_APPLET_FRAME (dbus_frame);
        _panel_applet_frame_set_iid (frame, iid);
 
-       screen = panel_applet_frame_activating_get_screen (frame_act);
        orient = get_panel_applet_orient (panel_applet_frame_activating_get_orientation (frame_act));
        settings_path = panel_applet_frame_activating_get_settings_path (frame_act);
-       /* we can't really get a background string at this point since we don't
-        * know the position of the applet */
-       background = NULL;
 
        g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
        g_variant_builder_add (&builder, "{sv}",
@@ -426,22 +369,16 @@ panel_applet_frame_dbus_load (const gchar                 *iid,
        g_variant_builder_add (&builder, "{sv}",
                               "locked-down",
                               g_variant_new_boolean (panel_applet_frame_activating_get_locked_down 
(frame_act)));
-       if (background) {
-               g_variant_builder_add (&builder, "{sv}",
-                                      "background",
-                                      g_variant_new_string (background));
-       }
 
        g_object_set_data (G_OBJECT (frame), "panel-applet-frame-activating", frame_act);
 
        panel_applet_container_add (dbus_frame->priv->container,
-                                   screen, iid, NULL,
+                                   iid, NULL,
                                    (GAsyncReadyCallback) panel_applet_frame_dbus_activated,
                                    frame,
                                    g_variant_builder_end (&builder));
 
        g_free (settings_path);
-       g_free (background);
 
        return TRUE;
 }
diff --git a/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c 
b/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
index 93f1cb4..670152c 100644
--- a/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
+++ b/gnome-panel/libpanel-applet-private/panel-applets-manager-dbus.c
@@ -51,7 +51,6 @@ typedef GtkWidget * (* GetAppletWidgetFunc) (const gchar *factory_id,
 typedef struct _PanelAppletFactoryInfo {
        gchar              *id;
        gchar              *location;
-       gboolean            in_process;
        GModule            *module;
        ActivateAppletFunc  activate_applet;
        GetAppletWidgetFunc get_applet_widget;
@@ -126,6 +125,7 @@ panel_applets_manager_get_applet_factory_info_from_file (const gchar *filename)
        gsize                   n_groups;
        gsize                   i;
        GError                 *error = NULL;
+       gboolean                in_process;
 
        applet_file = g_key_file_new ();
        if (!g_key_file_load_from_file (applet_file, filename, G_KEY_FILE_NONE, &error)) {
@@ -148,9 +148,9 @@ panel_applets_manager_get_applet_factory_info_from_file (const gchar *filename)
                return NULL;
        }
 
-       info->in_process = g_key_file_get_boolean (applet_file, PANEL_APPLET_FACTORY_GROUP,
-                                                  "InProcess", NULL);
-       if (info->in_process) {
+       in_process = g_key_file_get_boolean (applet_file, PANEL_APPLET_FACTORY_GROUP,
+                                            "InProcess", NULL);
+       if (in_process) {
                info->location = g_key_file_get_string (applet_file, PANEL_APPLET_FACTORY_GROUP,
                                                        "Location", NULL);
                if (!info->location) {
@@ -161,6 +161,11 @@ panel_applets_manager_get_applet_factory_info_from_file (const gchar *filename)
 
                        return NULL;
                }
+       } else {
+               panel_applet_factory_info_free (info);
+               g_key_file_free (applet_file);
+
+               return NULL;
        }
 
        info->has_old_ids = FALSE;
@@ -416,10 +421,6 @@ panel_applets_manager_dbus_factory_activate (PanelAppletsManager *manager,
        if (!info)
                return FALSE;
 
-       /* Out-of-process applets are activated by the session bus */
-       if (!info->in_process)
-               return TRUE;
-
        if (info->module) {
                if (info->n_applets == 0) {
                        if (info->activate_applet () != 0) {
@@ -486,10 +487,6 @@ panel_applets_manager_dbus_factory_deactivate (PanelAppletsManager *manager,
        if (!info)
                return FALSE;
 
-       /* Out-of-process applets are deactivated by the session bus */
-       if (!info->in_process)
-               return TRUE;
-
        if (!info->module)
                return TRUE;
 
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index 91460dc..1d86582 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -224,24 +224,7 @@ panel_applet_frame_get_preferred_height(GtkWidget *widget, gint *minimal_height,
        }
 }
 
-static void
-change_background (PanelAppletFrame *frame,
-                   GtkAllocation    *old,
-                   GtkAllocation    *new)
-{
-       PanelBackgroundType type;
 
-       if (old->x == new->x &&
-           old->y == new->y &&
-           old->width == new->width &&
-           old->height == new->height)
-               return;
-
-       type = frame->priv->panel->toplevel->background.type;
-
-       PANEL_APPLET_FRAME_GET_CLASS (frame)->change_background (frame,
-                                                                type);
-}
 
 static void
 panel_applet_frame_size_allocate (GtkWidget     *widget,
@@ -262,12 +245,10 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
        if (!frame->priv->has_handle) {
                GTK_WIDGET_CLASS (panel_applet_frame_parent_class)->size_allocate (widget,
                                                                                   allocation);
-               change_background (frame, &widget_allocation, allocation);
                return;
        }
 
        gtk_widget_set_allocation (widget, allocation);
-       change_background (frame, &widget_allocation, allocation);
 
        frame->priv->handle_rect.x = 0;
        frame->priv->handle_rect.y = 0;
@@ -611,159 +592,6 @@ _panel_applet_frame_update_size_hints (PanelAppletFrame *frame,
                                            n_elements);
 }
 
-char *
-_panel_applet_frame_get_background_string (PanelAppletFrame    *frame,
-                                          PanelWidget         *panel,
-                                          PanelBackgroundType  type)
-{
-       GtkAllocation allocation;
-       int x;
-       int y;
-
-       gtk_widget_get_allocation (GTK_WIDGET (frame), &allocation);
-
-       x = allocation.x;
-       y = allocation.y;
-
-       if (frame->priv->has_handle) {
-               switch (frame->priv->orientation) {
-               case PANEL_ORIENTATION_TOP:
-               case PANEL_ORIENTATION_BOTTOM:
-                       if (gtk_widget_get_direction (GTK_WIDGET (frame)) !=
-                           GTK_TEXT_DIR_RTL)
-                               x += frame->priv->handle_rect.width;
-                       break;
-               case PANEL_ORIENTATION_LEFT:
-               case PANEL_ORIENTATION_RIGHT:
-                       y += frame->priv->handle_rect.height;
-                       break;
-               default:
-                       g_assert_not_reached ();
-                       break;
-               }
-       }
-
-       return panel_background_make_string (&panel->toplevel->background, x, y);
-}
-
-static void
-panel_applet_frame_reload_response (GtkWidget        *dialog,
-                                   int               response,
-                                   PanelAppletFrame *frame)
-{
-       AppletInfo *info;
-
-       g_return_if_fail (PANEL_IS_APPLET_FRAME (frame));
-
-       if (!frame->priv->iid || !frame->priv->panel) {
-               g_object_unref (frame);
-               gtk_widget_destroy (dialog);
-               return;
-       }
-
-       info = frame->priv->applet_info;
-
-       if (response == PANEL_RESPONSE_RELOAD) {
-               PanelWidget *panel;
-               char        *iid;
-               char        *id = NULL;
-               GSettings   *settings = NULL;
-
-               panel = frame->priv->panel;
-               iid   = g_strdup (frame->priv->iid);
-
-               if (info) {
-                       id = g_strdup (info->id);
-                       settings = panel_applet_get_settings (info);
-                       g_object_ref (settings);
-                       panel_applet_clean (info);
-               }
-
-               panel_applet_frame_load_helper (iid, panel, id, settings);
-
-               g_free (iid);
-               g_free (id);
-               if (settings)
-                       g_object_unref (settings);
-
-       } else if (response == PANEL_RESPONSE_DELETE) {
-               /* if we can't write to applets list we can't really delete
-                  it, so we'll just ignore this.  FIXME: handle this
-                  more correctly I suppose. */
-               if (panel_layout_is_writable () && info)
-                       panel_layout_delete_object (panel_applet_get_id (info));
-       }
-
-       g_object_unref (frame);
-       gtk_widget_destroy (dialog);
-}
-
-void
-_panel_applet_frame_applet_broken (PanelAppletFrame *frame)
-{
-       GtkWidget  *dialog;
-       GdkScreen  *screen;
-       const char *applet_name = NULL;
-       char       *dialog_txt;
-
-       screen = gtk_widget_get_screen (GTK_WIDGET (frame));
-
-       if (xstuff_is_display_dead ())
-               return;
-
-       if (frame->priv->iid) {
-               PanelAppletInfo *info;
-
-               info = (PanelAppletInfo *)panel_applets_manager_get_applet_info (frame->priv->iid);
-               applet_name = panel_applet_info_get_name (info);
-       }
-
-       if (applet_name)
-               dialog_txt = g_strdup_printf (_("\"%s\" has quit unexpectedly"), applet_name);
-       else
-               dialog_txt = g_strdup (_("Panel object has quit unexpectedly"));
-
-       dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
-                                        GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
-                                        dialog_txt, applet_name ? applet_name : NULL);
-
-       gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                                 _("If you reload a panel object, it will automatically "
-                                                   "be added back to the panel."));
-
-       gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
-
-       if (panel_layout_is_writable ()) {
-               gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                                       _("D_elete"), PANEL_RESPONSE_DELETE,
-                                       _("_Don't Reload"), PANEL_RESPONSE_DONT_RELOAD,
-                                       _("_Reload"), PANEL_RESPONSE_RELOAD,
-                                       NULL);
-       } else {
-               gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                                       _("_Don't Reload"), PANEL_RESPONSE_DONT_RELOAD,
-                                       _("_Reload"), PANEL_RESPONSE_RELOAD,
-                                       NULL);
-       }
-
-       gtk_dialog_set_default_response (GTK_DIALOG (dialog),
-                                        PANEL_RESPONSE_RELOAD);
-
-       gtk_window_set_screen (GTK_WINDOW (dialog), screen);
-
-       g_signal_connect (dialog, "response",
-                         G_CALLBACK (panel_applet_frame_reload_response),
-                         g_object_ref (frame));
-
-       panel_widget_register_open_dialog (frame->priv->panel, dialog);
-       gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
-       /* FIXME: http://bugzilla.gnome.org/show_bug.cgi?id=165132 */
-       gtk_window_set_title (GTK_WINDOW (dialog), _("Error"));
-
-       gtk_widget_show (dialog);
-       g_free (dialog_txt);
-}
-
 void
 _panel_applet_frame_applet_remove (PanelAppletFrame *frame)
 {
@@ -809,12 +637,6 @@ panel_applet_frame_activating_free (PanelAppletFrameActivating *frame_act)
        g_slice_free (PanelAppletFrameActivating, frame_act);
 }
 
-GdkScreen *
-panel_applet_frame_activating_get_screen (PanelAppletFrameActivating *frame_act)
-{
-       return gtk_widget_get_screen (GTK_WIDGET (frame_act->panel));
-}
-
 PanelOrientation
 panel_applet_frame_activating_get_orientation (PanelAppletFrameActivating *frame_act)
 {
diff --git a/gnome-panel/panel-applet-frame.h b/gnome-panel/panel-applet-frame.h
index 1a786aa..8e646f2 100644
--- a/gnome-panel/panel-applet-frame.h
+++ b/gnome-panel/panel-applet-frame.h
@@ -61,9 +61,6 @@ struct _PanelAppletFrameClass {
 
        void     (*change_orientation)    (PanelAppletFrame    *frame,
                                           PanelOrientation     orientation);
-
-       void     (*change_background)     (PanelAppletFrame    *frame,
-                                          PanelBackgroundType  type);
 };
 
 struct _PanelAppletFrame {
@@ -94,7 +91,6 @@ void  panel_applet_frame_set_panel          (PanelAppletFrame    *frame,
 
 typedef struct _PanelAppletFrameActivating        PanelAppletFrameActivating;
 
-GdkScreen        *panel_applet_frame_activating_get_screen      (PanelAppletFrameActivating *frame_act);
 PanelOrientation  panel_applet_frame_activating_get_orientation (PanelAppletFrameActivating *frame_act);
 gboolean          panel_applet_frame_activating_get_locked_down (PanelAppletFrameActivating *frame_act);
 gchar            *panel_applet_frame_activating_get_settings_path (PanelAppletFrameActivating *frame_act);
@@ -115,12 +111,6 @@ void  _panel_applet_frame_update_size_hints     (PanelAppletFrame *frame,
                                                 gint             *size_hints,
                                                 guint             n_elements);
 
-char *_panel_applet_frame_get_background_string (PanelAppletFrame    *frame,
-                                                PanelWidget         *panel,
-                                                PanelBackgroundType  type);
-
-void  _panel_applet_frame_applet_broken         (PanelAppletFrame *frame);
-
 void  _panel_applet_frame_applet_remove         (PanelAppletFrame *frame);
 void  _panel_applet_frame_applet_move           (PanelAppletFrame *frame);
 
diff --git a/gnome-panel/panel-background.c b/gnome-panel/panel-background.c
index c448450..87d385b 100644
--- a/gnome-panel/panel-background.c
+++ b/gnome-panel/panel-background.c
@@ -929,44 +929,6 @@ panel_background_free (PanelBackground *background)
        background->default_pattern = NULL;
 }
 
-char *
-panel_background_make_string (PanelBackground *background,
-                             int              x,
-                             int              y)
-{
-       PanelBackgroundType  effective_type;
-        GVariant            *variant;
-        gchar               *retval;
-
-       effective_type = panel_background_effective_type (background);
-
-       if (effective_type == PANEL_BACK_IMAGE ||
-           (effective_type == PANEL_BACK_COLOR && background->has_alpha)) {
-                cairo_surface_t *surface;
-
-               if (!background->composited_pattern)
-                       return NULL;
-
-                if (cairo_pattern_get_surface (background->composited_pattern, &surface) != 
CAIRO_STATUS_SUCCESS)
-                        return NULL;
-
-                g_assert (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_XLIB);
-
-                variant = g_variant_new ("(uii)", (guint32)cairo_xlib_surface_get_drawable (surface),
-                                         x, y);
-       } else if (effective_type == PANEL_BACK_COLOR) {
-                variant = g_variant_new ("(dddd)",
-                                         background->color.red, background->color.green,
-                                         background->color.blue, background->color.alpha);
-       } else
-               variant = g_variant_new ("()");
-
-        retval = g_variant_print (variant, TRUE);
-        g_variant_unref (variant);
-
-        return retval;
-}
-
 PanelBackgroundType
 panel_background_get_type (PanelBackground *background)
 {
diff --git a/gnome-panel/panel-background.h b/gnome-panel/panel-background.h
index 286d526..b09e73f 100644
--- a/gnome-panel/panel-background.h
+++ b/gnome-panel/panel-background.h
@@ -91,9 +91,6 @@ void  panel_background_change_region     (PanelBackground     *background,
                                          int                  y,
                                          int                  width,
                                          int                  height);
-char *panel_background_make_string       (PanelBackground     *background,
-                                         int                  x,
-                                         int                  y);
 
 PanelBackgroundType  panel_background_get_type   (PanelBackground *background);
 const GdkRGBA       *panel_background_get_color  (PanelBackground *background);
diff --git a/gnome-panel/panel-test-applets.c b/gnome-panel/panel-test-applets.c
index 142a503..4b51487 100644
--- a/gnome-panel/panel-test-applets.c
+++ b/gnome-panel/panel-test-applets.c
@@ -84,13 +84,6 @@ get_combo_applet_id (GtkWidget *combo_box)
 }
 
 static void
-applet_broken_cb (GtkWidget *container,
-                 GtkWidget *window)
-{
-       gtk_widget_destroy (window);
-}
-
-static void
 applet_activated_cb (GObject      *source_object,
                     GAsyncResult *res,
                     GtkWidget    *applet_window)
@@ -141,15 +134,10 @@ load_applet_into_window (const char *title,
        gtk_box_set_center_widget (GTK_BOX (box), container);
        gtk_widget_show (container);
 
-       g_signal_connect (container, "applet-broken",
-                         G_CALLBACK (applet_broken_cb),
-                         applet_window);
-
        g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
        g_variant_builder_add (&builder, "{sv}",
                               "orient", g_variant_new_uint32 (orientation));
        panel_applet_container_add (PANEL_APPLET_CONTAINER (container),
-                                   gtk_widget_get_screen (applet_window),
                                    title, NULL,
                                    (GAsyncReadyCallback)applet_activated_cb,
                                    applet_window,
diff --git a/gnome-panel/panel-toplevel.c b/gnome-panel/panel-toplevel.c
index 28d0992..e33e020 100644
--- a/gnome-panel/panel-toplevel.c
+++ b/gnome-panel/panel-toplevel.c
@@ -4276,7 +4276,6 @@ background_changed (PanelBackground *background,
                     PanelToplevel   *toplevel)
 {
        panel_toplevel_update_edges (toplevel);
-       panel_widget_emit_background_changed (toplevel->priv->panel_widget);
 }
 
 static void
diff --git a/gnome-panel/panel-widget.c b/gnome-panel/panel-widget.c
index 4b1d7c2..ee419c9 100644
--- a/gnome-panel/panel-widget.c
+++ b/gnome-panel/panel-widget.c
@@ -35,7 +35,6 @@ typedef enum {
 G_DEFINE_TYPE (PanelWidget, panel_widget, GTK_TYPE_FIXED);
 
 enum {
-       BACK_CHANGE_SIGNAL,
        APPLET_MOVE_SIGNAL,
        APPLET_ADDED_SIGNAL,
        APPLET_REMOVED_SIGNAL,
@@ -269,17 +268,6 @@ panel_widget_class_init (PanelWidgetClass *class)
        GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
        GtkContainerClass *container_class = (GtkContainerClass*) class;
 
-       panel_widget_signals[BACK_CHANGE_SIGNAL] =
-                g_signal_new ("back_change",
-                              G_TYPE_FROM_CLASS (object_class),
-                              G_SIGNAL_RUN_LAST,
-                              G_STRUCT_OFFSET (PanelWidgetClass, back_change),
-                              NULL,
-                              NULL, 
-                              g_cclosure_marshal_VOID__VOID,
-                              G_TYPE_NONE,
-                              0);
-
        panel_widget_signals[APPLET_MOVE_SIGNAL] =
                 g_signal_new ("applet_move",
                               G_TYPE_FROM_CLASS (object_class),
@@ -363,7 +351,6 @@ panel_widget_class_init (PanelWidgetClass *class)
                               G_TYPE_NONE,
                               0);
 
-       class->back_change = NULL;
        class->applet_move = NULL;
        class->applet_added = NULL;
        class->applet_removed = NULL;
@@ -2672,9 +2659,3 @@ panel_widget_register_open_dialog (PanelWidget *panel,
                                 panel,
                                 G_CONNECT_SWAPPED);
 }
-
-void
-panel_widget_emit_background_changed (PanelWidget *panel)
-{
-       g_signal_emit (panel, panel_widget_signals [BACK_CHANGE_SIGNAL], 0);
-}
diff --git a/gnome-panel/panel-widget.h b/gnome-panel/panel-widget.h
index 05c0598..1cb5af2 100644
--- a/gnome-panel/panel-widget.h
+++ b/gnome-panel/panel-widget.h
@@ -108,7 +108,6 @@ struct _PanelWidgetClass
 {
        GtkFixedClass parent_class;
 
-       void (* back_change) (PanelWidget *panel);
        void (* applet_move) (PanelWidget *panel,
                              GtkWidget *applet);
        void (* applet_added) (PanelWidget *panel,
@@ -201,9 +200,7 @@ void     panel_widget_set_applet_size_hints       (PanelWidget *panel,
                                                   int          size_hints_len);
 
 void     panel_widget_register_open_dialog        (PanelWidget *panel,
-                                                  GtkWidget   *dialog);  
-
-void     panel_widget_emit_background_changed     (PanelWidget *panel);
+                                                  GtkWidget   *dialog);
 
 G_END_DECLS
 
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index a608537..985874b 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -108,56 +108,6 @@ panel_orient_change (GtkWidget *widget, gpointer data)
                              widget);
 }
 
-void
-back_change (AppletInfo  *info,
-            PanelWidget *panel)
-{
-       PanelAppletFrame    *frame;
-       PanelBackgroundType  type;
-
-       switch (info->type) {
-       case PANEL_OBJECT_APPLET:
-               frame = PANEL_APPLET_FRAME (info->widget);
-               type = panel->toplevel->background.type;
-
-               PANEL_APPLET_FRAME_GET_CLASS (frame)->change_background (frame, type);
-               break;
-       case PANEL_OBJECT_ACTION:
-       case PANEL_OBJECT_LAUNCHER:
-       case PANEL_OBJECT_MENU:
-       case PANEL_OBJECT_MENU_BAR:
-       case PANEL_OBJECT_USER_MENU:
-       case PANEL_OBJECT_SEPARATOR:
-               break;
-       default:
-               break;
-       }
-}
-
-static void
-back_change_foreach (GtkWidget   *widget,
-                    PanelWidget *panel)
-{
-       AppletInfo *info;
-
-       info = g_object_get_data (G_OBJECT (widget), "applet_info");
-
-       back_change (info, panel);
-}
-
-static void
-panel_back_change (GtkWidget *widget, gpointer data)
-{
-       gtk_container_foreach (GTK_CONTAINER (widget),
-                              (GtkCallback) back_change_foreach,
-                              widget);
-
-#ifdef FIXME_FOR_NEW_CONFIG
-       /*update the configuration box if it is displayed*/
-       update_config_back(PANEL_WIDGET(widget));
-#endif /* FIXME_FOR_NEW_CONFIG */
-}
-
 static void
 panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
 {
@@ -166,7 +116,6 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
        info = g_object_get_data (G_OBJECT (applet), "applet_info");
 
        orientation_change(info,PANEL_WIDGET(widget));
-       back_change(info,PANEL_WIDGET(widget));
 }
 
 static gboolean
@@ -1267,10 +1216,6 @@ panel_widget_setup(PanelWidget *panel)
                          "applet_move",
                          G_CALLBACK(panel_applet_move),
                          NULL);
-       g_signal_connect (G_OBJECT (panel),
-                         "back_change",
-                         G_CALLBACK (panel_back_change),
-                         NULL);
 }
 
 PanelData *
diff --git a/gnome-panel/panel.h b/gnome-panel/panel.h
index 2ac80c1..4893d5b 100644
--- a/gnome-panel/panel.h
+++ b/gnome-panel/panel.h
@@ -17,7 +17,6 @@ struct _PanelData {
 };
 
 void orientation_change(AppletInfo *info, PanelWidget *panel);
-void back_change(AppletInfo *info, PanelWidget *panel);
 
 PanelData *panel_setup (PanelToplevel *toplevel);
 
diff --git a/gnome-panel/xstuff.c b/gnome-panel/xstuff.c
index a10dc35..052365e 100644
--- a/gnome-panel/xstuff.c
+++ b/gnome-panel/xstuff.c
@@ -27,7 +27,6 @@
 
 static int (* xstuff_old_xio_error_handler) (Display *) = NULL;
 static int (* xstuff_old_x_error_handler)   (Display *, XErrorEvent *);
-static gboolean xstuff_display_is_dead = FALSE;
 
 /* Zoom animation */
 #define MINIATURIZE_ANIMATION_FRAMES_Z   1
@@ -381,20 +380,12 @@ xstuff_zoom_animate (GtkWidget *widget,
 static int
 xstuff_xio_error_handler (Display *display)
 {
-       xstuff_display_is_dead = TRUE;
-
        if (xstuff_old_xio_error_handler)
                return xstuff_old_xio_error_handler (display);
 
        return 0;
 }
 
-gboolean
-xstuff_is_display_dead (void)
-{
-       return xstuff_display_is_dead;
-}
-
 static int
 xstuff_x_error_handler (Display *display, XErrorEvent *error)
 {
diff --git a/gnome-panel/xstuff.h b/gnome-panel/xstuff.h
index 507a1dd..016ed99 100644
--- a/gnome-panel/xstuff.h
+++ b/gnome-panel/xstuff.h
@@ -9,8 +9,6 @@ void xstuff_zoom_animate                (GtkWidget        *widget,
                                         PanelOrientation  orientation,
                                         GdkRectangle     *opt_src_rect);
 
-gboolean xstuff_is_display_dead         (void);
-
 void xstuff_init                        (void);
 
 #endif /* __XSTUFF_H__ */
diff --git a/libpanel-applet/panel-applet-factory.c b/libpanel-applet/panel-applet-factory.c
index 904fa61..7a66c09 100644
--- a/libpanel-applet/panel-applet-factory.c
+++ b/libpanel-applet/panel-applet-factory.c
@@ -187,15 +187,12 @@ panel_applet_factory_get_applet (PanelAppletFactory    *factory,
 {
        GObject     *applet;
        const gchar *applet_id;
-       gint         screen_num;
        GVariant    *props;
        GVariant    *return_value;
-       GdkScreen   *screen;
-       guint32      xid;
        guint32      uid;
        const gchar *object_path;
 
-       g_variant_get (parameters, "(&si@a{sv})", &applet_id, &screen_num, &props);
+       g_variant_get (parameters, "(&s@a{sv})", &applet_id, &props);
 
        applet = g_object_new (factory->applet_type,
                               "out-of-process", factory->out_of_process,
@@ -209,22 +206,13 @@ panel_applet_factory_get_applet (PanelAppletFactory    *factory,
        set_applet_constructor_properties (applet, props);
        g_variant_unref (props);
 
-       screen = screen_num != -1 ?
-               gdk_display_get_screen (gdk_display_get_default (), screen_num) :
-               gdk_screen_get_default ();
-
-       xid = panel_applet_get_xid (PANEL_APPLET (applet), screen);
        uid = factory->next_uid++;
        object_path = panel_applet_get_object_path (PANEL_APPLET (applet));
 
        g_hash_table_insert (factory->applets, GUINT_TO_POINTER (uid), applet);
        g_object_set_data (applet, "uid", GUINT_TO_POINTER (uid));
 
-       return_value = g_variant_new ("(obuu)",
-                                     object_path,
-                                     factory->out_of_process,
-                                     xid,
-                                     uid);
+       return_value = g_variant_new ("(ou)", object_path, uid);
 
        g_dbus_method_invocation_return_value (invocation, return_value);
 }
@@ -251,11 +239,8 @@ static const gchar introspection_xml[] =
            "<interface name='org.gnome.panel.applet.AppletFactory'>"
              "<method name='GetApplet'>"
                "<arg name='applet_id' type='s' direction='in'/>"
-               "<arg name='screen' type='i' direction='in'/>"
                "<arg name='props' type='a{sv}' direction='in'/>"
                "<arg name='applet' type='o' direction='out'/>"
-               "<arg name='out-of-process' type='b' direction='out'/>"
-               "<arg name='xid' type='u' direction='out'/>"
                "<arg name='uid' type='u' direction='out'/>"
              "</method>"
            "</interface>"
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index 7a10ef2..9de4062 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -2068,9 +2068,6 @@ get_property_cb (GDBusConnection *connection,
                                               applet->priv->settings_path : "");
        } else if (g_strcmp0 (property_name, "Orient") == 0) {
                retval = g_variant_new_uint32 (applet->priv->orient);
-       } else if (g_strcmp0 (property_name, "Background") == 0) {
-               retval = g_variant_new_string (applet->priv->background ?
-                                              applet->priv->background : "");
        } else if (g_strcmp0 (property_name, "Flags") == 0) {
                retval = g_variant_new_uint32 (applet->priv->flags);
        } else if (g_strcmp0 (property_name, "SizeHints") == 0) {
@@ -2106,8 +2103,6 @@ set_property_cb (GDBusConnection *connection,
                panel_applet_set_settings_path (applet, g_variant_get_string (value, NULL));
        } else if (g_strcmp0 (property_name, "Orient") == 0) {
                panel_applet_set_orient (applet, g_variant_get_uint32 (value));
-       } else if (g_strcmp0 (property_name, "Background") == 0) {
-               panel_applet_set_background_string (applet, g_variant_get_string (value, NULL));
        } else if (g_strcmp0 (property_name, "Flags") == 0) {
                panel_applet_set_flags (applet, g_variant_get_uint32 (value));
        } else if (g_strcmp0 (property_name, "SizeHints") == 0) {
@@ -2136,7 +2131,6 @@ static const gchar introspection_xml[] =
            "</method>"
            "<property name='SettingsPath' type='s' access='readwrite'/>"
            "<property name='Orient' type='u' access='readwrite' />"
-           "<property name='Background' type='s' access='readwrite'/>"
            "<property name='Flags' type='u' access='readwrite'/>"
            "<property name='SizeHints' type='ai' access='readwrite'/>"
            "<property name='LockedDown' type='b' access='readwrite'/>"



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