summaryrefslogtreecommitdiff
path: root/xfce4-session
diff options
context:
space:
mode:
authorSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2019-04-25 00:03:18 +0200
committerSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2019-04-27 00:37:24 +0200
commit9c858e04d64cda8460da8909b36c02f3314a4bee (patch)
treed8e7264f09848a2a8e7599311a9ced73f285dc2c /xfce4-session
parentf5a30fa3cd88d436de4ad486fb530610a791e857 (diff)
downloadxfce4-session-9c858e04d64cda8460da8909b36c02f3314a4bee.tar.gz
Drop splash screens
Diffstat (limited to 'xfce4-session')
-rw-r--r--xfce4-session/Makefile.am2
-rw-r--r--xfce4-session/main.c12
-rw-r--r--xfce4-session/xfsm-chooser.c17
-rw-r--r--xfce4-session/xfsm-chooser.h8
-rw-r--r--xfce4-session/xfsm-compat-gnome.c5
-rw-r--r--xfce4-session/xfsm-compat-gnome.h4
-rw-r--r--xfce4-session/xfsm-compat-kde.c7
-rw-r--r--xfce4-session/xfsm-compat-kde.h4
-rw-r--r--xfce4-session/xfsm-dns.c4
-rw-r--r--xfce4-session/xfsm-global.c1
-rw-r--r--xfce4-session/xfsm-global.h5
-rw-r--r--xfce4-session/xfsm-manager.c140
-rw-r--r--xfce4-session/xfsm-manager.h3
-rw-r--r--xfce4-session/xfsm-splash-screen.c305
-rw-r--r--xfce4-session/xfsm-splash-screen.h58
-rw-r--r--xfce4-session/xfsm-startup.c79
16 files changed, 151 insertions, 503 deletions
diff --git a/xfce4-session/Makefile.am b/xfce4-session/Makefile.am
index 3ea31c1a..b4a0ddf6 100644
--- a/xfce4-session/Makefile.am
+++ b/xfce4-session/Makefile.am
@@ -63,8 +63,6 @@ xfce4_session_SOURCES = \
xfsm-shutdown-fallback.h \
xfsm-shutdown.c \
xfsm-shutdown.h \
- xfsm-splash-screen.c \
- xfsm-splash-screen.h \
xfsm-startup.c \
xfsm-startup.h \
xfce-screensaver.c \
diff --git a/xfce4-session/main.c b/xfce4-session/main.c
index 3d124e47..8afdb452 100644
--- a/xfce4-session/main.c
+++ b/xfce4-session/main.c
@@ -137,14 +137,6 @@ init_display (XfsmManager *manager,
GdkDisplay *dpy,
gboolean disable_tcp)
{
- gchar *engine;
-
- engine = xfconf_channel_get_string (channel, "/splash/Engine", "mice");
-
- splash_screen = xfsm_splash_screen_new (dpy, engine);
- g_free (engine);
- xfsm_splash_screen_next (splash_screen, _("Loading desktop settings"));
-
gdk_flush ();
sm_init (channel, disable_tcp, manager);
@@ -195,12 +187,10 @@ bus_acquired (GDBusConnection *connection,
if (!opt_disable_tcp && xfconf_channel_get_bool (channel, "/security/EnableTcp", FALSE))
{
- /* verify that the DNS settings are ok */
- xfsm_splash_screen_next (splash_screen, _("Verifying DNS settings"));
+ /* verify that the DNS settings are ok */
xfsm_dns_check ();
}
- xfsm_splash_screen_next (splash_screen, _("Loading session data"));
xfsm_startup_init (channel);
xfsm_manager_load (manager, channel);
diff --git a/xfce4-session/xfsm-chooser.c b/xfce4-session/xfsm-chooser.c
index 948cfcf3..82bab8f1 100644
--- a/xfce4-session/xfsm-chooser.c
+++ b/xfce4-session/xfsm-chooser.c
@@ -36,7 +36,6 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
-#include <libxfsm/xfsm-splash-engine.h>
#include <libxfsm/xfsm-util.h>
#include <xfce4-session/xfsm-chooser.h>
@@ -146,6 +145,8 @@ xfsm_chooser_init (XfsmChooser *chooser)
GtkListStore *model;
GtkWidget *button;
GtkWidget *swin;
+ GtkWidget *vbox;
+ GtkWidget *label;
GtkWidget *dbox;
dbox = gtk_dialog_get_content_area(GTK_DIALOG (chooser));
@@ -153,6 +154,12 @@ xfsm_chooser_init (XfsmChooser *chooser)
g_signal_connect_after (G_OBJECT (chooser), "realize",
G_CALLBACK (xfsm_chooser_realized), chooser);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+ gtk_widget_set_margin_bottom (vbox, 6);
+ gtk_box_pack_start (GTK_BOX (dbox), vbox, TRUE, TRUE, 0);
+ label = gtk_label_new (_("Choose session"));
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
+
/* scrolled window */
swin = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
@@ -160,8 +167,11 @@ xfsm_chooser_init (XfsmChooser *chooser)
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin),
GTK_SHADOW_ETCHED_IN);
- gtk_box_pack_start (GTK_BOX (dbox), swin, TRUE, TRUE, 0);
- gtk_widget_show (swin);
+ gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (swin),
+ 200);
+ gtk_box_pack_start (GTK_BOX (vbox), swin, TRUE, TRUE, 0);
+
+ gtk_widget_show_all (vbox);
/* tree view */
model = gtk_list_store_new (N_COLUMNS,
@@ -235,4 +245,3 @@ xfsm_chooser_realized (GtkWidget *widget,
gdk_window_set_cursor (gtk_widget_get_window(widget), cursor);
g_object_unref (cursor);
}
-
diff --git a/xfce4-session/xfsm-chooser.h b/xfce4-session/xfsm-chooser.h
index e75f60a2..e8bb9565 100644
--- a/xfce4-session/xfsm-chooser.h
+++ b/xfce4-session/xfsm-chooser.h
@@ -37,6 +37,7 @@ G_BEGIN_DECLS;
typedef struct _XfsmChooser XfsmChooser;
typedef struct _XfsmChooserClass XfsmChooserClass;
+typedef struct _XfsmSessionInfo XfsmSessionInfo;
struct _XfsmChooserClass
{
@@ -50,6 +51,13 @@ struct _XfsmChooser
GtkWidget *tree;
};
+struct _XfsmSessionInfo
+{
+ gchar *name; /* name of the session */
+ time_t atime; /* last access time */
+ GdkPixbuf *preview; /* preview icon (52x42) */
+};
+
GType xfsm_chooser_get_type (void) G_GNUC_CONST;
void xfsm_chooser_set_sessions (XfsmChooser *chooser,
diff --git a/xfce4-session/xfsm-compat-gnome.c b/xfce4-session/xfsm-compat-gnome.c
index 8734fb9b..9b0c4137 100644
--- a/xfce4-session/xfsm-compat-gnome.c
+++ b/xfce4-session/xfsm-compat-gnome.c
@@ -243,7 +243,7 @@ xfsm_compat_gnome_smproxy_shutdown (void)
void
-xfsm_compat_gnome_startup (XfsmSplashScreen *splash)
+xfsm_compat_gnome_startup ()
{
if (G_UNLIKELY (gnome_compat_started))
return;
@@ -251,8 +251,6 @@ xfsm_compat_gnome_startup (XfsmSplashScreen *splash)
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"));
gnome_keyring_daemon_startup ();
gnome_compat_started = TRUE;
@@ -272,4 +270,3 @@ xfsm_compat_gnome_shutdown (void)
gnome_compat_started = FALSE;
}
-
diff --git a/xfce4-session/xfsm-compat-gnome.h b/xfce4-session/xfsm-compat-gnome.h
index b404ec1e..4c8b2cfc 100644
--- a/xfce4-session/xfsm-compat-gnome.h
+++ b/xfce4-session/xfsm-compat-gnome.h
@@ -24,9 +24,7 @@
#ifndef __XFSM_COMPAT_GNOME_H__
#define __XFSM_COMPAT_GNOME_H__
-#include <xfce4-session/xfsm-splash-screen.h>
-
-void xfsm_compat_gnome_startup (XfsmSplashScreen *splash);
+void xfsm_compat_gnome_startup ();
void xfsm_compat_gnome_shutdown (void);
#endif /* !__XFSM_COMPAT_GNOME_H__ */
diff --git a/xfce4-session/xfsm-compat-kde.c b/xfce4-session/xfsm-compat-kde.c
index 6b6f2f40..877dc7df 100644
--- a/xfce4-session/xfsm-compat-kde.c
+++ b/xfce4-session/xfsm-compat-kde.c
@@ -43,6 +43,7 @@
#include <unistd.h>
#endif
+#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <libxfce4util/libxfce4util.h>
@@ -115,16 +116,13 @@ run (const gchar *command)
void
-xfsm_compat_kde_startup (XfsmSplashScreen *splash)
+xfsm_compat_kde_startup ()
{
gchar command[256];
if (G_UNLIKELY (kde_compat_started))
return;
- if (G_LIKELY (splash != NULL))
- xfsm_splash_screen_next (splash, _("Starting KDE services"));
-
run ("kdeinit4");
/* tell klauncher about the session manager */
@@ -156,4 +154,3 @@ xfsm_compat_kde_shutdown (void)
kde_compat_started = FALSE;
}
-
diff --git a/xfce4-session/xfsm-compat-kde.h b/xfce4-session/xfsm-compat-kde.h
index 1e60de48..8a0d3e32 100644
--- a/xfce4-session/xfsm-compat-kde.h
+++ b/xfce4-session/xfsm-compat-kde.h
@@ -22,10 +22,8 @@
#ifndef __XFSM_COMPAT_KDE_H__
#define __XFSM_COMPAT_KDE_H__
-#include <xfce4-session/xfsm-splash-screen.h>
-
-void xfsm_compat_kde_startup (XfsmSplashScreen *splash);
+void xfsm_compat_kde_startup ();
void xfsm_compat_kde_shutdown (void);
#endif /* !__XFSM_COMPAT_KDE_H__ */
diff --git a/xfce4-session/xfsm-dns.c b/xfce4-session/xfsm-dns.c
index 3363b9f4..6e62d7ba 100644
--- a/xfce4-session/xfsm-dns.c
+++ b/xfce4-session/xfsm-dns.c
@@ -167,7 +167,7 @@ xfsm_dns_check (void)
gtk_dialog_set_default_response (GTK_DIALOG (msgbox), RESPONSE_TRY_AGAIN);
- response = xfsm_splash_screen_run (splash_screen, msgbox);
+ response = gtk_dialog_run (GTK_DIALOG (msgbox));
if (response != RESPONSE_TRY_AGAIN)
break;
@@ -177,5 +177,3 @@ xfsm_dns_check (void)
if (msgbox != NULL)
gtk_widget_destroy (msgbox);
}
-
-
diff --git a/xfce4-session/xfsm-global.c b/xfce4-session/xfsm-global.c
index 6aa8ef60..bbaf7844 100644
--- a/xfce4-session/xfsm-global.c
+++ b/xfce4-session/xfsm-global.c
@@ -58,7 +58,6 @@
/* global variables */
gboolean verbose = FALSE;
-XfsmSplashScreen *splash_screen = NULL;
void
xfsm_failsafe_client_free (FailsafeClient *fclient)
diff --git a/xfce4-session/xfsm-global.h b/xfce4-session/xfsm-global.h
index 3adeba83..78131bc7 100644
--- a/xfce4-session/xfsm-global.h
+++ b/xfce4-session/xfsm-global.h
@@ -23,10 +23,9 @@
#define __XFSM_GLOBAL_H__
#include <glib.h>
-
+#include <gdk/gdkx.h>
#include <X11/SM/SMlib.h>
-#include <xfce4-session/xfsm-splash-screen.h>
#include <xfce4-session/xfsm-shutdown.h> /* XfsmShutdownType */
#include "settings/xfae-model.h" /* XfsmRunHook */
@@ -45,8 +44,6 @@ void xfsm_failsafe_client_free (FailsafeClient *fclient);
extern gboolean verbose;
-extern XfsmSplashScreen *splash_screen;
-
#if defined(G_HAVE_ISO_VARARGS)
diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c
index 2419aab9..e847eea4 100644
--- a/xfce4-session/xfsm-manager.c
+++ b/xfce4-session/xfsm-manager.c
@@ -53,7 +53,6 @@
#include <libxfce4ui/libxfce4ui.h>
-#include <libxfsm/xfsm-splash-engine.h>
#include <libxfsm/xfsm-util.h>
#include <xfce4-session/xfsm-manager-dbus.h>
@@ -135,6 +134,9 @@ enum
static guint manager_signals[LAST_SIGNAL] = { 0, };
+int xfsm_splash_screen_choose (GList *sessions,
+ const gchar *default_session,
+ gchar **name_return);
static void xfsm_manager_finalize (GObject *obj);
static gboolean xfsm_manager_startup (XfsmManager *manager);
@@ -473,7 +475,7 @@ xfsm_manager_choose_session (XfsmManager *manager,
if (sessions != NULL)
{
- result = xfsm_splash_screen_choose (splash_screen, sessions,
+ result = xfsm_splash_screen_choose (sessions,
manager->session_name, &name);
if (result == XFSM_CHOOSE_LOGOUT)
@@ -643,6 +645,118 @@ xfsm_manager_load_failsafe (XfsmManager *manager,
}
+int
+xfsm_splash_screen_choose (GList *sessions,
+ const gchar *default_session,
+ gchar **name_return)
+{
+ GdkDisplay *display;
+ GdkScreen *screen;
+ int monitor;
+ GtkWidget *chooser;
+ GtkWidget *label;
+ GtkWidget *dialog;
+ GtkWidget *entry;
+ gchar title[256];
+ int result;
+
+ g_assert (default_session != NULL);
+
+
+again:
+ display = gdk_display_get_default ();
+ screen = xfce_gdk_screen_get_active (&monitor);
+
+ if (G_UNLIKELY (screen == NULL))
+ {
+ screen = gdk_display_get_default_screen (display);
+ monitor = 0;
+ }
+
+ chooser = g_object_new (XFSM_TYPE_CHOOSER,
+ "type", GTK_WINDOW_POPUP,
+ NULL);
+ xfsm_window_add_border (GTK_WINDOW (chooser));
+ xfsm_chooser_set_sessions (XFSM_CHOOSER (chooser),
+ sessions, default_session);
+ gtk_window_set_screen (GTK_WINDOW (chooser), screen);
+ gtk_window_set_position (GTK_WINDOW (chooser), GTK_WIN_POS_CENTER);
+ result = gtk_dialog_run (GTK_DIALOG (chooser));
+
+ if (result == XFSM_RESPONSE_LOAD)
+ {
+ if (name_return != NULL)
+ *name_return = xfsm_chooser_get_session (XFSM_CHOOSER (chooser));
+ result = XFSM_CHOOSE_LOAD;
+ }
+ else if (result == XFSM_RESPONSE_NEW)
+ {
+ result = XFSM_CHOOSE_NEW;
+ }
+ else
+ {
+ result = XFSM_CHOOSE_LOGOUT;
+ }
+
+ gtk_widget_destroy (chooser);
+
+ if (result == XFSM_CHOOSE_NEW)
+ {
+ dialog = gtk_dialog_new_with_buttons (NULL,
+ NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ _("_Cancel"),
+ GTK_RESPONSE_CANCEL,
+ _("_OK"),
+ GTK_RESPONSE_OK,
+ NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog),
+ GTK_RESPONSE_OK);
+ gtk_window_set_screen (GTK_WINDOW (dialog), screen);
+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
+ g_snprintf (title, 256, "<big>%s</big>",
+ _("Choose a name for the new session:"));
+ label = gtk_label_new (title);
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ label, TRUE, TRUE, 6);
+ gtk_widget_show (label);
+
+ entry = gtk_entry_new ();
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+ entry, TRUE, TRUE, 6);
+ gtk_widget_show (entry);
+
+ xfsm_window_add_border (GTK_WINDOW (dialog));
+
+again1:
+ result = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ if (result != GTK_RESPONSE_OK)
+ {
+ gtk_widget_destroy (dialog);
+ goto again;
+ }
+
+ if (name_return != NULL)
+ {
+ *name_return = gtk_editable_get_chars (GTK_EDITABLE (entry),
+ 0, -1);
+ if (strlen (*name_return) == 0)
+ {
+ g_free (*name_return);
+ goto again1;
+ }
+ }
+
+ gtk_widget_destroy (dialog);
+ result = XFSM_CHOOSE_NEW;
+ }
+
+ return result;
+}
+
+
static void
xfsm_manager_load_settings (XfsmManager *manager,
XfconfChannel *channel)
@@ -673,12 +787,6 @@ xfsm_manager_load_settings (XfsmManager *manager,
if (!xfsm_manager_load_failsafe (manager, channel, &errorstr))
{
- if (G_LIKELY (splash_screen != NULL))
- {
- xfsm_splash_screen_free (splash_screen);
- splash_screen = NULL;
- }
-
/* FIXME: migrate this into the splash screen somehow so the
* window doesn't look ugly (right now no WM is running, so it
* won't have window decorations). */
@@ -731,27 +839,11 @@ xfsm_manager_load (XfsmManager *manager,
gboolean
xfsm_manager_restart (XfsmManager *manager)
{
- GdkPixbuf *preview;
- unsigned steps;
-
g_assert (manager->session_name != NULL);
/* setup legacy application handling */
xfsm_legacy_init ();
- /* tell splash screen that the session is starting now */
- preview = xfsm_load_session_preview (manager->session_name);
- if (preview == NULL)
- {
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- /* TODO: Turn this into a normal pixbuf? */
- preview = gdk_pixbuf_new_from_inline (-1, xfsm_chooser_icon_data, FALSE, NULL);
- G_GNUC_END_IGNORE_DEPRECATIONS
- }
- steps = g_queue_get_length (manager->failsafe_mode ? manager->failsafe_clients : manager->pending_properties);
- xfsm_splash_screen_start (splash_screen, manager->session_name, preview, steps);
- g_object_unref (preview);
-
g_idle_add ((GSourceFunc) xfsm_manager_startup, manager);
return TRUE;
diff --git a/xfce4-session/xfsm-manager.h b/xfce4-session/xfsm-manager.h
index 8918175a..0691a0e9 100644
--- a/xfce4-session/xfsm-manager.h
+++ b/xfce4-session/xfsm-manager.h
@@ -42,6 +42,9 @@ G_BEGIN_DECLS
#define SAVE_TIMEOUT ( 60 * 1000)
#define STARTUP_TIMEOUT ( 8 * 1000)
#define RESTART_RESET_TIMEOUT (5 * 60 * 1000)
+#define XFSM_CHOOSE_LOGOUT 0
+#define XFSM_CHOOSE_LOAD 1
+#define XFSM_CHOOSE_NEW 2
typedef enum
{
diff --git a/xfce4-session/xfsm-splash-screen.c b/xfce4-session/xfsm-splash-screen.c
deleted file mode 100644
index 60ba68cc..00000000
--- a/xfce4-session/xfsm-splash-screen.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2003-2006 Benedikt Meurer <benny@xfce.org>
- * All rights reserved.
- *
- * This program 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 Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <gmodule.h>
-
-#include <xfconf/xfconf.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfce4ui/libxfce4ui.h>
-
-#include <libxfsm/xfsm-splash-engine.h>
-#include <libxfsm/xfsm-util.h>
-
-#include <xfce4-session/xfsm-chooser.h>
-#include <xfce4-session/xfsm-splash-screen.h>
-
-
-struct _XfsmSplashScreen
-{
- XfsmSplashEngine engine;
- GModule *module;
-};
-
-
-static void xfsm_splash_screen_load (XfsmSplashScreen *splash,
- const gchar *engine);
-
-
-XfsmSplashScreen*
-xfsm_splash_screen_new (GdkDisplay *display,
- const gchar *engine)
-{
- XfsmSplashScreen *splash;
- XfsmSplashRc *splash_rc;
- GdkScreen *screen;
- gchar name[128];
- int monitor;
- XfconfChannel *channel;
-
- /* locate monitor with pointer */
- screen = xfce_gdk_screen_get_active (&monitor);
-
- if (G_UNLIKELY (screen == NULL) || (gdk_screen_get_display (screen) != display))
- {
- screen = gdk_display_get_default_screen (display);
- monitor = 0;
- }
-
- /* initialize the screen struct */
- splash = g_new0 (XfsmSplashScreen, 1);
- splash->engine.display = display;
- splash->engine.primary_screen = screen;
- splash->engine.primary_monitor = monitor;
-
- /* load and setup the engine */
- if (G_LIKELY (engine != NULL && *engine != '\0'))
- {
- xfsm_splash_screen_load (splash, engine);
- if (G_LIKELY (splash->engine.setup != NULL))
- {
- g_snprintf (name, sizeof(name), "/splash/engines/%s", engine);
- channel = xfconf_channel_new_with_property_base ("xfce4-session",
- name);
- splash_rc = xfsm_splash_rc_new (channel);
- g_object_unref (channel);
- splash->engine.setup (&splash->engine, splash_rc);
- xfsm_splash_rc_free (splash_rc);
-
- gdk_flush ();
- }
- }
-
- return splash;
-}
-
-
-void
-xfsm_splash_screen_start (XfsmSplashScreen *splash,
- const gchar *name,
- GdkPixbuf *preview,
- unsigned steps)
-{
- if (G_LIKELY (splash->engine.start != NULL))
- {
- splash->engine.start (&splash->engine, name, preview, steps);
- gdk_flush ();
- }
-}
-
-
-void
-xfsm_splash_screen_next (XfsmSplashScreen *splash,
- const gchar *text)
-{
- if (G_LIKELY (splash->engine.next != NULL))
- {
- splash->engine.next (&splash->engine, text);
- gdk_flush ();
- }
-}
-
-
-int
-xfsm_splash_screen_run (XfsmSplashScreen *splash,
- GtkWidget *dialog)
-{
- int result;
-
- if (G_LIKELY (splash->engine.run != NULL))
- {
- result = splash->engine.run (&splash->engine, dialog);
- }
- else
- {
- gtk_window_set_screen (GTK_WINDOW (dialog), splash->engine.primary_screen);
- gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
-
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- }
-
- return result;
-}
-
-
-int
-xfsm_splash_screen_choose (XfsmSplashScreen *splash,
- GList *sessions,
- const gchar *default_session,
- gchar **name_return)
-{
- GtkWidget *chooser;
- GtkWidget *label;
- GtkWidget *dialog;
- GtkWidget *entry;
- gchar title[256];
- int result;
-
- g_assert (default_session != NULL);
-
- if (splash->engine.choose != NULL)
- {
- result = splash->engine.choose (&splash->engine,
- sessions,
- default_session,
- name_return);
- }
- else
- {
-again:
- xfsm_splash_screen_next (splash, _("Choose session"));
-
- chooser = g_object_new (XFSM_TYPE_CHOOSER,
- "screen", splash->engine.primary_screen,
- "type", GTK_WINDOW_POPUP,
- NULL);
- xfsm_window_add_border (GTK_WINDOW (chooser));
- xfsm_chooser_set_sessions (XFSM_CHOOSER (chooser),
- sessions, default_session);
- result = xfsm_splash_screen_run (splash, chooser);
-
- if (result == XFSM_RESPONSE_LOAD)
- {
- if (name_return != NULL)
- *name_return = xfsm_chooser_get_session (XFSM_CHOOSER (chooser));
- result = XFSM_CHOOSE_LOAD;
- }
- else if (result == XFSM_RESPONSE_NEW)
- {
- result = XFSM_CHOOSE_NEW;
- }
- else
- {
- result = XFSM_CHOOSE_LOGOUT;
- }
-
- gtk_widget_destroy (chooser);
-
- if (result == XFSM_CHOOSE_NEW)
- {
- xfsm_splash_screen_next (splash, _("Choose session name"));
-
- dialog = gtk_dialog_new_with_buttons (NULL,
- NULL,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- _("_Cancel"),
- GTK_RESPONSE_CANCEL,
- _("_OK"),
- GTK_RESPONSE_OK,
- NULL);
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK);
-
- g_snprintf (title, 256, "<big>%s</big>",
- _("Choose a name for the new session:"));
- label = gtk_label_new (title);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
- label, TRUE, TRUE, 6);
- gtk_widget_show (label);
-
- entry = gtk_entry_new ();
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
- entry, TRUE, TRUE, 6);
- gtk_widget_show (entry);
-
- xfsm_window_add_border (GTK_WINDOW (dialog));
-
-again1:
- result = xfsm_splash_screen_run (splash, dialog);
-
- if (result != GTK_RESPONSE_OK)
- {
- gtk_widget_destroy (dialog);
- goto again;
- }
-
- if (name_return != NULL)
- {
- *name_return = gtk_editable_get_chars (GTK_EDITABLE (entry),
- 0, -1);
- if (strlen (*name_return) == 0)
- {
- g_free (*name_return);
- goto again1;
- }
- }
-
- gtk_widget_destroy (dialog);
- result = XFSM_CHOOSE_NEW;
- }
- }
-
- return result;
-}
-
-
-void
-xfsm_splash_screen_free (XfsmSplashScreen *splash)
-{
- if (G_LIKELY (splash->engine.destroy != NULL))
- splash->engine.destroy (&splash->engine);
- if (G_LIKELY (splash->module != NULL))
- g_module_close (splash->module);
- g_free (splash);
-}
-
-
-static void
-xfsm_splash_screen_load (XfsmSplashScreen *splash,
- const gchar *engine)
-{
- void (*init) (XfsmSplashEngine *engine);
- gchar *filename;
-
- filename = g_module_build_path (LIBDIR "/xfce4/session/splash-engines", engine);
- splash->module = g_module_open (filename, G_MODULE_BIND_LOCAL);
- g_free (filename);
-
- if (G_LIKELY (splash->module != NULL))
- {
- if (g_module_symbol (splash->module, "engine_init", (gpointer)&init))
- {
- init (&splash->engine);
- }
- else
- {
- g_module_close (splash->module);
- splash->module = NULL;
- }
- }
- else
- {
- g_warning ("Unable to load engine \"%s\": %s", engine, g_module_error ());
- }
-}
-
-
diff --git a/xfce4-session/xfsm-splash-screen.h b/xfce4-session/xfsm-splash-screen.h
deleted file mode 100644
index f68c5d47..00000000
--- a/xfce4-session/xfsm-splash-screen.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $Id$ */
-/*-
- * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org>
- * All rights reserved.
- *
- * This program 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 Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301 USA.
- */
-
-#ifndef __XFSM_SPLASH_SCREEN_H__
-#define __XFSM_SPLASH_SCREEN_H__
-
-#include <gtk/gtk.h>
-
-#include <libxfce4util/libxfce4util.h>
-
-
-G_BEGIN_DECLS;
-
-typedef struct _XfsmSplashScreen XfsmSplashScreen;
-
-XfsmSplashScreen *xfsm_splash_screen_new (GdkDisplay *display,
- const gchar *engine);
-
-void xfsm_splash_screen_start (XfsmSplashScreen *splash,
- const gchar *name,
- GdkPixbuf *preview,
- unsigned steps);
-
-void xfsm_splash_screen_next (XfsmSplashScreen *splash,
- const gchar *text);
-
-int xfsm_splash_screen_run (XfsmSplashScreen *splash,
- GtkWidget *dialog);
-
-int xfsm_splash_screen_choose (XfsmSplashScreen *splash,
- GList *sessions,
- const gchar *default_session,
- gchar **name_return);
-
-void xfsm_splash_screen_free (XfsmSplashScreen *splash);
-
-G_END_DECLS;
-
-
-#endif /* !__XFSM_SPLASH_SCREEN_H__ */
diff --git a/xfce4-session/xfsm-startup.c b/xfce4-session/xfsm-startup.c
index 1f93100f..4f176566 100644
--- a/xfce4-session/xfsm-startup.c
+++ b/xfce4-session/xfsm-startup.c
@@ -62,7 +62,6 @@
#include <xfce4-session/xfsm-compat-kde.h>
#include <xfce4-session/xfsm-global.h>
#include <xfce4-session/xfsm-manager.h>
-#include <xfce4-session/xfsm-splash-screen.h>
#include <xfce4-session/xfsm-systemd.h>
#include <xfce4-session/xfsm-startup.h>
@@ -392,20 +391,6 @@ xfsm_startup_shutdown (void)
}
-
-static gboolean
-destroy_splash (gpointer user_data)
-{
- if (G_LIKELY (splash_screen != NULL))
- {
- xfsm_splash_screen_free (splash_screen);
- splash_screen = NULL;
- }
-
- return FALSE;
-}
-
-
static const gchar*
figure_app_name (const gchar *program_path)
{
@@ -470,21 +455,7 @@ figure_app_name (const gchar *program_path)
static void
xfsm_startup_autostart (XfsmManager *manager)
{
- gint n;
-
- n = xfsm_launch_desktop_files_on_login (FALSE);
-
- if (n > 0)
- {
- if (G_LIKELY (splash_screen != NULL))
- xfsm_splash_screen_next (splash_screen, _("Performing Autostart..."));
-
- g_timeout_add (2000, destroy_splash, NULL);
- }
- else
- {
- g_timeout_add (1000, destroy_splash, NULL);
- }
+ xfsm_launch_desktop_files_on_login (FALSE);
}
@@ -493,10 +464,10 @@ void
xfsm_startup_foreign (XfsmManager *manager)
{
if (xfsm_manager_get_compat_startup(manager, XFSM_MANAGER_COMPAT_KDE))
- xfsm_compat_kde_startup (splash_screen);
+ xfsm_compat_kde_startup ();
if (xfsm_manager_get_compat_startup(manager, XFSM_MANAGER_COMPAT_GNOME))
- xfsm_compat_gnome_startup (splash_screen);
+ xfsm_compat_gnome_startup ();
}
@@ -582,9 +553,6 @@ xfsm_startup_at (XfsmManager *manager)
if (n > 0)
{
- if (G_LIKELY (splash_screen != NULL))
- xfsm_splash_screen_next (splash_screen, _("Starting Assistive Technologies"));
-
xfsm_startup_at_set_gtk_modules ();
/* wait for 2 seconds until the at-spi registered, not very nice
@@ -632,14 +600,6 @@ xfsm_startup_failsafe (XfsmManager *manager)
while ((fclient = g_queue_pop_head (failsafe_clients)))
{
- /* FIXME: splash */
- /* let the user know whats going on */
- if (G_LIKELY (splash_screen != NULL))
- {
- xfsm_splash_screen_next (splash_screen,
- figure_app_name (fclient->command[0]));
- }
-
/* start the application */
xfsm_start_application (fclient->command, NULL, fclient->screen,
NULL, NULL, NULL);
@@ -779,39 +739,6 @@ xfsm_startup_session_next_prio_group (XfsmManager *manager)
break;
}
- /* FIXME: splash */
- if (G_LIKELY (splash_screen != NULL))
- {
- const gchar *app_name = NULL;
- const gchar *desktop_file;
- XfceRc *rcfile = NULL;
-
- desktop_file = xfsm_properties_get_string (properties, GsmDesktopFile);
-
- if (desktop_file)
- {
- rcfile = xfce_rc_simple_open (desktop_file, TRUE);
- if (rcfile)
- {
- xfce_rc_set_group (rcfile, "Desktop Entry");
- app_name = xfce_rc_read_entry (rcfile, "Name", NULL);
- }
- }
-
- if (!app_name)
- app_name = figure_app_name (xfsm_properties_get_string (properties,
- SmProgram));
-
- xfsm_splash_screen_next (splash_screen, app_name);
-
- if (rcfile)
- {
- /* delay closing because app_name belongs to the rcfile
- * if we found it in the file */
- xfce_rc_close (rcfile);
- }
- }
-
if (G_LIKELY (xfsm_startup_start_properties (properties, manager)))
{
g_queue_push_tail (starting_properties, properties);