Commit Graph

23 Commits

Author SHA1 Message Date
Daniel Stone
c228e23b05 configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

[pq: rebased and converted more files]
2013-06-05 01:16:34 -04:00
Rob Bradford
acfb712127 tty: Clean up completely if switching vt fails
The code under the "err" label closes the file descriptor and frees the
allocated memory.
2012-12-06 22:32:37 -05:00
Rob Bradford
592c07a6b9 tty: Log error if we cannot setup a valid tty keyboard mode
The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-10-09 22:50:13 -04:00
Kristian Høgsberg
64eca8949b compositor: Fold the log prototypes into compositor.h and drop log.h
We're trying to keep the API exposed by the core compositor in compositor.h
2012-08-01 00:00:57 -04:00
Kristian Høgsberg
7b884bc0de compositor: Use a minimal restore handler for crash clean up
When we hit a segv, it's often the case that we might crash again in
the attempt to clean up.  Instead we introduce a minimal restore callback
in the backend abstraction, that shuts down as simply as possible.  Then
we can call that from the segv handler, and then to aid debugging, we
raise SIGTRAP in the segv handler.  This lets us run gdb on weston from
a different vt, and if we tell gdb

  (gdb) handle SIGSEGV nostop

gdb won't stop when the segv happens but let weston clean up and switch vt,
and then stop when SIGTRAP is raised.

It's also possible to just let gdb catch the segv, and then use sysrq+k
followed by manual vt switch to get back.
2012-07-31 14:32:01 -04:00
Martin Minarik
6d11836721 Replace fprintf() by weston_log() 2012-06-08 13:11:36 -04:00
Pekka Paalanen
9bc1a4ef9e compositor: move libudev.h to evdev.h
Compositor core does not do anything with udev, so the header is not
needed there. Move the #include into evdev.h, from where it gets used by
compositor-drm.c, too.

Also fix the fallout:
tty.c: In function 'tty_create':
tty.c:143:2: warning: implicit declaration of function 'fstat'

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-17 14:33:30 +03:00
Kristian Høgsberg
eb04ddb1b6 tty: Fall back to K_RAW if K_OFF is not available 2012-04-13 14:54:15 -04:00
Kristian Høgsberg
eeb2e50a76 tty: Put console in K_OFF mode
This disables all kernel key bindings (VT switch keybindings, caps lock
etc) and disables delivery of console input.
2012-04-10 00:35:15 -04:00
Kristian Høgsberg
5d1c0c58ad drm: Add vt switch keybindings 2012-04-10 00:35:09 -04:00
Benjamin Franzke
bfeda130de Introduce weston-launch
weston-launch starts weston and provides mechanism
for weston to set/drop drm master, open a tty,
and read input devices without being root.

Execution is allowed for local-active sessions
or users in the group weston-launch.
2012-04-06 14:01:19 +02:00
Jonas Ådahl
29a9cf0f97 tty: Improve error handling in tty_create()
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-03-28 23:03:00 -04:00
Jonas Ådahl
c97af923d9 Properly dispose event sources and event loops
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-03-28 23:00:08 -04:00
Kristian Høgsberg
bcecca49b8 Revert "weston: Drop priviledges early, and seteuid when needed"
This reverts commit fc6ccb868f.

We still need root permissions for drmDrop/SetMaster.  Without
integration with ConsoleKit or systemd we also don't have access
to /dev/dri/cardX in the case where we open a new VT.
2012-01-24 12:41:19 -05:00
Benjamin Franzke
fc6ccb868f weston: Drop priviledges early, and seteuid when needed 2012-01-24 11:26:41 -05:00
Kristian Høgsberg
08fcbf0f3d tty: Use SIGUSR1 for both enter and leave signals
Now that we track has_vt, we can use the same handler for both enter and leave.
2012-01-18 12:42:16 -05:00
Kristian Høgsberg
62d2774956 tty: Switch back to launch tty if we switched away 2012-01-18 12:38:33 -05:00
Kristian Høgsberg
39d908e63a tty: Open a new vt if not running on a VT
This is typically when launcing from a pty such as an X (or Wayland)
terminal or from an ssh session.  Opening a new vt typically requires root
priviledges, so weston must be setuid root or laucnhed as root for this
to work.
2012-01-16 22:44:34 -05:00
Kristian Høgsberg
353e57f908 tty: Fix order of VT ack/release ioctls and the vt handler
We can only set up once we've acquired the VT and we shouldn't release the
VT until we've cleaned up.  Before we would release the VT first, and then
race to drop drm master as X tried to get drm master.  Which would kill X.
2012-01-16 10:57:14 -05:00
Kristian Høgsberg
92734c5673 tty: Leave tty in KD_GRAPHICS mode during vt switches
Part of the point of KD_GRAPHICS mode is that the kernel doesn't try
to restore the VT contents when we switch bach, but leaves that
to the user mode process.  This avoids ugly flicker of text mode contents
before the compositor takes over.
2012-01-15 15:25:06 -05:00
Kristian Høgsberg
00513ab7cc tty: Close tty fd on exit 2012-01-15 15:25:05 -05:00
Kristian Høgsberg
1201b75bec tty: If no tty option is given, use stdin and make sure it's a vt 2012-01-15 15:25:01 -05:00
Kristian Høgsberg
8334bc1ef9 Rename wayland-compositor to weston
This rename addresses a few problems around the split between core
Wayland and the wayland-demos repository.

1) Initially, we had one big repository with protocol code, sample
compositor and sample clients.  We split that repository to make it
possible to implement the protocol without pulling in the sample/demo
code.  At this point, the compositor is more than just a "demo" and
wayland-demos doesn't send the right message.  The sample compositor
is a useful, self-contained project in it's own right, and we want to
move away from the "demos" label.

2) Another problem is that the wayland-demos compositor is often
called "the wayland compsitor", but it's really just one possible
compositor.  Existing X11 compositors are expected to add Wayland
support and then gradually phase out/modularize the X11 support, for
example.  Conversely, it's hard to talk about the wayland-demos
compositor specifically as opposed to, eg, the wayland protocol or a
wayland compositor in general.

We are also renaming the repo to weston, and the compositor
subdirectory to src/, to emphasize that the main "output" is the
compositor.
2012-01-03 11:04:04 -05:00