[gdm] Focus on login dialog after language dialog or layout dialog is closed.
- From: Takao Fujiwara <fujiwarat src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gdm] Focus on login dialog after language dialog or layout dialog is closed.
- Date: Thu, 10 Sep 2009 02:08:21 +0000 (UTC)
commit 6def173499c2f0da3306046ebe711757bfbe9d9e
Author: Takao Fujiwara <tfujiwar redhat com>
Date: Thu Sep 10 11:06:08 2009 +0900
Focus on login dialog after language dialog or layout dialog is closed.
Fixes bug #592183.
Reviewed by Ray Strode, Brian Cameron
gui/simple-greeter/gdm-greeter-panel.c | 35 +++++++++++++++++++++++
gui/simple-greeter/gdm-greeter-panel.h | 2 +
gui/simple-greeter/gdm-greeter-session.c | 11 +++++++
gui/simple-greeter/gdm-language-option-widget.c | 12 ++++++++
gui/simple-greeter/gdm-language-option-widget.h | 1 +
gui/simple-greeter/gdm-layout-option-widget.c | 12 ++++++++
gui/simple-greeter/gdm-layout-option-widget.h | 1 +
7 files changed, 74 insertions(+), 0 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-greeter-panel.c b/gui/simple-greeter/gdm-greeter-panel.c
index 0ae1c54..dbdef29 100644
--- a/gui/simple-greeter/gdm-greeter-panel.c
+++ b/gui/simple-greeter/gdm-greeter-panel.c
@@ -77,6 +77,7 @@ enum {
LANGUAGE_SELECTED,
LAYOUT_SELECTED,
SESSION_SELECTED,
+ DIALOG_HIDDEN,
NUMBER_OF_SIGNALS
};
@@ -456,6 +457,17 @@ gdm_greeter_panel_class_init (GdmGreeterPanelClass *klass)
G_TYPE_NONE,
1, G_TYPE_STRING);
+ signals[DIALOG_HIDDEN] =
+ g_signal_new ("dialog-hidden",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GdmGreeterPanelClass, dialog_hidden),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
g_object_class_install_property (object_class,
PROP_MONITOR,
g_param_spec_int ("monitor",
@@ -488,6 +500,14 @@ on_language_activated (GdmLanguageOptionWidget *widget,
}
static void
+on_language_dialog_hidden(GdmLanguageOptionWidget *widget,
+ GdmGreeterPanel *panel)
+{
+
+ g_signal_emit (panel, signals[DIALOG_HIDDEN], 0);
+}
+
+static void
on_layout_activated (GdmLayoutOptionWidget *widget,
GdmGreeterPanel *panel)
{
@@ -507,6 +527,15 @@ on_layout_activated (GdmLayoutOptionWidget *widget,
g_free (layout);
}
+
+static void
+on_layout_dialog_hidden (GdmLayoutOptionWidget *widget,
+ GdmGreeterPanel *panel)
+{
+
+ g_signal_emit (panel, signals[DIALOG_HIDDEN], 0);
+}
+
static void
on_session_activated (GdmSessionOptionWidget *widget,
GdmGreeterPanel *panel)
@@ -580,6 +609,9 @@ gdm_greeter_panel_init (GdmGreeterPanel *panel)
g_signal_connect (G_OBJECT (panel->priv->language_option_widget),
"language-activated",
G_CALLBACK (on_language_activated), panel);
+ g_signal_connect (G_OBJECT (panel->priv->language_option_widget),
+ "dialog-hidden",
+ G_CALLBACK (on_language_dialog_hidden), panel);
gtk_box_pack_start (GTK_BOX (panel->priv->option_hbox), panel->priv->language_option_widget, FALSE, FALSE, 6);
gdm_profile_end ("creating option widget");
@@ -587,6 +619,9 @@ gdm_greeter_panel_init (GdmGreeterPanel *panel)
g_signal_connect (G_OBJECT (panel->priv->layout_option_widget),
"layout-activated",
G_CALLBACK (on_layout_activated), panel);
+ g_signal_connect (G_OBJECT (panel->priv->layout_option_widget),
+ "dialog-hidden",
+ G_CALLBACK (on_layout_dialog_hidden), panel);
gtk_box_pack_start (GTK_BOX (panel->priv->option_hbox), panel->priv->layout_option_widget, FALSE, FALSE, 6);
panel->priv->session_option_widget = gdm_session_option_widget_new ();
diff --git a/gui/simple-greeter/gdm-greeter-panel.h b/gui/simple-greeter/gdm-greeter-panel.h
index 07cca3f..1e637f5 100644
--- a/gui/simple-greeter/gdm-greeter-panel.h
+++ b/gui/simple-greeter/gdm-greeter-panel.h
@@ -53,6 +53,8 @@ typedef struct
void (* session_selected) (GdmGreeterPanel *panel,
const char *text);
+
+ void (* dialog_hidden) (GdmGreeterPanel *panel);
} GdmGreeterPanelClass;
GType gdm_greeter_panel_get_type (void);
diff --git a/gui/simple-greeter/gdm-greeter-session.c b/gui/simple-greeter/gdm-greeter-session.c
index fe2de48..167b693 100644
--- a/gui/simple-greeter/gdm-greeter-session.c
+++ b/gui/simple-greeter/gdm-greeter-session.c
@@ -249,6 +249,12 @@ on_select_layout (GdmGreeterSession *session,
}
static void
+on_dialog_hidden (GdmGreeterSession *session)
+{
+ gtk_window_present (GTK_WINDOW (session->priv->login_window));
+}
+
+static void
on_select_user (GdmGreeterLoginWindow *login_window,
const char *text,
GdmGreeterSession *session)
@@ -349,6 +355,11 @@ toggle_panel (GdmGreeterSession *session,
G_CALLBACK (on_select_session),
session);
+ g_signal_connect_swapped (session->priv->panel,
+ "dialog-hidden",
+ G_CALLBACK (on_dialog_hidden),
+ session);
+
gtk_widget_show (session->priv->panel);
} else {
gtk_widget_destroy (session->priv->panel);
diff --git a/gui/simple-greeter/gdm-language-option-widget.c b/gui/simple-greeter/gdm-language-option-widget.c
index ff8445f..72a5dcb 100644
--- a/gui/simple-greeter/gdm-language-option-widget.c
+++ b/gui/simple-greeter/gdm-language-option-widget.c
@@ -50,6 +50,7 @@ struct GdmLanguageOptionWidgetPrivate
enum {
LANGUAGE_ACTIVATED,
+ DIALOG_HIDDEN,
NUMBER_OF_SIGNALS
};
@@ -94,6 +95,7 @@ gdm_language_option_widget_hide_dialog (GdmLanguageOptionWidget *widget)
{
gtk_widget_destroy (widget->priv->dialog);
widget->priv->dialog = NULL;
+ g_signal_emit (G_OBJECT (widget), signals[DIALOG_HIDDEN], 0);
}
static void
@@ -170,6 +172,16 @@ gdm_language_option_widget_class_init (GdmLanguageOptionWidgetClass *klass)
G_TYPE_NONE,
0);
+ signals[DIALOG_HIDDEN] = g_signal_new ("dialog-hidden",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GdmLanguageOptionWidgetClass, dialog_hidden),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
g_type_class_add_private (klass, sizeof (GdmLanguageOptionWidgetPrivate));
}
diff --git a/gui/simple-greeter/gdm-language-option-widget.h b/gui/simple-greeter/gdm-language-option-widget.h
index 2d3e3c7..fdbc4e1 100644
--- a/gui/simple-greeter/gdm-language-option-widget.h
+++ b/gui/simple-greeter/gdm-language-option-widget.h
@@ -48,6 +48,7 @@ typedef struct
GdmRecentOptionWidgetClass parent_class;
void (* language_activated) (GdmLanguageOptionWidget *widget);
+ void (* dialog_hidden) (GdmLanguageOptionWidget *widget);
} GdmLanguageOptionWidgetClass;
GType gdm_language_option_widget_get_type (void);
diff --git a/gui/simple-greeter/gdm-layout-option-widget.c b/gui/simple-greeter/gdm-layout-option-widget.c
index a6eb1b9..50eb276 100644
--- a/gui/simple-greeter/gdm-layout-option-widget.c
+++ b/gui/simple-greeter/gdm-layout-option-widget.c
@@ -50,6 +50,7 @@ struct GdmLayoutOptionWidgetPrivate
enum {
LAYOUT_ACTIVATED,
+ DIALOG_HIDDEN,
NUMBER_OF_SIGNALS
};
@@ -97,6 +98,7 @@ gdm_layout_option_widget_hide_dialog (GdmLayoutOptionWidget *widget)
{
gtk_widget_destroy (widget->priv->dialog);
widget->priv->dialog = NULL;
+ g_signal_emit (G_OBJECT (widget), signals [DIALOG_HIDDEN], 0);
}
static void
@@ -173,6 +175,16 @@ gdm_layout_option_widget_class_init (GdmLayoutOptionWidgetClass *klass)
G_TYPE_NONE,
0);
+ signals[DIALOG_HIDDEN] = g_signal_new ("dialog-hidden",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (GdmLayoutOptionWidgetClass, dialog_hidden),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
g_type_class_add_private (klass, sizeof (GdmLayoutOptionWidgetPrivate));
}
diff --git a/gui/simple-greeter/gdm-layout-option-widget.h b/gui/simple-greeter/gdm-layout-option-widget.h
index 8dba3b6..abe460e 100644
--- a/gui/simple-greeter/gdm-layout-option-widget.h
+++ b/gui/simple-greeter/gdm-layout-option-widget.h
@@ -48,6 +48,7 @@ typedef struct
GdmRecentOptionWidgetClass parent_class;
void (* layout_activated) (GdmLayoutOptionWidget *widget);
+ void (* dialog_hidden) (GdmLayoutOptionWidget *widget);
} GdmLayoutOptionWidgetClass;
GType gdm_layout_option_widget_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]