Allow to specify a separate login-program that is executed instead of the
default. All arguments specified after --login are considered argv[] of
the new process and not parsed by the library.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Set CRTC state correctly after waking up. Otherwise the displays will keep
their previous state until the next redraw.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Use the new UI subsystem in the main application. The kmscon application
provides now the same functionality as the test_terminal application.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The hook structure can be used to provide a central hook where other
subsystems can register callbacks.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We cannot check for dev->fd as the fd is only set when the input device
has keys. Therefore check for rfd now.
Also remove the NULL check in *_sleep() as it is not needed. All public
APIs allow passing NULL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Remove newline from log-messages and set LOG_SUBSYSTEM to "input". Also
fix some small indentation issues.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Suppress debug, info, notice and warning messages if --silent is given.
This is overwritten by --debug and --verbose.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is not finished and only implements the basic VT handling +
application initialization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
eloop.c and log.c use struct timeval to calculate time-diffs but
incorrectly use "-" instead of "+" as the value is already negative.
They also use unsigned integers so fix both occurences.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When exiting a child eloop we should forward the exit to the parent. Also,
we should reset ->exit on ev_eloop_run() otherwise we cannot run multiple
times.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
--switchvt enables kmscon to automatically switch to the new VT that was
opened by kmscon. If this is the current VT, then this has obviously no
effect.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
ev_eloop_run() runs the eloop for a given fixed time. If the dispatcher
returns and the timeout isn't reached, then the dispatcher is called
again.
This also adds the *_exit() function which allows to exit the main-loop
and can be called from anywhere (including the callbacks).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If a handler does not correctly remove itself on HUP, the epoll-loop will
never sleep again because the fd will always be notified as HUP.
Therefore, remove the fd from the epoll-set directly on HUP. This doesn't
change application behavior so it is safe here.
This also allows other subsystems to ignore HUP/ERR events if they are not
fatal. The FD won't be readded but that may not bother.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The conf-subsystem is used throughout the whole source and provides a
global static read-only configuration. The configuration is read on
startup from the command-line and filesystem and then provided to the
other subsystems.
This is no database, that is, the data is not written to a file on
shutdown!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This allows to add one eloop object into another eloop. This is useful if
we want to run a single event source isolated (for instance VT on exit).
The internal epoll-descriptor allows polling so this is a fairly
straightforward implementation.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We currently have too much layers in the console subsystem. This reduces
performance and produces ugly hacks like our "*_clear_region" function. We
now merge both files so we can directly access the buffer-structure.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Define LOG_ENABLE_DEBUG if we enabled debugging. The log subsystem uses
this to enable the log_debug() statements.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Inside a screen object we are independent of the lifetime of the displays
so we need to correctly keep references to them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The GL subsystem is copied from the old output_context subsystem and now
provides shader and GL-math. It will replace the old output_context subs
soon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We use GLES2 for drawing. There is currently no reason to provide full GL
inside kmscon as we use the basic operations only.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>