diff --git a/settings/xfae-model.c b/settings/xfae-model.c index 1680fae..1a26aaa 100644 --- a/settings/xfae-model.c +++ b/settings/xfae-model.c @@ -73,6 +73,7 @@ static gboolean xfae_model_iter_parent (GtkTreeModel *tree_ static XfaeItem *xfae_item_new (const gchar *relpath); static void xfae_item_free (XfaeItem *item); static gboolean xfae_item_is_removable (XfaeItem *item); +static gboolean xfae_item_is_compat (XfaeItem *item); @@ -95,6 +96,7 @@ struct _XfaeItem GdkPixbuf *icon; gchar *comment; gchar *relpath; + gchar **only_show_in; gboolean hidden; }; @@ -287,7 +289,7 @@ xfae_model_get_value (GtkTreeModel *tree_model, case XFAE_MODEL_COLUMN_ENABLED: g_value_init (value, G_TYPE_BOOLEAN); - g_value_set_boolean (value, !item->hidden); + g_value_set_boolean (value, !(item->hidden || xfae_item_is_compat (item))); break; case XFAE_MODEL_COLUMN_REMOVABLE: @@ -401,7 +403,6 @@ xfae_item_new (const gchar *relpath) XfaeItem *item = NULL; gboolean skip = FALSE; XfceRc *rc; - gchar **only_show_in; gchar **not_show_in; gchar **args; gchar *icon_name; @@ -457,18 +458,18 @@ xfae_item_new (const gchar *relpath) } /* check the OnlyShowIn setting */ - only_show_in = xfce_rc_read_list_entry (rc, "OnlyShowIn", ";"); - if (G_UNLIKELY (only_show_in != NULL)) + item->only_show_in = xfce_rc_read_list_entry (rc, "OnlyShowIn", ";"); + if (G_UNLIKELY (item->only_show_in != NULL)) { - /* check if "Xfce" is specified */ - for (m = 0, skip = TRUE; only_show_in[m] != NULL; ++m) - if (g_ascii_strcasecmp (only_show_in[m], "Xfce") == 0) + /* check if "Xfce", "GNOME", or "KDE" are specified */ + for (m = 0, skip = TRUE; item->only_show_in[m] != NULL; ++m) + if ((g_ascii_strcasecmp (item->only_show_in[m], "Xfce") == 0) || + (g_ascii_strcasecmp (item->only_show_in[m], "GNOME") == 0) || + (g_ascii_strcasecmp (item->only_show_in[m], "KDE") == 0)) { skip = FALSE; break; } - - g_strfreev (only_show_in); } else { @@ -515,6 +516,7 @@ xfae_item_free (XfaeItem *item) g_free (item->relpath); g_free (item->comment); g_free (item->name); + g_strfreev (item->only_show_in); g_free (item); } @@ -545,6 +547,32 @@ xfae_item_is_removable (XfaeItem *item) static gboolean +xfae_item_is_compat (XfaeItem *item) +{ + gint m; + gboolean is_compat = FALSE; + + if (item->only_show_in != NULL) + { + for (m = 0; item->only_show_in[m] != NULL; ++m) + { + if (g_ascii_strcasecmp (item->only_show_in[m], "Xfce") == 0) + { + is_compat = FALSE; + break; + } + else if ((g_ascii_strcasecmp (item->only_show_in[m], "GNOME") == 0) || + (g_ascii_strcasecmp (item->only_show_in[m], "KDE") == 0)) + is_compat = TRUE; + } + } + + return is_compat; +} + + + +static gboolean xfae_item_remove (XfaeItem *item, GError **error) { @@ -899,12 +927,26 @@ xfae_model_toggle (XfaeModel *model, return FALSE; } - /* perform the toggle operation :-) */ - item->hidden = !item->hidden; + if (xfae_item_is_compat (item)) + { + guint len; + + /* append "XFCE;" to "OnlyShowIn" */ + len = g_strv_length (item->only_show_in) + 2; + item->only_show_in = g_realloc_n (item->only_show_in, (gsize) len, sizeof (gchar *)); + item->only_show_in[len - 3] = g_strdup ("XFCE"); + item->only_show_in[len - 2] = g_strdup (""); /* force trailing semicolon */ + item->only_show_in[len - 1] = NULL; + + item->hidden = FALSE; + } + else + item->hidden = !item->hidden; /* write the result */ xfce_rc_set_group (rc, "Desktop Entry"); xfce_rc_write_bool_entry (rc, "Hidden", item->hidden); + xfce_rc_write_list_entry (rc, "OnlyShowIn", item->only_show_in, ";"); xfce_rc_close (rc); /* tell the view that we have most probably a new state */ diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c index 386470f..ea9b673 100644 --- a/xfce4-session/xfsm-compat-gnome.c +++ b/xfce4-session/xfsm-compat-gnome.c @@ -71,7 +71,6 @@ static gboolean gnome_compat_started = FALSE; static int keyring_lifetime_pipe[2]; static pid_t gnome_keyring_daemon_pid = 0; -static Window gnome_smproxy_window = None; static void child_setup (gpointer user_data) @@ -181,66 +180,12 @@ gnome_keyring_daemon_shutdown (void) -static void -xfsm_compat_gnome_smproxy_startup (void) -{ - Atom gnome_sm_proxy; - Display *dpy; - Window root; - - gdk_error_trap_push (); - - /* Set GNOME_SM_PROXY property, since some apps (like OOo) seem to require - * it to behave properly. Thanks to Jasper/Francois for reporting this. - * This has another advantage, since it prevents people from running - * gnome-smproxy in xfce4, which would cause trouble otherwise. - */ - dpy = gdk_display; - root = RootWindow (dpy, 0); - - if (gnome_smproxy_window != None) - XDestroyWindow (dpy, gnome_smproxy_window); - - gnome_sm_proxy = XInternAtom (dpy, "GNOME_SM_PROXY", False); - gnome_smproxy_window = XCreateSimpleWindow (dpy, root, 1, 1, 1, 1, 0, 0, 0); - - XChangeProperty (dpy, gnome_smproxy_window, gnome_sm_proxy, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) (void *) &gnome_smproxy_window, 1); - XChangeProperty (dpy, root, gnome_sm_proxy, - XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) (void *) &gnome_smproxy_window, 1); - - XSync (dpy, False); - - gdk_error_trap_pop (); -} - - -static void -xfsm_compat_gnome_smproxy_shutdown (void) -{ - gdk_error_trap_push (); - - if (gnome_smproxy_window != None) - { - XDestroyWindow (gdk_display, gnome_smproxy_window); - XSync (gdk_display, False); - gnome_smproxy_window = None; - } - - gdk_error_trap_pop (); -} - - void xfsm_compat_gnome_startup (XfsmSplashScreen *splash) { if (G_UNLIKELY (gnome_compat_started)) return; - xfsm_compat_gnome_smproxy_startup (); - /* fire up the keyring daemon */ if (G_LIKELY (splash != NULL)) xfsm_splash_screen_next (splash, _("Starting The Gnome Keyring Daemon")); @@ -262,22 +207,6 @@ xfsm_compat_gnome_shutdown (void) /* shutdown the keyring daemon */ gnome_keyring_daemon_shutdown (); - /* shutdown the GConf daemon */ - if (!g_spawn_command_line_sync ("gconftool-2 --shutdown", NULL, - NULL, &status, &error)) - { - g_warning ("Failed to shutdown the GConf daemon on logout: %s", - error->message); - g_error_free (error); - } - else if (status != 0) - { - g_warning ("Failed to shutdown the GConf daemon on logout: " - "gconftool-2 returned status %d", status); - } - - xfsm_compat_gnome_smproxy_shutdown (); - gnome_compat_started = FALSE; } diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c index c41fd39..39116eb 100644 --- a/xfce4-session/xfsm-startup.c +++ b/xfce4-session/xfsm-startup.c @@ -361,9 +361,7 @@ xfsm_startup_autostart_xdg (XfsmManager *manager, * then "KDE" is specified. */ for (m = 0, skip = TRUE; only_show_in[m] != NULL; ++m) { - if ((g_ascii_strcasecmp (only_show_in[m], "XFCE") == 0) || - (gnome && g_ascii_strcasecmp (only_show_in[m], "GNOME") == 0) || - (kde && g_ascii_strcasecmp (only_show_in[m], "KDE") == 0)) + if (g_ascii_strcasecmp (only_show_in[m], "XFCE") == 0) { skip = FALSE; break;