gdm/gdm-2.20.0-allow-escape.patch
2007-10-02 15:04:32 +00:00

73 lines
2.3 KiB
Diff

diff -up gdm-2.20.0/gui/gdmlogin.c.allow-escape gdm-2.20.0/gui/gdmlogin.c
--- gdm-2.20.0/gui/gdmlogin.c.allow-escape 2007-10-02 10:54:33.000000000 -0400
+++ gdm-2.20.0/gui/gdmlogin.c 2007-10-02 11:02:08.000000000 -0400
@@ -2146,6 +2146,20 @@ gdm_set_welcomemsg (void)
g_free (greeting);
}
+static gboolean
+key_press_event (GtkWidget *widget, GdkEventKey *key, gpointer data)
+{
+ if (key->keyval == GDK_Escape)
+ {
+ printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_CANCEL);
+ fflush (stdout);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
gdm_login_gui_init (void)
{
@@ -2182,6 +2196,9 @@ gdm_login_gui_init (void)
gtk_widget_set_events (login, GDK_ALL_EVENTS_MASK);
+ g_signal_connect (G_OBJECT (login), "key_press_event",
+ G_CALLBACK (key_press_event), NULL);
+
gtk_window_set_title (GTK_WINDOW (login), _("GDM Login"));
/* connect for fingering */
if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
diff -up gdm-2.20.0/gui/greeter/greeter.c.allow-escape gdm-2.20.0/gui/greeter/greeter.c
--- gdm-2.20.0/gui/greeter/greeter.c.allow-escape 2007-10-02 10:48:39.000000000 -0400
+++ gdm-2.20.0/gui/greeter/greeter.c 2007-10-02 10:56:34.000000000 -0400
@@ -597,10 +597,16 @@ process_operation (guchar op_code,
static gboolean
key_press_event (GtkWidget *widget, GdkEventKey *key, gpointer data)
{
- if (DOING_GDM_DEVELOPMENT && (key->keyval == GDK_Escape))
+ if (key->keyval == GDK_Escape)
{
- process_operation (GDM_QUIT, NULL);
-
+ if (DOING_GDM_DEVELOPMENT)
+ process_operation (GDM_QUIT, NULL);
+ else
+ {
+ printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_CANCEL);
+ fflush (stdout);
+ }
+
return TRUE;
}
@@ -1360,11 +1366,9 @@ main (int argc, char *argv[])
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- if G_UNLIKELY (DOING_GDM_DEVELOPMENT) {
- g_signal_connect (G_OBJECT (window), "key_press_event",
- G_CALLBACK (key_press_event), NULL);
- }
-
+ g_signal_connect (G_OBJECT (window), "key_press_event",
+ G_CALLBACK (key_press_event), NULL);
+
canvas = gnome_canvas_new_aa ();
GTK_WIDGET_UNSET_FLAGS (canvas, GTK_CAN_FOCUS);
gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas),