Instead of doing all this in main() we now use the two helpers. This makes
the code much more readable and avoids too many stuff in main().
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
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>
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 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>
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>
Shl (Static helper library) is the new name of all static helpers in
kmscon that might be shared between different applications.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need a copy of xkbcommon-keysyms.h as long as xkbcommon is not included
in all major distributions. We _need_ this build-time dependency,
otherwise, we cannot build the other keyboard backends.
However, requiring xkbcommon as build-time dependency is not a solution as
no major distribution includes it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
"10" is really small and not really suited as default value. We currently
do debugging a lot and hence using bigger fonts makes that task a lot more
easy. Furthermore, as a "first impression" people get from kmscon, we want
the font to be at a proper size.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We have added a lot of more xterm functionality so "xterm-256color" should
be the better default value now. It also makes most applications behave
better as they can use improved control sequences.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds command line options to make all currently available keyboard
shortcuts of the terminal layer configurable on the command-line and
config-file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The bbulk renderer performs like 30% better than the bblit renderer so we
should make it the default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This parameter makes the console subsystem print rendering-performance
information to the debug log. This can be used to find rendering
bottlenecks and compare each render-engine.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The bbulk renderer is very similar to the bblit renderer but it assembles
a request-buffer of all characters and then pushes these requests via a
vector-call to the video hardware.
This turns out to increase performance slightly as we do not call into the
video subsystem for every characters but only once.
This renderer can reduce performance when used with partial-redraws (which
are not implemented, yet), so we keep the bblit renderer around.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This option allows changing the console renderer during runtime. This is
only useful for debugging. The default choice should be best for all
situations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a new Unifont font-backend based on the recently added Unifont
data. The backend is disabled by default for 2 reasons:
- It takes about 5min to compile and needs >1GB of memory on an Intel
Atom N450
- License situation is unclear as it is GPL
Written-by: Ted Kotz <ted@kotz.us>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of redrawing on change, we now use a framerate-timer which
redraws the screen. This timer stays active for 1s after the last redraw
so we do not enable/disable the timer while the console is under heavy
work-load. This still needs to be benchmarked but it seems to work nicely.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This actually incorporates the fakevt tool into kmscon. That is, if the
user presses ctrl+mod4+F12, we activate or deactivate the fake VT.
This is for debugging only and needs to be made more configurable. Use it
on your own risk.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We must wake up the UI system _after_ wakeing up everything else,
otherwise, they might assume everything else is already up.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to forward all sleep/awake states to the lower subsystems to avoid
overdoing stuff like rendering an user-input. That is, while being asleep
we shouldn't render and/or do any other user-interaction.
This patch simply adds this logic to the UI subsystem, which, however,
does not to anything useful, yet.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The new sb-size option specifies the size of the scrollback buffer. Use 0
to disable the scrollback-buffer.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The --dumb option disables hardware-accelerated rendering and instead uses
the dumb-DRM devices.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds two options --font-size and --font-name that can be used to
configure which font is used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds two more color-palettes and a mode to choose the used palette.
The "solarized" palettes are from an online project that tries to optimize
color palettes.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This merges both files so we can reduce the code overhead here. This is
still some very old code that was never correctly merged into new
uterm_vt.c subsystem. This should help doing it now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The old --seat argument was no implemented, so replace it with --seats
which accepts a list of seats where kmscon runs on. Each seat is separate
from the others but kmscon allows providing terminal services to multiple
users/seats in a single process sharing resources like fonts and
renderers.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of accessing the kmscon configuration from the uterm code, we
should pass it in on creation. Otherwise, uterm depends on main.c which
would be really ugly.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The main configuration is now limited to kmscon and thus should not use
the conf_* prefix. Move all code to use the new name and introduce the new
main.h header mainly for kmscon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This replaces the global conf-options array with a parameter so we can use
the config parsers with different argument-lists.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All other subsystems were updated to support multiple video objects. As
last step, the main-handler just has to forward all video objects and
correctly wake them up and put to sleep.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Internally, the UI subsystem already supports multiple video objects.
However, the public API didn't expose that, yet. This changes the API to
allow adding and removing video objects from the UI.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds an OpenGL text renderer. It uses textures to store glyph
information and renders the characters by assembling a vertex-list first.
To improve performance, we use texture-atlases.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The freetype2 renderer uses ft2 and fontconfig to provide a very
simplistic renderer. We also simplify the logic of the whole subsystem a
lot and guarantee that each glyph will have the same size now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This fixes the console and terminal layer to use the new text renderer
instead of the old one.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is a rewrite of the input system. The backends itself are not
modified. However, it is now possible to have multiple backends and change
them on runtime.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This again refactors the whole config subsystem but this should be the
last time. We now have generic parsers for booleans and strings and don't
leak any memory, anymore. Furthermore, this adds a config-file parser so
common options can now be placed into /etc/kmscon.conf or ~/.kmscon.conf.
The config files parse the same arguments as the command-line and the
command-line always has precedence even though it is parsed first.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If the uterm video object fails to initialize the DRM device, then we try
again with the dumb device. Only if both devices fail, we drop the device
and continue.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Small stuff that is not worth putting into a separate library is no moved
into the "static" library which is statically linked into all our
subsystems.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The new --fbdev option allows runtime switching between the two backends.
That is, we only use fbdev devices when --fbdev is given. Otherwise, DRM
is used.
Technically, it would also be possible to use both. However, almost every
DRM device does also register an fbdev device for backwards compatibility.
Therefore, we must avoid using both, the DRM and fbdev device of the same
display at the same time. As this would also mean dealing with failures in
one backend and then switching to the other, we avoid this for complexity
reasons. Who needs fbdev and drm simultaneously, anyway?
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We currently try activating the OpenGL context when adding a video device
to a seat. However, not all video backends provide OpenGL contexts so
remove this restriction. The terminal subsystem does all this by itself
now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now have a video device for each seat so we only need to launch the UI
when the video device is registered.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Each session needs a virtual terminal where it operates. Therefore,
allocate one VT per seat so we can react on events on that seat.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When the monitor notifies us about an hoptplug event, then we need to poll
the current video device. Otherwise, we might miss hotplugged monitors.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Each seat now collects all input devices that are associated to that seat.
When multi-session support is added, then we can even share them between
the sessions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need a single graphics card on a seat to run kmscon. Therefore, wait
for the first DRM device that appears and make it the current graphics
device for the seat. We do not support multiple graphics cards per seat
but this may be added in the future.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>