Browse Source

Handle xfconf_init and xfconf_shutdown in another way.

This requires a patch for xfconf that disconnects from
DBus using dispose.
upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
fcf43d3c7d
  1. 19
      common/panel-xfconf.c
  2. 16
      common/panel-xfconf.h
  3. 13
      panel/main.c
  4. 3
      plugins/actions/actions.c
  5. 3
      plugins/clock/clock.c
  6. 3
      plugins/launcher/launcher.c
  7. 3
      plugins/pager/pager.c
  8. 3
      plugins/separator/separator.c
  9. 3
      plugins/systray/systray.c
  10. 3
      plugins/tasklist/tasklist.c
  11. 3
      plugins/windowmenu/windowmenu.c

19
common/panel-xfconf.c

@ -173,11 +173,20 @@ XfconfChannel *
panel_properties_get_channel (void)
{
static XfconfChannel *channel = NULL;
GError *error = NULL;
if (G_UNLIKELY (channel == NULL))
{
if (!xfconf_init (&error))
{
g_critical ("Failed to initialize Xfconf: %s", error->message);
g_error_free (error);
}
channel = xfconf_channel_new (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
g_object_add_weak_pointer (G_OBJECT (channel), (gpointer) &channel);
g_object_weak_ref (G_OBJECT (channel), (GWeakNotify) xfconf_shutdown, NULL);
}
else
{
@ -302,13 +311,3 @@ panel_properties_shared_hash_table (GHashTable *hash_table)
else
shared_hash_table = NULL;
}
void
panel_properties_shutdown (gpointer user_data,
GObject *where_the_object_was)
{
/* delay this a bit to avoid warnings */
g_idle_add ((GSourceFunc) xfconf_shutdown, NULL);
}

16
common/panel-xfconf.h

@ -22,19 +22,6 @@
#include <xfconf/xfconf.h>
#define PANEL_PROPERTIES_INIT(panel_plugin) do { \
GError *__err = NULL; \
if (G_LIKELY (xfconf_init (&__err))) \
{ \
g_object_weak_ref (G_OBJECT (panel_plugin), \
panel_properties_shutdown, NULL); \
} \
else \
{ \
g_critical ("Failed to initialize Xfconf: %s", __err->message); \
g_error_free (__err); \
} } while (0)
typedef struct _PanelProperty PanelProperty;
@ -58,7 +45,4 @@ void panel_properties_unbind (GObject *object);
void panel_properties_shared_hash_table (GHashTable *hash_table);
void panel_properties_shutdown (gpointer user_data,
GObject *where_the_object_was);
#endif /* !__PANEL_XFCONF_H__ */

13
panel/main.c

@ -223,16 +223,6 @@ main (gint argc, gchar **argv)
goto dbus_return;
}
/* initialize xfconf */
if (!xfconf_init (&error))
{
/* print error and exit */
g_error ("Failed to connect to xfconf daemon: %s.", error->message);
g_error_free (error);
return EXIT_FAILURE;
}
/* create dbus service */
dbus_service = panel_dbus_service_get ();
@ -258,9 +248,6 @@ main (gint argc, gchar **argv)
/* release application reference */
g_object_unref (G_OBJECT (application));
/* shutdown xfconf */
xfconf_shutdown ();
/* whether we need to restart */
if (dbus_quit_with_restart)
{

3
plugins/actions/actions.c

@ -179,9 +179,6 @@ actions_plugin_init (ActionsPlugin *plugin)
plugin->first_action = ACTION_LOG_OUT_DIALOG;
plugin->second_action = ACTION_DISABLED;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show the properties dialog */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

3
plugins/clock/clock.c

@ -162,9 +162,6 @@ clock_plugin_init (ClockPlugin *plugin)
plugin->tooltip_interval = 0;
plugin->clock_timeout_id = 0;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show configure */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

3
plugins/launcher/launcher.c

@ -246,9 +246,6 @@ launcher_plugin_init (LauncherPlugin *plugin)
plugin->menu_timeout_id = 0;
plugin->menu_icon_size = DEFAULT_MENU_ICON_SIZE;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show the configure menu item */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

3
plugins/pager/pager.c

@ -149,9 +149,6 @@ pager_plugin_init (PagerPlugin *plugin)
plugin->rows = 1;
plugin->wnck_pager = NULL;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show the properties dialog */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
}

3
plugins/separator/separator.c

@ -138,9 +138,6 @@ separator_plugin_init (SeparatorPlugin *plugin)
/* initialize */
plugin->style = SEPARATOR_PLUGIN_STYLE_SEPARATOR;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show the properties dialog */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
}

3
plugins/systray/systray.c

@ -155,9 +155,6 @@ systray_plugin_init (SystrayPlugin *plugin)
plugin->manager = NULL;
plugin->show_frame = FALSE;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show configure */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

3
plugins/tasklist/tasklist.c

@ -90,9 +90,6 @@ tasklist_plugin_init (TasklistPlugin *plugin)
{
GtkWidget *box;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show configure */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

3
plugins/windowmenu/windowmenu.c

@ -201,9 +201,6 @@ window_menu_plugin_init (WindowMenuPlugin *plugin)
plugin->all_workspaces = TRUE;
plugin->urgent_windows = 0;
/* initialize properties */
PANEL_PROPERTIES_INIT (plugin);
/* show configure */
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));

Loading…
Cancel
Save