Accepting request 126853 from home:vuntz:branches:GNOME:Factory

Drop patches

OBS-URL: https://build.opensuse.org/request/show/126853
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-session?expand=0&rev=157
This commit is contained in:
Dominique Leuenberger 2012-07-02 11:11:49 +00:00 committed by Git OBS Bridge
parent 32c2461359
commit 13c431af2c
6 changed files with 19 additions and 791 deletions

2
.gitattributes vendored
View File

@ -21,5 +21,3 @@
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
## Specific LFS patterns
gnome-session-sleep.svg filter=lfs diff=lfs merge=lfs -text

View File

@ -1,721 +0,0 @@
Index: gnome-session/gsm-manager.c
===================================================================
--- gnome-session/gsm-manager.c.orig
+++ gnome-session/gsm-manager.c
@@ -2836,7 +2836,8 @@ logout_dialog_response (GsmLogoutDialog
display = gtk_widget_get_display (GTK_WIDGET (logout_dialog));
- gtk_widget_destroy (GTK_WIDGET (logout_dialog));
+ if (response_id != GTK_RESPONSE_HELP)
+ gtk_widget_destroy (GTK_WIDGET (logout_dialog));
/* In case of dialog cancel, switch user, hibernate and
* suspend, we just perform the respective action and return,
@@ -2846,6 +2847,10 @@ logout_dialog_response (GsmLogoutDialog
case GTK_RESPONSE_NONE:
case GTK_RESPONSE_DELETE_EVENT:
break;
+ case GTK_RESPONSE_HELP:
+ gsm_util_help_display (GTK_WINDOW (logout_dialog),
+ "gosgetstarted-73");
+ break;
case GSM_LOGOUT_RESPONSE_SWITCH_USER:
request_switch_user (display, manager);
break;
Index: gnome-session/gsm-util.c
===================================================================
--- gnome-session/gsm-util.c.orig
+++ gnome-session/gsm-util.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <stdlib.h>
#include <ctype.h>
+#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
@@ -503,3 +504,86 @@ gsm_util_setenv (const char *variable,
g_error_free (bus_error);
}
}
+
+void
+gsm_util_help_display (GtkWindow *parent,
+ const char *link_id)
+{
+ GError *error = NULL;
+ const char *lang;
+ char *uri = NULL;
+ gboolean found;
+
+ int i;
+
+ const char * const * langs = g_get_language_names ();
+
+ uri = NULL;
+ found = FALSE;
+
+ for (i = 0; langs[i]; i++) {
+ lang = langs[i];
+ if (strchr (lang, '.')) {
+ continue;
+ }
+
+ uri = g_build_filename (DATADIR,
+ "/gnome/help/user-guide/",
+ lang,
+ "/user-guide.xml",
+ NULL);
+
+ if (g_file_test (uri, G_FILE_TEST_EXISTS)) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found) {
+ GAppInfo *app_info;
+ char *command;
+
+ if (link_id) {
+ command = g_strconcat ("gnome-open ghelp://", uri, "?", link_id, NULL);
+ } else {
+ command = g_strconcat ("gnome-open ghelp://", uri, NULL);
+ }
+
+ app_info = g_app_info_create_from_commandline (command, "gnome-open",G_APP_INFO_CREATE_NONE, &error);
+ g_free (command);
+
+ if (error == NULL && app_info != NULL) {
+ GdkScreen *screen;
+ GdkAppLaunchContext *context;
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (parent));
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+ g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT (context), &error);
+
+ g_object_unref (context);
+ g_object_unref (app_info);
+ }
+ }
+
+ if (!found || error != NULL) {
+ GtkWidget *d;
+ const char *errmsg;
+
+ if (!found)
+ errmsg = _("Cannot find help.");
+ else {
+ errmsg = error->message;
+ g_error_free (error);
+ }
+
+ d = gtk_message_dialog_new (parent,
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "%s", errmsg);
+ gtk_widget_show (GTK_WIDGET (d));
+ g_signal_connect (d, "response",
+ G_CALLBACK (gtk_widget_destroy), NULL);
+ }
+
+ g_free (uri);
+}
Index: gnome-session/gsm-util.h
===================================================================
--- gnome-session/gsm-util.h.orig
+++ gnome-session/gsm-util.h
@@ -21,6 +21,7 @@
#define __GSM_UTIL_H__
#include <glib.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -49,6 +50,9 @@ char * gsm_util_generate_startup_id
void gsm_util_setenv (const char *variable,
const char *value);
+void gsm_util_help_display (GtkWindow *parent,
+ const char * link_id);
+
G_END_DECLS
#endif /* __GSM_UTIL_H__ */
Index: gnome-session/Makefile.am
===================================================================
--- gnome-session/Makefile.am.orig
+++ gnome-session/Makefile.am
@@ -91,6 +91,10 @@ libgsmutil_la_SOURCES = \
gsm-util.c \
gsm-util.h
+libgsmutil_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DDATADIR=\""$(datadir)"\"
+
libgsmutil_la_LIBADD = \
$(GNOME_SESSION_LIBS)
Index: gnome-session/gsm-logout-dialog.c
===================================================================
--- gnome-session/gsm-logout-dialog.c.orig
+++ gnome-session/gsm-logout-dialog.c
@@ -38,8 +38,13 @@
#define AUTOMATIC_ACTION_TIMEOUT 60
-#define GSM_ICON_LOGOUT "system-log-out"
-#define GSM_ICON_SHUTDOWN "system-shutdown"
+#define GSM_ICON_LOGOUT "system-log-out"
+#define GSM_ICON_SWITCH "system-users"
+#define GSM_ICON_SHUTDOWN "system-shutdown"
+#define GSM_ICON_REBOOT "view-refresh"
+/* TODO: use gpm icons? */
+#define GSM_ICON_HIBERNATE "drive-harddisk"
+#define GSM_ICON_SLEEP "gnome-session-sleep"
typedef enum {
GSM_DIALOG_LOGOUT_TYPE_LOGOUT,
@@ -48,11 +53,12 @@ typedef enum {
struct _GsmLogoutDialogPrivate
{
- GsmDialogLogoutType type;
-
UpClient *up_client;
GsmConsolekit *consolekit;
+ GtkWidget *info_label;
+ GtkWidget *cancel_button;
+
int timeout;
unsigned int timeout_id;
@@ -61,7 +67,8 @@ struct _GsmLogoutDialogPrivate
static GsmLogoutDialog *current_dialog = NULL;
-static void gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog);
+static void gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog,
+ int seconds);
static void gsm_logout_dialog_destroy (GsmLogoutDialog *logout_dialog,
gpointer data);
@@ -69,43 +76,10 @@ static void gsm_logout_dialog_destroy (
static void gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog,
gpointer data);
-enum {
- PROP_0,
- PROP_MESSAGE_TYPE
-};
-
-G_DEFINE_TYPE (GsmLogoutDialog, gsm_logout_dialog, GTK_TYPE_MESSAGE_DIALOG);
+static void gsm_logout_set_info_text (GsmLogoutDialog *logout_dialog,
+ int seconds);
-static void
-gsm_logout_dialog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- switch (prop_id) {
- case PROP_MESSAGE_TYPE:
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gsm_logout_dialog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (prop_id) {
- case PROP_MESSAGE_TYPE:
- g_value_set_enum (value, GTK_MESSAGE_WARNING);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
+G_DEFINE_TYPE (GsmLogoutDialog, gsm_logout_dialog, GTK_TYPE_DIALOG);
static void
gsm_logout_dialog_class_init (GsmLogoutDialogClass *klass)
@@ -114,18 +88,6 @@ gsm_logout_dialog_class_init (GsmLogoutD
gobject_class = G_OBJECT_CLASS (klass);
- /* This is a workaround to avoid a stupid crash: libgnomeui
- * listens for the "show" signal on all GtkMessageDialog and
- * gets the "message-type" of the dialogs. We will crash when
- * it accesses this property if we don't override it since we
- * didn't define it. */
- gobject_class->set_property = gsm_logout_dialog_set_property;
- gobject_class->get_property = gsm_logout_dialog_get_property;
-
- g_object_class_override_property (gobject_class,
- PROP_MESSAGE_TYPE,
- "message-type");
-
g_type_class_add_private (klass, sizeof (GsmLogoutDialogPrivate));
}
@@ -137,11 +99,22 @@ gsm_logout_dialog_init (GsmLogoutDialog
logout_dialog->priv->timeout_id = 0;
logout_dialog->priv->timeout = 0;
logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL;
+ logout_dialog->priv->info_label = NULL;
- gtk_window_set_skip_taskbar_hint (GTK_WINDOW (logout_dialog), TRUE);
+ gtk_window_set_resizable (GTK_WINDOW (logout_dialog), FALSE);
gtk_window_set_keep_above (GTK_WINDOW (logout_dialog), TRUE);
gtk_window_stick (GTK_WINDOW (logout_dialog));
+ /* use HIG spacings */
+ gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (logout_dialog))), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (logout_dialog), 6);
+
+ gtk_dialog_add_button (GTK_DIALOG (logout_dialog), GTK_STOCK_HELP,
+ GTK_RESPONSE_HELP);
+ logout_dialog->priv->cancel_button =
+ gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+
logout_dialog->priv->up_client = up_client_new ();
logout_dialog->priv->consolekit = gsm_get_consolekit ();
@@ -229,40 +202,28 @@ gsm_logout_supports_shutdown (GsmLogoutD
}
static void
-gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog, gpointer user_data)
+gsm_logout_dialog_show (GsmLogoutDialog *logout_dialog,
+ gpointer user_data)
{
- gsm_logout_dialog_set_timeout (logout_dialog);
+ gsm_logout_set_info_text (logout_dialog, AUTOMATIC_ACTION_TIMEOUT);
+
+ if (logout_dialog->priv->default_response != GTK_RESPONSE_CANCEL)
+ gsm_logout_dialog_set_timeout (logout_dialog,
+ AUTOMATIC_ACTION_TIMEOUT);
}
-static gboolean
-gsm_logout_dialog_timeout (gpointer data)
+static void
+gsm_logout_set_info_text (GsmLogoutDialog *logout_dialog,
+ int seconds_to_show)
{
- GsmLogoutDialog *logout_dialog;
- char *seconds_warning;
- char *secondary_text;
- int seconds_to_show;
- static char *session_type = NULL;
+ const char *seconds_warning;
+ char *secondary_text;
+ char *buf;
+ char *markup;
+ static char *session_type = NULL;
- logout_dialog = (GsmLogoutDialog *) data;
-
- if (!logout_dialog->priv->timeout) {
- gtk_dialog_response (GTK_DIALOG (logout_dialog),
- logout_dialog->priv->default_response);
-
- return FALSE;
- }
-
- if (logout_dialog->priv->timeout <= 30) {
- seconds_to_show = logout_dialog->priv->timeout;
- } else {
- seconds_to_show = (logout_dialog->priv->timeout/10) * 10;
-
- if (logout_dialog->priv->timeout % 10)
- seconds_to_show += 10;
- }
-
- switch (logout_dialog->priv->type) {
- case GSM_DIALOG_LOGOUT_TYPE_LOGOUT:
+ switch (logout_dialog->priv->default_response) {
+ case GSM_LOGOUT_RESPONSE_LOGOUT:
seconds_warning = ngettext ("You will be automatically logged "
"out in %d second.",
"You will be automatically logged "
@@ -270,7 +231,7 @@ gsm_logout_dialog_timeout (gpointer data
seconds_to_show);
break;
- case GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:
+ case GSM_LOGOUT_RESPONSE_SHUTDOWN:
seconds_warning = ngettext ("This system will be automatically "
"shut down in %d second.",
"This system will be automatically "
@@ -278,6 +239,10 @@ gsm_logout_dialog_timeout (gpointer data
seconds_to_show);
break;
+ case GTK_RESPONSE_CANCEL:
+ seconds_warning = "";
+ break;
+
default:
g_assert_not_reached ();
}
@@ -312,25 +277,50 @@ gsm_logout_dialog_timeout (gpointer data
secondary_text = g_strdup (seconds_warning);
}
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (logout_dialog),
- secondary_text,
- seconds_to_show,
- NULL);
+ buf = g_strdup_printf (secondary_text, seconds_to_show);
+ markup = g_markup_printf_escaped ("<i>%s</i>", buf);
+ g_free (buf);
+ gtk_label_set_markup (GTK_LABEL (logout_dialog->priv->info_label),
+ markup);
+ g_free (markup);
+}
- logout_dialog->priv->timeout--;
+static gboolean
+gsm_logout_dialog_timeout (gpointer data)
+{
+ GsmLogoutDialog *logout_dialog;
+ int seconds_to_show;
+
+ logout_dialog = (GsmLogoutDialog *) data;
+
+ if (!logout_dialog->priv->timeout) {
+ gtk_dialog_response (GTK_DIALOG (logout_dialog),
+ logout_dialog->priv->default_response);
- g_free (secondary_text);
+ return FALSE;
+ }
+
+ if (logout_dialog->priv->timeout <= 30) {
+ seconds_to_show = logout_dialog->priv->timeout;
+ } else {
+ seconds_to_show = (logout_dialog->priv->timeout/10) * 10;
+
+ if (logout_dialog->priv->timeout % 10)
+ seconds_to_show += 10;
+ }
+
+ gsm_logout_set_info_text (logout_dialog, seconds_to_show);
+
+ logout_dialog->priv->timeout--;
return TRUE;
}
static void
-gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog)
+gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog,
+ int seconds)
{
- logout_dialog->priv->timeout = AUTOMATIC_ACTION_TIMEOUT;
-
- /* Sets the secondary text */
- gsm_logout_dialog_timeout (logout_dialog);
+ logout_dialog->priv->timeout = seconds;
if (logout_dialog->priv->timeout_id != 0) {
g_source_remove (logout_dialog->priv->timeout_id);
@@ -342,14 +332,120 @@ gsm_logout_dialog_set_timeout (GsmLogout
}
static GtkWidget *
+gsm_logout_tile_new (const char *icon_name,
+ const char *title,
+ const char *description)
+{
+ GtkWidget *button;
+ GtkWidget *alignment;
+ GtkWidget *hbox;
+ GtkWidget *vbox;
+ GtkWidget *image;
+ GtkWidget *label;
+ char *markup;
+
+ g_assert (title != NULL);
+
+ button = GTK_WIDGET (gtk_button_new ());
+ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+
+ alignment = gtk_alignment_new (0, 0.5, 0, 0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 6, 6);
+ gtk_container_add (GTK_CONTAINER (button), alignment);
+
+ hbox = gtk_hbox_new (FALSE, 12);
+ gtk_container_add (GTK_CONTAINER (alignment), hbox);
+ if (icon_name != NULL) {
+ image = gtk_image_new_from_icon_name (icon_name,
+ GTK_ICON_SIZE_DIALOG);
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ }
+
+ vbox = gtk_vbox_new (FALSE, 2);
+
+ markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
+ title);
+ label = gtk_label_new (markup);
+ g_free (markup);
+
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ if (description != NULL) {
+ gchar *markup;
+ GdkColor *color;
+ GtkWidget *label;
+ GtkStyle *style;
+
+ style = gtk_widget_get_style (GTK_WIDGET (button));
+ color = &style->fg[GTK_STATE_INSENSITIVE];
+ markup = g_markup_printf_escaped ("<span size=\"small\" foreground=\"#%.2x%.2x%.2x\">%s</span>",
+ color->red,
+ color->green,
+ color->blue,
+ description);
+ label = gtk_label_new (markup);
+ g_free (markup);
+
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+ }
+
+ gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+ return button;
+}
+
+static void
+gsm_logout_tile_clicked (GtkWidget *tile,
+ gpointer response_p)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_widget_get_toplevel (tile);
+ g_assert (GTK_IS_DIALOG (dialog));
+ gtk_dialog_response (GTK_DIALOG (dialog),
+ GPOINTER_TO_UINT (response_p));
+}
+
+static GtkWidget *
+gsm_logout_append_tile (GtkWidget *vbox,
+ unsigned int response,
+ const char *icon_name,
+ const char *title,
+ const char *description)
+{
+ GtkWidget *tile;
+
+ tile = gsm_logout_tile_new (icon_name, title, description);
+ gtk_box_pack_start (GTK_BOX (vbox), tile, TRUE, TRUE, 0);
+ gtk_widget_show_all (tile);
+
+ g_signal_connect (tile,
+ "clicked",
+ G_CALLBACK (gsm_logout_tile_clicked),
+ GUINT_TO_POINTER (response));
+
+ return tile;
+}
+
+static GtkWidget *
gsm_get_dialog (GsmDialogLogoutType type,
GdkScreen *screen,
guint32 activate_time)
{
GsmLogoutDialog *logout_dialog;
- GtkWidget *dialog_image;
- const char *primary_text;
+ GtkWidget *vbox;
+ GtkWidget *tile;
const char *icon_name;
+ const char *title;
if (current_dialog != NULL) {
gtk_widget_destroy (GTK_WIDGET (current_dialog));
@@ -359,83 +455,119 @@ gsm_get_dialog (GsmDialogLogoutType type
current_dialog = logout_dialog;
- gtk_window_set_title (GTK_WINDOW (logout_dialog), "");
-
- logout_dialog->priv->type = type;
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (logout_dialog))), vbox,
+ FALSE, FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+ gtk_widget_show (vbox);
icon_name = NULL;
- primary_text = NULL;
+ title = NULL;
switch (type) {
case GSM_DIALOG_LOGOUT_TYPE_LOGOUT:
icon_name = GSM_ICON_LOGOUT;
- primary_text = _("Log out of this system now?");
+ title = _("Log Out of the Session");
logout_dialog->priv->default_response = GSM_LOGOUT_RESPONSE_LOGOUT;
- if (gsm_logout_supports_switch_user (logout_dialog)) {
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
+
+ gsm_logout_append_tile (vbox, GSM_LOGOUT_RESPONSE_LOGOUT,
+ GSM_ICON_LOGOUT, _("_Log Out"),
+ _("Ends your session and logs you "
+ "out."));
+
+ tile = gsm_logout_append_tile (vbox,
+ GSM_LOGOUT_RESPONSE_SWITCH_USER,
+ GSM_ICON_SWITCH,
_("_Switch User"),
- GSM_LOGOUT_RESPONSE_SWITCH_USER);
+ _("Suspends your session, "
+ "allowing another user to "
+ "log in and use the "
+ "computer."));
+ if (!gsm_logout_supports_switch_user (logout_dialog)) {
+ gtk_widget_set_sensitive (tile, FALSE);
}
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL);
-
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- _("_Log Out"),
- GSM_LOGOUT_RESPONSE_LOGOUT);
-
break;
case GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:
icon_name = GSM_ICON_SHUTDOWN;
- primary_text = _("Shut down this system now?");
+ title = _("Shut Down the Computer");
logout_dialog->priv->default_response = GSM_LOGOUT_RESPONSE_SHUTDOWN;
- if (gsm_logout_supports_system_suspend (logout_dialog)) {
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- _("S_uspend"),
- GSM_LOGOUT_RESPONSE_SLEEP);
+ tile = gsm_logout_append_tile (vbox,
+ GSM_LOGOUT_RESPONSE_SHUTDOWN,
+ GSM_ICON_SHUTDOWN,
+ _("_Shut Down"),
+ _("Ends your session and turns "
+ "off the computer."));
+ if (!gsm_logout_supports_shutdown (logout_dialog)) {
+ gtk_widget_set_sensitive (tile, FALSE);
+ /* If shutdown is not available, let's just fallback
+ * on cancel as the default action. We could fallback
+ * on reboot first, then suspend and then hibernate
+ * but it's not that useful, really */
+ logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL;
}
- if (gsm_logout_supports_system_hibernate (logout_dialog)) {
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- _("_Hibernate"),
- GSM_LOGOUT_RESPONSE_HIBERNATE);
+ tile = gsm_logout_append_tile (vbox,
+ GSM_LOGOUT_RESPONSE_REBOOT,
+ GSM_ICON_REBOOT, _("_Restart"),
+ _("Ends your session and "
+ "restarts the computer."));
+ if (!gsm_logout_supports_reboot (logout_dialog)) {
+ gtk_widget_set_sensitive (tile, FALSE);
}
- if (gsm_logout_supports_reboot (logout_dialog)) {
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- _("_Restart"),
- GSM_LOGOUT_RESPONSE_REBOOT);
+ /* We don't set those options insensitive if they are no
+ * supported (like we do for shutdown/restart) since some
+ * hardware just don't support suspend/hibernate. So we
+ * don't show those options in this case. */
+ if (gsm_logout_supports_system_suspend (logout_dialog)) {
+ gsm_logout_append_tile (vbox,
+ GSM_LOGOUT_RESPONSE_SLEEP,
+ GSM_ICON_SLEEP, _("S_uspend"),
+ _("Suspends your session "
+ "quickly, using minimal "
+ "power while the computer "
+ "stands by."));
}
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL);
-
- if (gsm_logout_supports_shutdown (logout_dialog)) {
- gtk_dialog_add_button (GTK_DIALOG (logout_dialog),
- _("_Shut Down"),
- GSM_LOGOUT_RESPONSE_SHUTDOWN);
+ if (gsm_logout_supports_system_hibernate (logout_dialog)) {
+ gsm_logout_append_tile (vbox,
+ GSM_LOGOUT_RESPONSE_HIBERNATE,
+ GSM_ICON_HIBERNATE,
+ _("_Hibernate"),
+ _("Suspends your session, "
+ "using no power until the "
+ "computer is restarted."));
}
+
break;
default:
g_assert_not_reached ();
}
- dialog_image = gtk_message_dialog_get_image (GTK_MESSAGE_DIALOG (logout_dialog));
+ logout_dialog->priv->info_label = gtk_label_new ("");
+ gtk_label_set_line_wrap (GTK_LABEL (logout_dialog->priv->info_label),
+ TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), logout_dialog->priv->info_label,
+ TRUE, TRUE, 0);
+ gtk_widget_show (logout_dialog->priv->info_label);
- gtk_image_set_from_icon_name (GTK_IMAGE (dialog_image),
- icon_name, GTK_ICON_SIZE_DIALOG);
gtk_window_set_icon_name (GTK_WINDOW (logout_dialog), icon_name);
- gtk_window_set_position (GTK_WINDOW (logout_dialog), GTK_WIN_POS_CENTER_ALWAYS);
- gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (logout_dialog), primary_text);
+ gtk_window_set_title (GTK_WINDOW (logout_dialog), title);
+ gtk_window_set_position (GTK_WINDOW (logout_dialog),
+ GTK_WIN_POS_CENTER_ALWAYS);
gtk_dialog_set_default_response (GTK_DIALOG (logout_dialog),
logout_dialog->priv->default_response);
+ /* Note that focus is on the widget for the default response by default
+ * (since they're the first widget, except when it's Cancel */
+ if (logout_dialog->priv->default_response == GTK_RESPONSE_CANCEL)
+ gtk_window_set_focus (GTK_WINDOW (logout_dialog),
+ logout_dialog->priv->cancel_button);
gtk_window_set_screen (GTK_WINDOW (logout_dialog), screen);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ab422ac8218380c08f22c285714b2a837ee9bee123553c3f80d5d0047cd4827c
size 8154

View File

@ -1,49 +0,0 @@
diff -aur gnome-session-2.23.5.orig/gnome-session/gsm-resumed-app.c gnome-session-2.23.5/gnome-session/gsm-resumed-app.c
--- gnome-session-2.23.5.orig/gnome-session/gsm-resumed-app.c 2008-07-22 12:34:41.000000000 +0200
+++ gnome-session-2.23.5/gnome-session/gsm-resumed-app.c 2008-07-29 23:23:58.000000000 +0200
@@ -25,6 +25,7 @@
#include <sys/wait.h>
#include <glib.h>
+#include <string.h>
#include <X11/SM/SMlib.h>
@@ -213,6 +213,22 @@
char *key;
char *id;
char *val;
+ static gboolean compiz_enabled = FALSE;
+ static gboolean compiz_init = FALSE;
+
+ if (!compiz_init) {
+ gchar *compiz_enable_path;
+
+ /* See if compiz is enabled; if it is, we have to replace
+ * legacy metacity/compiz entries with gnome-wm */
+ compiz_enable_path = g_build_filename (g_get_user_config_dir (),
+ "compiz", "enable-compiz",
+ NULL);
+ compiz_enabled = compiz_enable_path &&
+ g_file_test (compiz_enable_path,
+ G_FILE_TEST_IS_REGULAR);
+ g_free (compiz_enable_path);
+ }
key = g_strdup_printf ("%d,id", n);
id = g_key_file_get_string (session_file, "Default", key, NULL);
@@ -242,6 +258,14 @@
g_free (key);
if (val) {
+ if (((!strcmp (val, "metacity") ||
+ !strcmp (val, "/usr/bin/metacity")) && compiz_enabled) ||
+ (!strcmp (val, "compiz") ||
+ !strcmp (val, "/usr/bin/compiz"))) {
+ g_free (val);
+ val = g_strdup ("gnome-wm");
+ }
+
app->priv->restart_command = val;
}

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Mon Jul 2 09:04:43 CEST 2012 - vuntz@opensuse.org
- Drop gnome-session-bgo507101-tile-ui.patch: the logout dialog is
only used in the fallback mode, and it's not worth maintaining
this patch for the fallback mode. Fix bnc#689608.
- Drop gnome-session-sleep.svg source, since it was only needed for
the above patch.
- Drop gnome-session-wm-switch.patch: this patch was needed when we
were still supporting compiz in GNOME, but this is not the case
anymore.
- Remove support for gnome-patch-translation since there are not
patches adding translations left: remove gnome-patch-translation
BuildRequires and commented out calls to
gnome-patch-translation-prepare and
gnome-patch-translation-update.
- Note that the two patches were disabled since they needed to be
rebased, so there's no real change, code-wise.
-------------------------------------------------------------------
Wed May 30 13:39:07 UTC 2012 - badshah400@gmail.com

View File

@ -26,21 +26,14 @@ Url: http://www.gnome.org
Source: http://download.gnome.org/sources/gnome-session/3.4/%{name}-%{version}.tar.xz
Source1: gnome
Source2: gnome.desktop
# Temporarly needed until we get upstream to ship the right icon for suspend
Source7: gnome-session-sleep.svg
# PATCH-FIX-UPSTREAM gnome-session-ice-auth-for-suid.patch hpj@novell.com -- Carries ICE auth over to other UIDs in this session using an env var.
Patch0: gnome-session-ice-auth-for-suid.patch
# PATCH-FIX-UPSTREAM gnome-session-kdm-support.patch hpj@novell.com -- Adds support for KDM logout commands.
Patch1: gnome-session-kdm-support.patch
# PATCH-NEEDS-REBASE gnome-session-wm-switch.patch bnc180506 danw@novell.com -- Fixes legacy sessions to use gnome-wm instead of metacity/compiz. Legacy sessions are not really supported anymore -- do we need to handle a similar case for current saved sessions, though? (was PATCH-FIX-OPENSUSE)
Patch2: gnome-session-wm-switch.patch
# PATCH-NEEDS-REBASE gnome-session-bgo507101-tile-ui.patch bgo507101 vuntz@novell.com -- Tile UI for logout dialog. (Was: PATCH-FIX-UPSTREAM)
Patch3: gnome-session-bgo507101-tile-ui.patch
# PATCH-FEATURE-OPENSUSE gnome-session-unblacklist-llvmpipe.patch badshah400@gmail.com -- Remove llvmpipe from blacklisted drivers to enable full gnome-shell session on virtual machines.
Patch4: gnome-session-unblacklist-llvmpipe.patch
BuildRequires: fdupes
BuildRequires: gnome-common
BuildRequires: gnome-patch-translation
BuildRequires: hicolor-icon-theme
BuildRequires: intltool
BuildRequires: tcpd-devel
@ -132,15 +125,8 @@ functional GNOME desktop.
%prep
%setup -q
translation-update-upstream
# disabled unless patches 2 or 3 are enabled
# gnome-patch-translation-prepare
%patch0 -p1
%patch1 -p1
# needs-rebase
#%patch2 -p1
# needs-rebase
#%patch3 -p0
# gnome-patch-translation-update
%patch4 -p1
%build
@ -165,7 +151,6 @@ install -m644 %SOURCE2 %{buildroot}%{_datadir}/xsessions/gnome.desktop
# Install a session file for gnome 2 look-and-feel (fallback mode)
install -m644 %{S:2} %{buildroot}%{_datadir}/xsessions/gnome2-look-and-feel.desktop
sed -i "s/^Exec=.*/Exec=gnome --session gnome-fallback/" %{buildroot}%{_datadir}/xsessions/gnome2-look-and-feel.desktop
install -m644 %{S:7} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
%suse_update_desktop_file session-properties X-SuSE-ControlCenter-Personal
%suse_update_desktop_file %{buildroot}%{_datadir}/xsessions/gnome.desktop
%suse_update_desktop_file -N "GNOME 2 Look and Feel" %{buildroot}%{_datadir}/xsessions/gnome2-look-and-feel.desktop
@ -224,7 +209,6 @@ rm -rf %{buildroot}
%dir %{_datadir}/gnome-session
%dir %{_datadir}/gnome-session/sessions
%{_datadir}/gnome-session/gsm-inhibit-dialog.ui
%{_datadir}/icons/hicolor/scalable/apps/gnome-session-sleep.svg
%doc %{_mandir}/man1/gnome-session.1*
%doc %{_mandir}/man1/gnome-session-quit.1*
# Helper for the session definitions, to know if hardware is accelerated