summaryrefslogtreecommitdiff
path: root/src/polkitagent
diff options
context:
space:
mode:
Diffstat (limited to 'src/polkitagent')
-rw-r--r--src/polkitagent/polkitagenttextlistener.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/polkitagent/polkitagenttextlistener.c b/src/polkitagent/polkitagenttextlistener.c
index 0ba0352..99af1d1 100644
--- a/src/polkitagent/polkitagenttextlistener.c
+++ b/src/polkitagent/polkitagenttextlistener.c
@@ -205,6 +205,12 @@ polkit_agent_text_listener_class_init (PolkitAgentTextListenerClass *klass)
g_param_spec_uint ("delay", "", "",
0, G_MAXUINT, 1,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_signal_new("tty_attrs_changed",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
+ 0, NULL, NULL, NULL,
+ G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
}
/**
@@ -359,6 +365,7 @@ on_request (PolkitAgentSession *session,
* the problem.
*/
+ g_signal_emit_by_name(listener, "tty_attrs_changed", TRUE);
tcgetattr (fileno (listener->tty), &ts);
ots = ts;
ts.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
@@ -387,6 +394,7 @@ on_request (PolkitAgentSession *session,
}
}
tcsetattr (fileno (listener->tty), TCSAFLUSH, &ots);
+ g_signal_emit_by_name(listener, "tty_attrs_changed", FALSE);
putc ('\n', listener->tty);
polkit_agent_session_response (session, str->str);