Commit Graph

494 Commits

Author SHA1 Message Date
Jussi Kukkonen
649bbce607 include stdint.h for int32_t/uint32_t
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-26 16:26:08 -07:00
Bryce Harrington
a8d987d93c systemd: Also force base-10 for the strtol() call
This call is used to parse a time value expressed in usec's, which is
always decimal.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2016-07-12 19:03:01 -07:00
Bryce Harrington
375759e636 Require base-10 for strtol() calls
The third arg to strtol() specifies the base to assume for the number.
When 0 is passed, as is currently done in option-parser.c, hexadecimal
and octal numbers are permitted and automatically detected and
converted.

This change is an expansion of f6051cbab8
to cover the remaining strtol() calls in Weston, where the routine is
being used to read fds and pids - which are always expressed in base-10.
It also changes the calls in config-parser, used by
weston_config_section_get_int(), which in turn is being used to read
scales, sizes, times, rates, and delays; these are all expressed in
base-10 numbers only.

The benefit of limiting this to base-10 is to eliminate surprises when
parsing numbers from the command line.  Also, by making the code
consistent with other usages of strtol, it may make it possible to
factor out the common code in the future.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-12 18:46:13 -07:00
Bryce Harrington
1dbdc0bd8a Include space in 'if ('
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-12 18:45:41 -07:00
Bryce Harrington
cff0b1d80f xwayland: Cleanup error message on spawn failure Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-07-07 10:48:34 -07:00
Bryce Harrington
9335ca5c02 xwayland: Include missing config.h
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-07-07 10:48:19 -07:00
Giulio Camuffo
9c764df043 xwayland: make the plugin usable by libweston compositors
This patch follows a similar approach taken to detach the backends from
weston. But instead of passing a configuration struct when loading the
plugin, we use the plugin API registry to register an API, and to get it
in the compositor side.  This API allows to spawn the Xwayland process
in the compositor side, and to deal with signal handling.  A new
function is added in compositor.c to load and init the xwayland.so
plugin.

Also make sure to re-arm the SIGUSR1 when the X server quits.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
[Pekka: moved xwayland/weston-xwayland.c -> compositor/xwayland.c]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-07-01 14:34:33 +03:00
Armin Krezović
d84deeb173 compositor-headless: Support starting with zero outputs
This patch adds a new command line option which can be
used to tell headless backend not to create any
virtual outputs.

This will be used for output hotplug emulation, where
weston will start with no outputs available, and the
virtual output will be created at runtime.

v2:

- Use bool instead of int for the indicator flag
- Move final newspace to a separate line in command
  line options

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
2016-06-27 13:17:05 +03:00
Pekka Paalanen
20436e206e main: log the command line
Write the command line to the log to aid debugging. It needs to be
copied before parsing, because parsing mutates argv.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-06-23 18:14:36 +03:00
Pekka Paalanen
58f98c99f5 Move weston source to compositor/
This is the start of separating weston-the-compositor source files from
libweston source files.

This is moving all the files related to the 'weston' binary. Also the
CMS and systemd plugins are moved.

xwayland plugin is not moved, because it will be turned into a
libweston feature.

To avoid breaking the build, #includes for weston.h are fixed to use
compositor/weston.h. This serves as a reminder that such files may need
further attention: moving to the right directory, or maybe using the
proper -I flags instead.

v2: Move also screen-share.c, and add a note about weston-launch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
2016-06-23 17:44:54 +03: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
Kristian Høgsberg
4c61747a1f x11: Clear X11 selection when we can't bridge the data type 2011-12-29 14:16:42 -05:00
Kristian Høgsberg
f258a310bf Fix WL_EVENT_WRITEABLE typo 2011-12-28 22:51:20 -05:00
Kristian Høgsberg
33f8670ee2 x11: Bridge Wayland selections to X11 CLIPBOARD selection
This is the other direction.  The selection bridge will grab the X11
CLIPBOARD selection on behalf of the Wayland client when it sets the
Wayland selection.  Right now only UTF-8 text is supported, but the
data types offered will be taken from the Wayland data source.
2011-12-28 22:42:09 -05:00
Kristian Høgsberg
0050fd7d8b x11: Handle BadWindow errors 2011-12-27 23:01:23 -05:00
Kristian Høgsberg
facb558448 x11: Remove destroy listener when X11 window is destroyed 2011-12-27 22:47:51 -05:00
Kristian Høgsberg
a42c128201 x11: Store interesting window properties, dump a few more things 2011-12-27 21:36:41 -05:00
Kristian Høgsberg
94110f7bb8 x11: Improvide debugging output a bit 2011-12-27 20:20:46 -05:00
Kristian Høgsberg
8b316f0255 x11: Remove a couple of done TODOs 2011-12-27 14:05:36 -05:00
Kristian Høgsberg
11d0512ce9 compositor: Pull in hash table from protocol
We use it in the X WM implementation, but we don't want it in the core
libraries.
2011-12-27 14:02:40 -05:00
Kristian Høgsberg
e7aaec301a x11: Bridge X11 CLIPBOARD selection to Wayland clients 2011-12-27 13:50:04 -05:00
Kristian Høgsberg
09e2692403 compositor-x11: Use ARRAY_LENGTH macro from wayland-util.h 2011-12-23 13:33:45 -05:00
Kristian Høgsberg
03cb5cf9a7 compositor: Handle disappearing surfaces and input devices for touch 2011-12-22 14:47:44 -05:00
Kristian Høgsberg
558949b67b clients: Add simple-touch client for testing touch events. 2011-12-22 13:45:50 -05:00
Kristian Høgsberg
3937354eef evdev: Store positions for all touch points in the evdev device
We need to store all touchpoint positions so that if we just get an
ABS_MT_POSITION_X or Y event, we can pull the other coordinate from the
cache.  And we need this across invocations of evdev_input_device_data(),
so the accumulator approach doesn't work.

Instead, we go back to the approach of storing all this state in the
evdev device struct and we might as well just move the rel and abs state
there too.
2011-12-22 11:32:39 -05:00
Kristian Høgsberg
3543ff4f82 compositor: Send touch_up before clearing touch focus
Otherwise it never gets sent.
2011-12-22 11:32:39 -05:00
Tiago Vignatti
1f221fff71 compositor: Send out touch events accordingly
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-22 11:13:05 -05:00
Tiago Vignatti
22c6bcec9c evdev: Add ABS_MT_* support for direct touch devices
This adds ABS_MT_* support for direct touch devices and notifies
the compositor.  The compositor has a stub for now.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-22 11:13:04 -05:00
Kristian Høgsberg
773d13b543 compositor: Make surface picking not depend on an input device 2011-12-22 11:13:04 -05:00
Pekka Paalanen
3429a72597 compositor: fix uniform handling for fade_output()
fade_output() is strange in that it manufactures a wlsc_surface object
by hand, and then calls wlsc_surface_draw() on it.

Valgrind complained, that wlsc_surface_draw() accesses uninitialised
data: wlsc_surface::alpha. fade_output() forgets to set it.

Initialise surface.alpha in fade_output(). Specifically, set it to
compositor->current_alpha to deliberatly avoid the gluniform1f() call in
wlsc_surface_draw().

fade_output() binds a different GL shader program than
wlsc_surface_draw() expects. This program does not have a uniform called
"alpha", and the uniform location given in glUniform1f() is not for
this program anyway. A hint of that is the runtime error:
Mesa: User error: GL_INVALID_OPERATION in glUniform(type mismatch)

Fixing this seems to get rid of half a thousand of Valgrind errors, and
of course the Mesa user error.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-20 10:59:39 -05:00
Kristian Høgsberg
2a25cd4ffa compositor: Remove shell->activate callback
It's all internal to the shell plugin now.
2011-12-19 15:21:40 -05:00
Kristian Høgsberg
e1a850e5b0 compositor: Move click-to-focus and ctrl-alt-bs bindings to shell.c 2011-12-19 15:21:39 -05:00
Kristian Høgsberg
f47d8fe88c compositor: Move binding code to util.c 2011-12-19 15:21:30 -05:00
Kristian Høgsberg
2bd5b6376c compositor: Consolidate code for finding and running bindings 2011-12-19 14:59:57 -05:00
Kristian Høgsberg
5a5f0077be compositor: Make click to activate behavior a binding 2011-12-19 14:54:11 -05:00
Kristian Høgsberg
42e40ae6dd x11: Ignore FocusOut with mode = NotifyUngrab
Not sure why we get these, but it happens for Alt-click to move a window
(metacity binding) and messes up the idle inhibit counter.
FocusOut event as a result of ungrabbing doesn't really make sense and
fortunately we can safely ignore them.
2011-12-19 14:36:52 -05:00
Tiago Vignatti
ce03ec3fbe evdev: new header file for the driver
Besides the new header file, there's also a change in the main evdev creation
procedure for a more suggestive name (evdev_input_add_devices ->
evdev_input_create). There's no real functional changes in this commit.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-19 01:14:03 +02:00
Tiago Vignatti
6e2d5f14e8 compositor-drm: remove/add evdev devices when vt switches
Reported-by: Ran Benite <ran234@gmail.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-19 01:08:16 +02:00
Tiago Vignatti
9e2be08418 compositor: first destroy backend routines and then display
I caught this when an evdev device fd was trying to trigger the main event
loop, which was already free'd and causing an invalid read.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-19 01:07:52 +02:00
Tiago Vignatti
c349e1d0b0 compositor-drm: destroy evdev driver properly when finishing compositor
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-19 01:07:37 +02:00
Tiago Vignatti
0db1d5f551 evdev: use a separate function for adding devices
Adds new function evdev_add_devices for adding udev devices. No
functional changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-19 01:00:35 +02:00
Tiago Vignatti
b303a1d3fc compositor: use wl_list_for_each_safe when destroying output
Was causing an invalid read when the output is in fact destroyed. That's only
visible (segfault on my machine) on drm compositor because it's the only
backend trying to finish correct the compositor.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-12-18 22:27:40 +02:00
Juan Zhao
7bb92f0c03 Activate toplevel fullscreen and menu surfaces
Activate the toplevel, fullscrren and menu surfaces during mapping,
so that the launched applications can get the keyboard focus without
clicking on that window.
2011-12-15 11:31:51 -05:00
Kristian Høgsberg
ef458246b0 desktop-shell: Animate surface opacity in zoom animation as well 2011-12-15 11:24:25 -05:00
Kristian Høgsberg
541e5557ac compositor: Implement surface global alpha
Just a small tweak to the shader and we can control the overall surface alpha.
2011-12-15 11:15:12 -05:00
Kristian Høgsberg
cd9ac1da5f compositor: Remove server side cursors
We always expect the clients to set the cursor and attaching a NULL buffer
hides the cursor.  The cursor starts out hidden.
2011-12-15 09:15:08 -05:00
Pekka Paalanen
7296e7984f compositor: let shell override idle time
Move idle_time variable to struct wlsc_compositor, so that a shell
plugin can change it. Also store the original value from the command
line.

Add "duration" option to the desktop-shell screensaver config. This is
the time the screensaver will be visible, after idle timeout triggers
another time and blanks the screen.

Now you can have different delays to lock the screen, and switch off the
screen while a screensaver is running.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 13:50:35 +02:00
Pekka Paalanen
e955f1edd1 shell: use desktop-shell ini file for screensaver path
Read the same configuration file in the shell plugin (desktop-shell) as
the desktop-shell client does.

Add a new section "screensaver", where "path" defines the path of the
idle animation client to be executed. Not defining "path" disables the
animation.

Idle animations are not in use by default. It must be configured in
wayland-desktop-shell.ini or launched manually.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 13:45:49 +02:00
Pekka Paalanen
18027e517a shell: automatic exec and kill of wscreensaver
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 13:45:33 +02:00
Pekka Paalanen
bce2d3f9a7 compositor: add IDLE state
Add WLSC_COMPOSITOR_IDLE state to the possible compositor internal
states, and fix the drm backend to restore the previous state instead of
forcing ACTIVE.

Normally, the compositor only uses the ACTIVE and SLEEPING states. The
IDLE state is another active state, reserved for the shell, when the
shell wants to have unlock() calls on activity, but the compositor cannot
be SLEEPING.

Use the IDLE state to fix exposing the unlock dialog while a screensaver
is animating. Without this fix, is it impossible to activate the unlock
dialog without waiting for a second idle timeout that really puts the
compositor into SLEEPING.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 13:44:29 +02:00