swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 7988f101d3e7cecdf31d262c3768b8cf202549f2
parent 6a2570ed14226cd37e26090d70119ed74ff27f21
Author: Michael Forney <mforney@mforney.org>
Date:   Thu, 25 Dec 2014 00:57:07 -0800

launch: Add -n flag to start compositor without switching to its VT

Diffstat:
Mlaunch/launch.c | 30+++++++++++++++++++-----------
Mlibswc/seat.c | 3+++
2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/launch/launch.c b/launch/launch.c @@ -74,13 +74,15 @@ static struct long console_mode; } original_vt_state; +static bool nflag; + static void __attribute__((noreturn,format(printf,1,2))) die(const char * format, ...); static void __attribute__((noreturn)) usage(const char * name) { - fprintf(stderr, "Usage: %s [-s <server-socket>] [-t <tty-device>] [--] " - "<server> [server arguments...]\n", name); + fprintf(stderr, "Usage: %s [-n] [-s <server-socket>] [-t <tty-device>] " + "[--] <server> [server arguments...]\n", name); exit(EXIT_FAILURE); } @@ -388,16 +390,19 @@ static void setup_tty(int fd) goto error1; } - if (ioctl(fd, VT_ACTIVATE, vt) == -1) + if (!nflag) { - perror("Could not activate VT"); - goto error2; - } + if (ioctl(fd, VT_ACTIVATE, vt) == -1) + { + perror("Could not activate VT"); + goto error2; + } - if (ioctl(fd, VT_WAITACTIVE, vt) == -1) - { - perror("Could not wait for VT to become active"); - goto error2; + if (ioctl(fd, VT_WAITACTIVE, vt) == -1) + { + perror("Could not wait for VT to become active"); + goto error2; + } } original_vt_state.altered = true; @@ -422,10 +427,13 @@ int main(int argc, char * argv[]) struct sigaction action = { 0 }; sigset_t set; - while ((option = getopt(argc, argv, "s:t:")) != -1) + while ((option = getopt(argc, argv, "ns:t:")) != -1) { switch (option) { + case 'n': + nflag = true; + break; case 's': setenv("WAYLAND_DISPLAY", optarg, true); break; diff --git a/libswc/seat.c b/libswc/seat.c @@ -371,6 +371,9 @@ bool initialize_libinput(const char * seat_name) goto error2; } + if (!swc.active) + libinput_suspend(seat.libinput); + return true; error2: