1432 Commits

Author SHA1 Message Date
Marcin Kulik
bd63531d3f tsm: support background color lightening via blink attribute
According to
http://misc.flogisoft.com/bash/tip_colors_and_formatting#terminals_compatibility
several terminal emulators (Linux TTY included) use blink to set
high-intensity background color. Rxvt doc states it as well:
https://github.com/exg/rxvt-unicode/blob/master/README.FAQ#L319-L324
2013-08-15 22:22:31 +02:00
David Herrmann
a23acf14f1 docs: use WantedBy in kmsconvt@.service
We currently use the old systemd syntax that was copied from
getty@.service. It doesn't allow enabling specific TTYs, though. So use
the new WantedBy syntax instead.

Thanks to "trusktr" for investigating and reporting upstream to systemd
developers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-07-15 17:28:41 +02:00
David Herrmann
4962213bac kmscon: pass vtnr to pty so XDG_VTNR is set
We need to correctly set the VTNR for each new pty, otherwise the pty
cannot set the XDG_VTNR correctly. Note that we do this only for real VTs,
that is, vtnr > 0.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-06-12 15:53:03 +02:00
David Herrmann
35eb595863 pty: set XDG_VTNR if requested by caller
A caller can now pass a VT-num to the PTY which will get set as XDG_VTNR
in the environment of new childs.

This can be used to tell systemd-logind to associate the session with
the correct VT. But note that this still cannot overwrite VT-associations
if the pty is created from within an existing session.

Reported-by: Thomas Hebb
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-06-12 15:50:03 +02:00
David Herrmann
066cf51445 uterm: vt: add uterm_vt_get_num() helper
This helper returns the VT-number for the given VT if, and only if, it
is a real VT. In all other cases 0 is returned.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-06-12 15:43:17 +02:00
David Herrmann
3d2d8f5984 wlt: toolkit: dont depend on implicit buffer releases
Wayland compositors are not required to send buffer release notifications
on an implicit buffer-attach. That is, an attach->commit->commit series
does not cause a buffer-release notification after the second commit.

Hence, send a buffer-attach on every commit that requires a new
buffer-release notification.

For the related wayland-protocol changes, see:
  http://cgit.freedesktop.org/wayland/wayland/commit/?id=7165bf21917ed1c4f5ec823a1e1642a9e83aa984

This fixes a bug where wlterm only redraws the window-content when
resizing (due to explicit buffer-attach calls during redraw).

Reported by: MoD
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-06-11 18:57:38 +02:00
Lars Kellogg-Stedman
4e0b9813de docs: man: document configuration files in kmscon(1)
This moves the description of kmscon.conf to a separate "Configuration"
section and adds some example kmscon.conf configuration lines.

This addresses #71 (at least, with this change in place I probably would
not have been momentarily confused by the exact syntax used in
kmsconf.conf).

(removed trailing whitespaces)
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-12 17:53:22 +01:00
Ran Benita
d240c27ecb kmscon: add --xkb-keymap option for predefined keymaps
This adds an --xkb-keymap <FILE> option to kmscon. When given, kmscon
will try to compile the keymap from the file before trying the other
options (like the XkbKeymap option in xorg.conf).

This is useful for users who have a customized XKB keymap, which is
usually kept in a single file. Example, in X:
	xkbcomp $DISPLAY my_keymap.xkb
Customize my_keymap.xkb to your liking, and then in .xinitrc, or
xorg.conf:
	xkbcomp my_keymap.xkb $DISPLAY
Now you can also do this in kmscon.conf.

Additionally, lacking such an option, kmscon is quite difficult to use
without an installed xkeyboard-config package, which provides the
infrastructure for the "rules" configuration mechanism. We might even
want to distribute some plain xkb file as a last ditch, for
robustness, if even the default RMLVO fails... without a keyboard a
terminal is not very useful.

(changed Ran's patch to use *_from_string() instead of *_from_file())
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-12 17:31:47 +01:00
David Herrmann
e6d0d78543 shl: add shl_read_file() helper
This reads in a complete file as a string and returns it to the caller.
The string is 0 terminated (which isn't guaranteed by mmap()) so this
helper is needed if we have to work with APIs that don't accept buffer
lengths.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-12 17:16:49 +01:00
David Herrmann
ddf4126c11 kmscon: implement dynamic font-resizing via shortcuts
This implements two new keyboard shortcuts zoom-in and zoom-out that
increase/decrease font size of the current terminal.

This is similar to how wlterm does it and allows runtime modification of
fonts.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-09 13:51:05 +01:00
David Herrmann
9f0bb1262d terminal: clear unused margins on each frame
If the terminal screen is smaller than the real screen, we never paint to
the margins. This doesn't hurt as long as we never resize the terminal.
The uterm layer clears all framebuffers during allocation.

However, uterm behavior may change and our terminal may get resized (eg.,
during hotplugging) so we really should clear all the margins.

We now clear them on every frame as it is a trivial task. However, if we
speed up rendering, we should probably set a "needs_clear" flag that
simply clears the framebuffer.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-09 13:47:00 +01:00
David Herrmann
40f6811a07 terminal: share font settings across screens
We currently retrieve one font object per screen (which is in fact shared
in the font-layer), but we can also move it one layer up to the terminal
layer. This shares the same font per terminal between all screens.

This simplifies on-the-fly font modifications and speeds up monitor
hotplugging.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-09 13:19:05 +01:00
Chang Liu
e874518153 font: pango: fix vertical alignment of non-ASCII glyphs
pango_ft2_render_layout_line() requires the baseline offset as argument,
not the vertical extent of the glyphs. This is important as we currently
align glyphs to the bottom edge instead of the baseline.

Fix this by passing the cached baseline offset so all glyphs are correctly
aligned to the baseline. We then clip according to the cell-extents as
usual.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-09 12:26:48 +01:00
David Herrmann
1658bd8216 wlt: theme: change frame color to white plus black border
It is currently pretty annoying to use multiple wlterm windows stacked on
top on each other when the terminal-background is black. The border
doesn't use multiple colors so it is hard to distinguish from the
main-frame.
This patch changes the border color to white (as most terminal-backgrounds
are black by default) and additionally draws a black 1px frame around it.
This guarantees that the frame is even visible with white terminal
backgrounds.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-09 11:31:11 +01:00
David Herrmann
aeddc5b552 build: fix binary-link with ld.gold linker
The ld.gold linker doesn't provide --format=default but needs --format=elf
instead. However, this doesn't work with ld.bfd. To avoid any linker
detection, we now link any binary file via partial-linking into a proper
object file itself and then link this object file in the final linking
step.
This also produces a fake libtool *.lo file so the libtool linking command
doesn't complain about PIC/non-PIC problems.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-08 17:04:05 +01:00
David Herrmann
e1344b5691 uvtd: vt: return -ENODEV if session died
We now keep a link to our parent seat and set it to NULL when our session
is unregistered. In this case, any further request that depends on the
session being registered and probably a valid seat pointer, we will stop
with ENODEV.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 19:21:57 +01:00
David Herrmann
fb08eea373 uvtd: vt: implement VT_GETMODE/SETMODE ioctl state-tracking
These ioctls are used to retrieve and set the VT-mode. That is, the
signals and PID information that correspond to the VT controlling process.
It is notified whenever the VT gets active/inactive so it can react to it
or prevent/acknowledge it.

This doesn't implement the signal-sending logic, yet. It only implements
state-tracking.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 19:03:34 +01:00
David Herrmann
066d9fdb78 uvtd: seat: implement session IDs
Session IDs provide a unique ID for each registered session. They are used
to sort the sessions so next/prev return the correct neighbour-sessions.
Furthermore, they can be used by outside users to refer to a session
directly without knowing the session implementation.
Sessions with ID=0 are always linked at the end and considered to be
"unnamed".

The algorithm to switch to a session with a given ID is:
  Try to find the first session with the exact same ID. If there is none,
  return the session with the next higher ID. If there is none, return the
  ID'th session in the list. If there is none, return the last session.

This provides a fairly predictable way of switching between session. It is
modeled after the classic VT F1-F12 keys that switch between sessions. If
a session is not given, these keys will switch to the next higher session
instead.
All "unnamed" sessions are put at the end. So if you have only F1-F4, then
F5-F12 will map to unnamed sessions.

Please note that new sessions are always linked at the end of their group.
So new unnamed sessions are at the far end, new named sessions are linked
in the sorted list but behind all sessions with the same ID.
Hence, the caller should avoid multiple sessions with the same ID,
otherwise, some sessions might not be reachable even though they're named
(unless you use next/prev of course).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 18:21:25 +01:00
David Herrmann
5c7184f797 uvtd: vt: implement ioctl dummies
Add dummies for the ioctl VT callbacks. Also implement the KD-MODE and
KB-MODE state tracking as it is fairly trivial.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 17:33:39 +01:00
David Herrmann
724afe8c1a wlt: theme: prevent move/resize requests when maximized/fullscreen
We should let the user move or resize the window while it is fullscreen or
maximized. This depends on the compositor to stop pending move/resize
requests when maximizing or setting a window fullscreen.

We can implement some "snap away from edges" behavior that allows to move
or resize while maximized. This will "unmaximize" the window if you move
it more than a given threshold. However, that's not needed now so lets do
that later when the wl_shell system is fully figured out.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 16:30:31 +01:00
David Herrmann
96a82433b0 wlt: toolkit: add is_maximized/fullscreen helpers
These helpers return whether a window is maximized/fullscreen. This can be
used by the theme/terminal control layer to change behavior depending on
these flags.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 16:29:14 +01:00
David Herrmann
e4d25266b0 tsm: vte: fix g0-g3 character-set shifting
A terminal's GL and GR sets can be mapped to 4 different registers g0 to
g3. The g0-g3 registers can be freely set by the application to predefined
or uploaded character-sets.

We implemented GL and GR as separate registers that are set to the current
g0-g3 states when the applications requests a remapping. So subsequent
changes to g0-g3 don't affect GL and GR. Unfortunately, it turns out this
is wrong. GL and GR should point to the g0-g3 registers instead of copying
them.

This commit fixes the GL and GR pointers to point to g0-g3 instead of
pointing to the underlying character sets. This fixes line-drawing
applications like alsamixer, make-menuconfig and other ncurses based
software.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-06 11:12:47 +01:00
David Herrmann
e668e9b6cc uvt: client: implement major ioctl callbacks
Add callbacks for all major ioctls. We currently only implement ioctls
that are used by xserver on linux machines. Feel free to implement the new
ioctls.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 19:13:31 +01:00
David Herrmann
4307d9baf1 uvtd: ctx: link control/legacy nodes with VTs
We now create a VT for each legacy node and assign all clients to it. For
control nodes, we create a different VT for each open-file/client.

Note that we do not recreate VTs or CDEVs directly on HUP instead of
during the next open() or reconfiguration. This avoids trapping into the
same error again and gives control to the user to recreate the nodes at
the right time.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 18:05:09 +01:00
David Herrmann
e28da46b05 uvtd: add VT subsystem
The VT subsystem manages the virtual VTs and registers them with the
seat/session-scheduler. They manage control and legacy nodes as they are
mostly the same.

The different contexts create these VTs and assign them to cdev clients.
This allows us to split the VT and cdev logic apart so they can be
assigned freely to different clients.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 18:03:18 +01:00
David Herrmann
25736f8363 uvt: client: export symbols
This adds the uvt_client symbols to the public symbol list and exports
them so we can use them in uvtd.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 18:02:18 +01:00
David Herrmann
fdf1321fc7 uvt: client: fix double-kill by first unlinkink then resetting
We _must_ unlink the client and cdev first, then reset the VT. Otherwise,
the set_vt() call might think we are still alive and call user-defined
callbacks which might call kill again.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 18:00:50 +01:00
David Herrmann
a9219924c8 uvt: include inttypes.h
We use uint8_t so make sure we include inttypes.h in uvt.h.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 18:00:09 +01:00
David Herrmann
c56f5fcb4d uvtd: add ctx subsystem
The ctx subsystem manages the CDEV devices for each seat. It currently
allocates one manager device and a given number of legacy devices that can
be accessed via subdirectories.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:32:45 +01:00
David Herrmann
e28c39c4fb uvt: ctx: add major/minor helpers
Two new functions to retrieve the current major number and dynamically
allocate minor numbers.
This can be used by clients that allocate more than one CDEV for VTs to
dynamically retrieve a new minor number.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:31:27 +01:00
David Herrmann
62a16d13b7 build: add shl_flagset to build-system
We need the shl_flagset as part of SHL to make use of it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:28:36 +01:00
David Herrmann
e62850ded5 uvt: add SHL_EXPORT to cdev+ctx subsystems
We need to export the symbols to make use of them. This exports all useful
ctx+cdev functions for outside use. The other subsystems still need to get
reviewed before we export them.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:27:32 +01:00
David Herrmann
fdf045317f uvt: cdev: fix sending DEVNAME parameter
We used an incorrectly formatted arguments as we mixed up two local
variables. Use the correct DEVNAME format now.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:25:01 +01:00
David Herrmann
0cb9f3b505 uvt: cdev: print minor/major debug messages
These numbers are pretty useful during debugging so print them before
attempting to create the cdev devices.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:24:17 +01:00
David Herrmann
61d88ec9c8 shl: add flagset helper
A flagset is a dynamic array where each bit of the array can be
independently set/reset. It can be used for minor/major allocations or
for other dynamically growing bitsets.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:22:55 +01:00
David Herrmann
3c7956e45a shl: dlist: add _first/_last helpers
These helpers return the first and last elements respectively.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:22:13 +01:00
David Herrmann
b8f58fea9c shl: array: add shl_array_zresize()
This helper resizes the array to a given length and zeroes out all new
elements.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-05 01:21:29 +01:00
David Herrmann
350a9ca5a2 README: fix tarball-link to /software/kmscon
We now have official upload space on freedesktop.org. No need to link to
my personal upload space, anymore.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 18:42:34 +01:00
David Herrmann
6e49777f1a build: add .xz files to gitignore instead of bz2
We use .xz now instead of .bz2 for release tarballs.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 16:07:52 +01:00
David Herrmann
b5aa1ec644 docs: fix links to point to freedesktop.org
kmscon is now hosted on freedesktop.org. Please don't use the github
links, anymore. I will push to github for some more weeks, but I recommend
to everyone to use my freedesktop.org repository as primary upstream link.

There were many reasons why github.com wasn't sufficient, anymore. But the
main reason is that they no longer provide upload space for release
tarballs. Hence, lets ditch github and move to freedesktop.org which
kindly provides everything we need plus a really nice mailing-list.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 16:05:34 +01:00
David Herrmann
3168ba5a8f build: use xz tarballs instead of bz2
xz is way better than bz2 with same/better decompression times.
Compression will take longer, but that's totally ok.

All new tarballs will be provided as xz only. Please adjust your
build-scripts to stop using bz2.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 16:04:15 +01:00
David Herrmann
616a275605 build: add --enable-all
This flag enables all other options that extend the build. It is used for
debugging only and should never be used by distributions to control what
is built. Hence, we don't document it and never advertise it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 15:45:47 +01:00
David Herrmann
2871e94bf0 tests: use new shl_log.h
log.h was moved to shl so use it in all tests.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 15:29:48 +01:00
David Herrmann
176a0e8be5 uvtd: add new Virtual Terminal daemon
This introduces uvtd which replaces kmscon sessions as an external helper
program. It's still a dummy program but it will get extended soon. After
that, kmscon sessions will get removed and limited to a single seat. This
will simplify kmscon itself heavily and move rarely used features out of
kmscon into helpers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 15:11:30 +01:00
David Herrmann
9c2375b6d4 shl: move githead into a source file
This moves githead.h to shl_githead.c so we can skip recompilations on
GIT-HEAD changes. We only need to relink now (which we cannot skip).

This speeds up build-processes considerably on slower machines.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 15:05:17 +01:00
David Herrmann
0249b2cb0b shl: move log.[ch] to shl_log.[ch]
We want to avoid any static files that are shared between multiple
programs but are not part of SHL. These make the build-process just more
complex.
Move log.[ch] to SHL so we have a known context.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 14:40:36 +01:00
David Herrmann
f14fde004f log: move includes to top
There is no reason to include headers in the main body of the source code.
Move it to the top so it's more readable.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 14:27:27 +01:00
David Herrmann
87e1cf03f2 build: mark font-unifont as noexecstack
ld automatically assumes that any binary input file requires an executable
stack. There's no way to tell it that it doesn't so we simply mark all
inputs as noexecstack.

Reported-by: Etam
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-03-04 12:15:27 +01:00
David Herrmann
ed6d7fa116 Release kmscon-7
This is kmscon-7. See ./NEWS for a list of new features.

Unfortunately, github disabled the "Downloads" section so there is no way
to upload new pre-generated tarballs. I have a pending application to move
kmscon to freedesktop.org, but it didn't get processed in time for this
release. Therefore, you need to build the GNU-autotools files yourself.
That is, before calling ./configure you need to call:
  NOCONFIGURE=1 ./autogen.sh

You can extend your build-scripts with:
  test -f ./configure || NOCONFIGURE=1 ./autogen.sh

Which will call ./autogen.sh if needed. Everything else can be left
unchanged.

I will not upload the tarballs at another location. Feel free to do that
yourself, but I personally think this will introduce more confusion than
help. I hope the freedesktop.org move will be soon approved. This will
also provide a mailing-list where I can properly announce new releases.

Raw tarballs will be available as (without pre-generated autotools):
  https://github.com/dvdhrm/kmscon/archive/kmscon-7.tar.gz
  https://github.com/dvdhrm/kmscon/archive/kmscon-7.zip

The git-tag is: kmscon-7
You can use my public GPG key to verify the tarballs.

As usual, please report bugs to: https://github.com/dvdhrm/kmscon

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
kmscon-7
2013-02-28 11:37:16 +01:00
David Herrmann
b465a83725 build: fix empty --with-*= arguments
It currently isn't possible to pass empty lists to these arguments as it
will then be interpreted as default. Fix this by using "default" if it is
empty.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2013-02-27 19:48:53 +01:00