We move the GRAB type into kmscon-main.c to avoid any uterm dependency in
the conf subsystem. It is still open how we can better handle the
key-parser without a valid uterm_input object, but when there will be a
xkbcommon release, we can hopefully add a hard depedency to it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Now that we can differentiate between fbdev-DRM and normal fbdev devices,
we can just pick up the normal fbdev devices by default.
--fbdev now makes kmscon use the FBDEV_DRM devices instead of pure DRM.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Most DRM drivers also provide a legacy fbdev device so fbcon can pick it
up (and more importantly, we get kernel panics on it). However, as an
application developer, I don't want to use two devices which drive the
same physical hardware.
This marks all such DRM fbdev devices as FBDEV_DRM so kmscon doesn't pick
them up automatically.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When multiple requests are pushed into the video backends at once, we
should ignore NULL buffers. Otherwise, users might have to re-order
buffers just so we don't segfault. Instead, we now ignore them and the
application can set requests to NULL to signal us that it is unused.
This fixes some bugs with multi-monitor setups and kmscon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Kernel fbdev drivers are really broken in respect to virtual framebuffer
sizes. They all report success when allocating and even mmap()'ing them
but memory access will result in SIGBUS or even SIGSEGV.
Therefore, we disable it by default now. We might consider re-enabling it,
but there is really no need to work too much on fbdev backends.
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>
Some crazy guy decided to set VERASE to DEL by default in the kernel. So
when starting an application which does not initialize the terminal on
startup, they may not notice that we actually send BACKSPACE as
erase-character (like /bin/login). Therefore, initialize VERASE to 010 so
everyone is happy.
Thanks to Etam for reporting this!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Nearly all terminals behave differently regarding Shift+FX keys. We now
mimic the behavior of the classic VT220 instead of the new-style function
keys. Nearly all applications expect the old codes.
This might be changed in the future, though. It does make much more sense
to send the new codes as they provide more information to the application.
And remappings should be done via XKB instead of inside of kmscon.
However, as long as xkbcommon does not have a config-file, we will be
stuck with this little hack.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is a very basic unit that can start kmscon with a login shell. We may
have to improve it to replace agetty/etc fully, but it is a good start.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now create an eloop object internally to avoid requiring public eloop
headers. Functionality is still the same but now hidden in the library.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We do not want to depend on uterm just for the modifiers so introduce new
modifier-names which are in-sync with the UTERM names.
Inside of kmscon we still use the UTERM names everywhere, but inside of
TSM we now rely on the new names.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accessing kmscon-state we now add a helper to select the
palette and make the terminal-subsystem use it on initialization.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This pushes the whole VTE layer into TSM and performs the huge rename
which turned out to be quite easy to accomplish.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Use the new timer_drain() helper to reset the timer after waking up.
Otherwise, we get spurious warnings that the CPU is too slow.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This helper reads the current expiration-count from a timer. This can be
used when waking up from an idle-period or similar to reset the timer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We already have an llog context so use it instead of relying on kmscon-log
subsystem. TSM-screen is now fully independent. Next step is TSM-vte.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accessing kmscon state from TSM, we now introduce options to
control the behavior of TSM-screens. Apart from logging, TSM is now
independent of any kmscon state/code.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Allow setting global options for screen objects. These are different from
flags as the latter affects the state-machine but options affect global
operation modes.
Options should be set by the application while flags are set by the VTE
handler. The latter might change often, while options should be set on
startup and then remain mainly constant.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
uterm-keysyms.h is no longer available but the makefile still references
it. Remove all occurrences of it to fix build again.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to avoid logging to stderr directly in TSM so introduce the
tsm_log_t object similar to eloop.h.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All TSM files use the "tsm_*" prefix and the object is now named "screen"
so rename the files to resemble this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is part of the TSM library creation. We also rename "console" to
"screen" as this layer actually manages the screen.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is no longer used. You should first retrieve the UCS4 string and then
use the UCS4 to U8 conversion helpers instead.
All users have already been converted so we can remove this helper safely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of converting symbols into UCS4 string in each backend, we now
pass the whole data from the console layer into the renderers.
This makes all renderers indepedent of any recently introduced
symbol-tables and they can be implemented inside of TSM without exporting
them. However, we still need to pass the IDs to the text layer. The text
layer must not use them for anything but identification. Moreover, it must
never assume that they are valid tsm_symbol_t values.
We do this so the backends can still have fast hashtable lookups rather
than allocating big keys containing the UCS4 string+length and using these
for lookups.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This small helper allocates a string big enough to hold the whole u8
string. This should be used for short and temporary strings only! It
allocates way to much memory for bigger or long-living strings.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We really need xkbcommon-keysyms.h for building kmscon/uterm/TSM/etc.
However, the recent fix was ugly and didn't really help. Instead we copy
the keysyms file into external/xkbcommon/ so we can just include the real
xkbcommon files from any source but have a fallback in external/.
Hence, you can still build kmscon without xkbcommon with this fallback,
but this will be removed the first day when xkbcommon sees a public
release.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We never checked the memory helpers for errors because they used to be
from glib. However, with our own helpers we need to check for errors to be
sure.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a helper that removes entries from a hashtable. This hasn't been
needed, yet, so we never provided it. However, the new unicode-helpers
will need it for proper error recovery.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Add three helpers to create and manage symbol-tables. Also fix internal
default-table to use them.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This helper function may be useful to other external code and allows us to
always return UCS4 strings. Other code can then use this helper to convert
it into UTF8.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We should avoid any global state in shared libraries. As the TSM code is
becoming a shared library, we definitely need contexts for symbol tables.
However, we don't want to fix up all code now so we use a default table
NULL instead.
This can be fixed later but is ok for now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The logging-layer is not a dependency of TSM so we cannot use it. It is
also not needed anymore, as the unicode-layer is working pretty well.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is absolutely no need to use kmscon-static anymore so move it into
kmscon-core/uterm as it is used by kmscon-core and libuterm exclusively.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is the last static helper that is moved so as a next step we should
get rid of the "static" library entirely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We changed the PPI value to 96 so the default font size looks abnormally
large now. Reset it to the previous value of 12 so it is more "normal".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a new option to force a global PPI for all fonts. This overrides
per monitor PPI values.
This is useful if monitors do not provide correct PPI values and we want
the same behavior as all other X11 apps (which is 96 PPI forced).
Internally we speak of "Pixels per Inch" as this is more correct. However,
to not confuse users we use the more common term "Dots per Inch".
This also changes the default PPI value from 72 to 96. 96 is the de-facto
default value on linux so we should use it, too.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If Shift is hold while F4 to F20 is pressed, a second parameter is added
to the sent CSI sequence. Implement this according to all other major
terminal emulators. This is no official DEC feature, though.
Thanks to "Etam" for reporting this!
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
No DEC-VT-manual seems to describe this feature, however, nearly all
terminal emulators stop parsing OSC strings when receiving a BEL
character. So add this to the normal ST character to terminate OSC
strings.
Many thanks to Ran Benita for reporting and investigating into this.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We might argue whether llog should be kept separate, however, shl is a
loose pile of headers and sources so pushing llog into it seems
reasonable.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
XTerm's altSendsEscape resource controls whether an escape character is
prepended to any output that is generated by keyboard input. We enable it
by default now.
Keyboard handling becomes kind of ugly now in the VTE layer. We should
definitely change this into some kind of lookup table or a more
sophisticated switch() handler in vte_input.c or similar.
Thanks to Tobias Wolf, "Etam" and Ran Benita for reporting this to the
bug-tracker and figuring out how this is correctly handled.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This moves the timers to SHL and removes the old static_misc header and
source. They are no longer needed.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>