diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2013-10-29 18:17:38 -0700 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2013-10-29 18:17:38 -0700 |
commit | 25e6b43b9daf5c0c80aae3dc212bc59b422f8949 (patch) | |
tree | 023b8d0f88edd6067d036c8a25c8e8fbc16341cf | |
parent | bb01c446a1dbba6211c2c5f0b184aca49f90a4ba (diff) | |
parent | 22bb5d8067c6176b349dcbe9fa143cd997747b40 (diff) | |
download | lightdm-25e6b43b9daf5c0c80aae3dc212bc59b422f8949.tar.gz |
Merge with trunk
-rw-r--r-- | data/lightdm.conf | 2 | ||||
-rw-r--r-- | src/seat.c | 6 | ||||
-rw-r--r-- | tests/scripts/script-hooks.conf | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/data/lightdm.conf b/data/lightdm.conf index 188bae8a..2b3251a8 100644 --- a/data/lightdm.conf +++ b/data/lightdm.conf @@ -60,6 +60,7 @@ # session-wrapper = Wrapper script to run session with # greeter-wrapper = Wrapper script to run greeter with # display-setup-script = Script to run when starting a greeter session (runs as root) +# display-stopped-script = Script to run after stopping the display server (runs as root) # greeter-setup-script = Script to run when starting a greeter (runs as root) # session-setup-script = Script to run when starting a user session (runs as root) # session-cleanup-script = Script to run when quitting a user session (runs as root) @@ -96,6 +97,7 @@ #session-wrapper=lightdm-session #greeter-wrapper= #display-setup-script= +#display-stopped-script= #greeter-setup-script= #session-setup-script= #session-cleanup-script= @@ -339,11 +339,17 @@ get_start_local_sessions (Seat *seat) static void display_server_stopped_cb (DisplayServer *display_server, Seat *seat) { + const gchar *script; GList *list, *link; Session *active_session; l_debug (seat, "Display server stopped"); + /* Run a script right after stopping the display server */ + script = seat_get_string_property (seat, "display-stopped-script"); + if (script) + run_script (seat, NULL, script, NULL); + g_signal_handlers_disconnect_matched (display_server, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat); seat->priv->display_servers = g_list_remove (seat->priv->display_servers, display_server); diff --git a/tests/scripts/script-hooks.conf b/tests/scripts/script-hooks.conf index dc573bab..0334b9af 100644 --- a/tests/scripts/script-hooks.conf +++ b/tests/scripts/script-hooks.conf @@ -4,6 +4,7 @@ [SeatDefaults] display-setup-script=test-script-hook DISPLAY-SETUP +display-stopped-script=test-script-hook DISPLAY-STOPPED greeter-setup-script=test-script-hook GREETER-SETUP session-setup-script=test-script-hook SESSION-SETUP session-cleanup-script=test-script-hook SESSION-CLEANUP @@ -38,6 +39,9 @@ user-session=default # X server stops #?XSERVER-0 TERMINATE SIGNAL=15 +# Script hooks run +#?SCRIPT-HOOK DISPLAY-STOPPED + # X server starts #?XSERVER-0 START VT=7 @@ -61,4 +65,9 @@ user-session=default #?*STOP-DAEMON #?GREETER-X-0 TERMINATE SIGNAL=15 #?XSERVER-0 TERMINATE SIGNAL=15 + +# Script hooks run +#?SCRIPT-HOOK DISPLAY-STOPPED + +# Finish cleanup #?RUNNER DAEMON-EXIT STATUS=0 |