Commit graph

399 commits

Author SHA1 Message Date
Pekka Paalanen
36392fbd24 evdev: warn about missing input devices
Usually there should be at least one input device, when Weston starts
up, or is reactivated by a VT switch. Add a nice warning, in case there
are no input devices.

This is to give a clue to users who happen to try Weston on DRM, and
do not get any response.

Add also a message to another failure case, that may lead to missing
input devices.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-11-10 17:51:27 +01:00
Kristian Høgsberg
837e433973 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.
2013-11-10 17:51:27 +01:00
Kristian Høgsberg
b9016b667d clients: Add simple-touch client for testing touch events. 2013-11-10 17:51:27 +01:00
Kristian Høgsberg
267e7fc4e7 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.
2013-11-10 17:51:27 +01:00
Tiago Vignatti
8687708937 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>
2013-11-10 17:51:27 +01:00
Tiago Vignatti
0fc65324a7 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>
2013-11-10 17:51:27 +01:00
Tiago Vignatti
fa1924097f 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>
2013-11-10 17:51:27 +01:00
Tiago Vignatti
aa5b46b20f compositor-drm: destroy evdev driver properly when finishing compositor
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
0b85ddac4c 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>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
47dfaffa0e evdev: run flush_motion only when needed
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
75953314cf evdev: send old valuator inside event frame when the other is missing
when a motion is being performed on ts device, only one axis can be sent
through the evdev bytestream whereas the other could be omitted. For instance:

   -------------- SYN_REPORT ------------
   type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 22208
   type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 631
   type 3 (EV_ABS), code 0 (ABS_X), value 22208
   -------------- SYN_REPORT ------------

on such case we'd have to send the compositor the old value of Y. Commit
f547bd36 introduced this bug cause it was sending zeroed coordinate and not
the old one.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Kristian Høgsberg
cb3c6ad5c6 evdev: Silence warning 2013-11-10 17:51:26 +01:00
Kristian Høgsberg
fb0da2d026 compositor: The compositor is now jiust a regular global object
We have to provide our own bind callback and add a wlsc_compositor pointer
to wlsc_input_device, but on the whole it's nice cleanup.
2013-11-10 17:51:26 +01:00
Kristian Høgsberg
32a940e01a Simplify evdev_flush_motion() a tiny bit 2013-11-10 17:51:26 +01:00
Tiago Vignatti
2a3c15ab50 evdev: fetch absolute coordinates inside flush_motion only
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
f93e815e71 evdev: remove useless field from device structure
We'll want to enhance later the driver regarding the tool being used, but for
now just remove unused bits.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
70ca695e9a evdev: reset accumulator inside evdev_flush_motion
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
2b56d6131e evdev: use a separate structure to denote accumulated motion events
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
1e0dfd820c evdev: use a separate struct for abs information
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Kristian Høgsberg
0090c3b29e evdev: Reset accumulate values when we flush motion events
Otherwise we end up reporting all motion events twice.
2013-11-10 17:51:26 +01:00
Tiago Vignatti
c6fc7c3d21 evdev: fix order of events being sent to the compositor
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
11bf9d088c evdev: remove signed value checks
Very likely that 2.4 kernels won't be used with Wayland compositor so the
check for signal value is pretty much useless.

It's okay to change e->value inside evdev_process_absolute_motion_touchpad
given it's not used later on, and I also rather not touch this snip because it
will be changed when multi-touch support arrives.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:26 +01:00
Tiago Vignatti
f9abe44b98 evdev: Simplify error path for device creation
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
3b6274e10c evdev: Delete unused fields from evdev_input_device
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
6ee755d0db evdev: Add hotplug support
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Kristian Høgsberg
771c31005d evdev: Associate touchscreen devices with output up front
This isn't going to change over time, so just tracking it in the
evdev device is a little easier.  Also, we need to adjust for the
output position when transforming the device events to screen space.
2013-11-10 17:51:25 +01:00
Tiago Vignatti
728a38301f evdev: treat BTN_TOUCH as BTN_LEFT
idea stolen from xorg evdev.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
b5b8c0e807 evdev: use last output from compositor to get the screen geometries
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
76dc338535 evdev: organize the code for processing events
Nothing was touched, just code moved around.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
99476b1a69 evdev: opt out accelerometer type of devices
We may want to adjust the protocol later for clients that care for
these devices only, generating a special event.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Tiago Vignatti
8355f0670a evdev: use a separate function for configuring devices
No semantical changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-11-10 17:51:25 +01:00
Matt Peterson
0ced95682d Relative movement with a touchpad and other misc fixes for events 2013-11-10 17:51:25 +01:00
Kristian Høgsberg
bdf74308e3 evdev: Only add event devices 2013-11-10 17:51:25 +01:00
Kristian Høgsberg
1ba7295e44 compositor: Use systemd seats for input devices as well 2013-11-10 17:51:25 +01:00
Kristian Høgsberg
0e0776fb62 Update return types of event handler functions
Missed this in previous commit.
2013-11-10 17:51:25 +01:00
Kristian Høgsberg
1a75173a73 Some kind of support for touchscreen 2013-11-10 17:51:24 +01:00
Kristian Høgsberg
3b3c001381 Split out evdev handling to its own file 2013-11-10 17:51:24 +01:00
Kristian Høgsberg
b98d9e87ae Split native drm part of compositor out 2010-06-11 12:56:45 -04:00
Kristian Høgsberg
b44f9173f9 Rename wayland-system-compositor back to just compositor 2010-06-04 21:52:02 -04:00
Kristian Høgsberg
566e81ccee Rename egl-compositor to wayland-system-compositor.
The wayland-system-compositor is the top-level compositor.  X sessions
or nested Wayland sessions will run as clients of the system compositor.
The system compositor is licensed under the GPL.
2008-12-19 13:47:53 -05:00
Kristian Høgsberg
8027cba2f1 Rewrite input event delivery path.
Instead of having the input driver push the events into the core server,
only to have the server call back out to the compositor hooks, the driver now
just calls the compositor directly.  The input drivers are always dependent on
the type of compositor anyway so there was no point in passing the events
through the server.  Now the server is only involved when it's time to actually
send the events to the clients.
2008-12-11 23:18:45 -05:00
Kristian Høgsberg
3aa850dd90 Fix signature for pointer motion event. 2008-12-10 17:31:44 -05:00
Kristian Høgsberg
800cdae9af Feed button events through compositor.
This also generalizes the code to send events to a surface a bit.
2008-12-10 13:16:50 -05:00
Kristian Høgsberg
9a0f4ebce6 Put Wayland under the MIT license. 2008-12-02 15:15:01 -05:00
Kristian Høgsberg
3666c9b27f Convert touchpad absolute events to relative. 2008-11-25 23:16:31 -05:00
Kristian Høgsberg
12787f22f9 Add keyboard input, move input device creation to compositor. 2008-11-24 00:31:49 -05:00
Kristian Høgsberg
e3ceb1c060 Add missing breaks in evdev switch. 2008-11-24 00:13:13 -05:00
Kristian Høgsberg
ec11ec9c7c Rename input.c to evdev.c. 2008-11-24 00:12:20 -05:00
Kristian Høgsberg
9b1b1ba4df Initial commit.
This has the basic event loop, and a first cut of the libffi dispatcher.
2008-09-30 09:56:42 -04:00