@@ -68,6 +68,8 @@ enum log_importance {
6868
6969static enum log_importance verbosity = LOG_INFO ;
7070
71+ static bool lock_on_start = false;
72+
7173static void swayidle_log (enum log_importance importance , const char * fmt , ...) {
7274 if (importance < verbosity ) {
7375 return ;
@@ -780,7 +782,7 @@ static int parse_idlehint(int argc, char **argv) {
780782
781783static int parse_args (int argc , char * argv [], char * * config_path ) {
782784 int c ;
783- while ((c = getopt (argc , argv , "C:hdwS :" )) != -1 ) {
785+ while ((c = getopt (argc , argv , "C:hdwlS :" )) != -1 ) {
784786 switch (c ) {
785787 case 'C' :
786788 * config_path = strdup (optarg );
@@ -794,6 +796,9 @@ static int parse_args(int argc, char *argv[], char **config_path) {
794796 case 'S' :
795797 state .seat_name = strdup (optarg );
796798 break ;
799+ case 'l' :
800+ lock_on_start = true;
801+ break ;
797802 case 'h' :
798803 case '?' :
799804 printf ("Usage: %s [OPTIONS]\n" , argv [0 ]);
@@ -1067,6 +1072,11 @@ int main(int argc, char *argv[]) {
10671072 display_event , NULL );
10681073 wl_event_source_check (source );
10691074
1075+
1076+ if (lock_on_start ) {
1077+ kill (getpid (), SIGUSR1 );
1078+ }
1079+
10701080 while (wl_event_loop_dispatch (state .event_loop , -1 ) != 1 ) {
10711081 // This space intentionally left blank
10721082 }
0 commit comments