If we run in listen mode, we are supposed to take over a seat. If a seat
supports VTs (like kernel VTs or kmscon cdev fake VTs) we assume that
there is some manager for these VTs (the one who created them). Therefore,
there is no need to run kmscon in listen mode on these seats. Instead, you
should run kmscon in default mode on these seats.
We enforce this limitation because if the VT-master on those seats dies
and causes a HUP, they have no way to notify us when they startup again.
Therefore, this kind of setup is broken. Furthermore, no-one would every
want such setups.
Instead use the startup mechanism of the VT/seat-manager to start kmscon
in default mode on those seats.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We cannot allocate VT objects without an associated input object.
Therefore, allocate a dummy device with no input devices assigned to it
and use it for the test-vt object.
Note that this makes switching from/to this VT via command-line
impossible.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This option now allows the user to change the XkbModel from the command
line or configuration file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
I forgot again to keep these up to date. The conf-layer updates broke them
horribly. However, we now build them correctly without kmscon-core by
including all required layers directly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
libxkbcommon has a configure option to set the default values for the
RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to
print). If they are not specified there, it's just "us" like we currently
do have. But if they are specified, we should most likely defer to it.
We do the same for the model field, instead of hardcoding "evdev". The
rules field remains hardcoded to "evdev", because we rely on it when
doing the evdev scancode-to-keycode +8 mapping.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We removed a lot of helpers from uterm-input because XKB is now a
mandatory dependency. So use it directly from test_input to avoid all the
uterm helpers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The getty variants out there (including agetty) require an relative path
to the /dev directory as argument. This is really odd but we want to be
backwards-compatible to them so we allow this, too.
--vt now accepts:
* A positive number which is internally converted into /dev/ttyXY
* A string that does not start with '/' or '.' which is interpreted
relative to /dev as /dev/%s
* Everything else is interpreted as path
This option still selects only the TTY on seat0. On all other seats we do
not use controlling TTYs.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We sometimes need to test what keys a client receives when specific keys
are pressed. This small helper simply runs in a terminal and receives raw
keyboard input and prints it to stdout with debugging information.
This can definitely be improved with the help of the TSM state-machine to
print more useful information and directly parse the input. However, this
is better than nothing.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This still uses the old VT API which now fails as we added a new
parameter. As a side-effect, this test will not work if used on a VT-less
system or on a seat without VTs. But we actually don't care, yet, as any
other VT-replacement isn't really production-ready, yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When opengl rendering is not available on the target device, we now fall
back to software rendering. Instead of drawing a nice gradient we now draw
a white screen to the target device to avoid heavy calculations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Since we moved to a runtime backend system for the input subsystem, we
cannot access the internal keysym_to_string() helpers anymore. Hence, use
the recently introduced uterm-input forwarding helper.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Print keysym even if we have a UCS4 representation. This makes debugging
keyboard issues much easier. Also increase buffer size to 32 as there are
many symbols longer than 16 characters.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Both dumb and xkb don't actually need the kbd_dev for that. The dumb
backend already omits the "dev".
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now support multiple GL contexts in uterm so we need to explicitely
enable them before using them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Use new uterm_video constructor. This requires hard-coding the DRM card
but this is needed until we use the uterm_monitor interface.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This test doesn't compile and is no longer needed. We can now use the
kmscon program or test_terminal for the same functionality.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accepting a list of outputs we now enable all outputs when
testing the video subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The new eloop implementation allows to run the eloop for a fixed amount of
time. Use this instead of sleeping for 5s which would prevent us from
catching signals as the eloop blocks them in favor of signalfd.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The test_include.h header now provides the basic initialization that will
later be used in all other tests. This allows us to use the same
program-parameters that kmscon uses and makes sure everything is
initialized properly before we run the tests.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
A symbol table should never be created twice therefore we can make it
static and global. We add locks so it is totally thread-safe, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
config.h is meant to be around in all files, as it contains stuff like
_GNU_SOURCE, NDEBUG and HAVE_*.
Make these definitions available without needing to #include config.h
every single time.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This function is no longer needed as we now have proper scrolling
functions. This also adjusts the buffer tests to be more appropriate.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We do no rotation so rename the function to the more appropriate name
kmscon_console_newline.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Make the vte subsystem handle the keyboard input instead of doing this
inside of test_terminal.
The handling is just a stub function. No actual keys are parsed yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is no reason to pass the eloop reference late at terminal/pty
open. If we pass it early on object creation we will always have a valid
reference and can remove several code paths.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
log_warn is much shorter and we already use log_err instead of log_error
so this is more consistent now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Unfortunately, there is no clean way I see to hook this up from the pty
object. We can (and will) have more than one pty object opened at a
time, but the semantics of signalfd make it impossible to deliver each
SIGCHLD to its rightful owner without complicating things.
[ From what I tested:
- If you have two signalfd's listening to the same signal, they will be
dispatched in some round-robin manner.
- Also, if more than one child exits before we read signalfd (possibly
beloging to different terminals), they will be compressed to one
event. ]
We therefore need to do the reaping from a central location, and need to
remember to copy this snippet over to main.c in the future.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>