diff --git a/plugins/systray/systray-manager.c b/plugins/systray/systray-manager.c index 85819709d30cd2adeeb675828fd953eed83f934a..11731b1812e774ee9bda230d60c1d90ff00fe98d 100644 --- a/plugins/systray/systray-manager.c +++ b/plugins/systray/systray-manager.c @@ -266,6 +266,7 @@ systray_manager_new (void) +#if 0 gboolean systray_manager_check_running (GdkScreen *screen) { @@ -291,6 +292,7 @@ systray_manager_check_running (GdkScreen *screen) /* return result */ return (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), selection_atom) != None); } +#endif diff --git a/plugins/systray/systray-manager.h b/plugins/systray/systray-manager.h index d4c1cdbdb758016af45fda065db748fa8c134f45..892c8ee196a0be8173c973fd04f773ba99a71874 100644 --- a/plugins/systray/systray-manager.h +++ b/plugins/systray/systray-manager.h @@ -54,7 +54,9 @@ GQuark systray_manager_error_quark (void); SystrayManager *systray_manager_new (void) G_GNUC_MALLOC; +#if 0 gboolean systray_manager_check_running (GdkScreen *screen); +#endif gboolean systray_manager_register (SystrayManager *manager, GdkScreen *screen, diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c index 9825759e6c9e10de014c15f0e4aaa9f4c340899e..8283c7008a351e5e0835338f147701c8324efeb3 100644 --- a/plugins/systray/systray.c +++ b/plugins/systray/systray.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org> - * Copyright (c) 2007-2009 Nick Schermer <nick@xfce.org> + * Copyright (c) 2007-2010 Nick Schermer <nick@xfce.org> * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -260,38 +260,27 @@ systray_plugin_screen_changed (GtkWidget *widget, plugin->manager = NULL; } - /* check if not another systray is running on this screen */ + /* create a new manager and register this screen */ + plugin->manager = systray_manager_new (); + g_signal_connect (G_OBJECT (plugin->manager), "icon-added", + G_CALLBACK (systray_plugin_icon_added), plugin); + g_signal_connect (G_OBJECT (plugin->manager), "icon-removed", + G_CALLBACK (systray_plugin_icon_removed), plugin); + g_signal_connect (G_OBJECT (plugin->manager), "lost-selection", + G_CALLBACK (systray_plugin_lost_selection), plugin); + + /* try to register the systray */ screen = gtk_widget_get_screen (widget); - if (G_LIKELY (!systray_manager_check_running (screen))) + if (systray_manager_register (plugin->manager, screen, &error)) { - /* create a new manager and register this screen */ - plugin->manager = systray_manager_new (); - - /* hookup signals */ - g_signal_connect (G_OBJECT (plugin->manager), "icon-added", - G_CALLBACK (systray_plugin_icon_added), plugin); - g_signal_connect (G_OBJECT (plugin->manager), "icon-removed", - G_CALLBACK (systray_plugin_icon_removed), plugin); - g_signal_connect (G_OBJECT (plugin->manager), "lost-selection", - G_CALLBACK (systray_plugin_lost_selection), plugin); - - if (systray_manager_register (plugin->manager, screen, &error)) - { - /* send the plugin orientation */ - systray_plugin_orientation_changed (XFCE_PANEL_PLUGIN (plugin), - xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin))); - } - else - { - /* TODO handle error and leave the plugin */ - g_message ("Failed to register the systray manager %s", error->message); - g_error_free (error); - } + /* send the plugin orientation */ + systray_plugin_orientation_changed (XFCE_PANEL_PLUGIN (plugin), + xfce_panel_plugin_get_orientation (XFCE_PANEL_PLUGIN (plugin))); } else { - /* TODO, error and leave the plugin */ - g_message ("already a notification area running"); + xfce_dialog_show_error (NULL, error, _("Unable the start the notification area")); + g_error_free (error); } } @@ -549,9 +538,8 @@ systray_plugin_lost_selection (SystrayManager *manager, /* create fake error and show it */ error.message = _("Most likely another widget took over the function " - "of a notification area. This plugin will close."); - xfce_dialog_show_error (NULL, &error, - _("The notification area lost selection")); + "of a notification area. This area will be unused."); + xfce_dialog_show_error (NULL, &error, _("The notification area lost selection")); } diff --git a/plugins/systray/systray.desktop.in b/plugins/systray/systray.desktop.in index 2be7df253eb7a28a4d9edfa0a3719fa0854f71df..eca9aab61661cf76dd865c38c3c3f3122202c323 100644 --- a/plugins/systray/systray.desktop.in +++ b/plugins/systray/systray.desktop.in @@ -6,3 +6,4 @@ _Comment=Area where notification icons appear Icon=applications-system X-XFCE-Module=systray X-XFCE-Internal=FALSE +X-XFCE-Unique=SCREEN