Commit Graph

3485 Commits

Author SHA1 Message Date
Armin K
b502f906db evdev-touchpad: Set some options using weston.ini
This patch adds 3 new options to weston.ini to allow
the user to change default constant_accel_factor,
min_accel_factor and max_accel_factor. If no options
are set, it falls back using defaults as it did before.

v2: create weston_config_section_get_double and use it
instead of manualy converting string to double.

v3: add default values in weston_config_get_double
instead of using conditionals.

v4: don't pass diagonal as pointer.
2013-08-12 22:42:17 -07:00
Rob Bradford
7ac9f73c7d weston-launch: Only pass non-NULL value into setenv()
getenv() can return NULL is the key is not set, passing NULL into
setenv() is an error
2013-08-12 22:24:44 -07:00
Rolf Morel
14c9892069 evdev: write EV_SYN input_event along with led events to device
Other clients of an evdev device need to have the events they receive
be separated, in moment in time, from other events by an EV_SYN/
SYN_REPORT. This is the responsibility of the client who writes events
into the stream.
2013-08-12 22:23:13 -07:00
Kristian Høgsberg
e9cabc1bc3 nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display 2013-08-12 22:21:22 -07:00
Rob Bradford
4c1a9bc684 build: Allow more control over cairo use in the clients
Previously the configure script would silently disable the use of
accelerated cairo in the clients if cairo-gl could not be found (or
cairo-glesv2 if that was requested.) Conversely the use of cairo-gl
would be automatically enabled if it was found with no way to disable
that feature

This change adds --with-cairo which takes one of "image", "gl" or
"glesv2" (defaulting to "image"). If "gl" or "glesv2" is specified
cairo-egl is checked for as well as the specified renderer. If the check
fails then the configure process errors out.
2013-08-12 22:18:34 -07:00
Kristian Høgsberg
473f248d7e screenshooter: Add missing newline and use program_invocation_short_name 2013-08-12 22:15:38 -07:00
Kristian Høgsberg
bdd8377312 screenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
This application doesn't use toytoolkit, so don't link to it.  We have to
add a copy of xmalloc, to link without toytoolkit.
2013-08-12 22:12:32 -07:00
Giulio Camuffo
4e5f1153ca Install shared/zalloc.h
Plugins need to have it available, as it is included in compositor.h.

https://bugs.freedesktop.org/show_bug.cgi?id=67948
2013-08-12 21:29:53 -07:00
Adrian Negreanu
f5e3ad295c fix compile error when EGL_BUFFER_AGE_EXT is missing
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Adrian Negreanu
6d14b14147 remove dependency on EGL_KHR_surfaceless_context
cairo_egl_device_create(), which is called next,
already checks if EGL_KHR_surfaceless_context is
available. If not, it fallbacks to pbuffer.

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Rob Bradford
880ebc7ed9 input: For serial generation get the display from the compositor
This removes the use of wl_client_get_display() where the client is
derived from the focussed resource. This starts the removal of the
assumption of a single resource on a client that would be notified about
events on the focussed surface.
2013-08-12 16:54:10 -07:00
Rusty Lynch
4384a24a9e desktop-shell: Add touch support to panel launcher icons 2013-08-12 16:54:10 -07:00
Rusty Lynch
3ba1263438 calibrator: Add touch support to calibrator 2013-08-12 16:54:10 -07:00
Rusty Lynch
3bb2b8cfe9 smoke: Add touch support to smoke example 2013-08-12 16:54:10 -07:00
Rusty Lynch
041815aa05 window.c: Add touch handlers
This adds basic infrastructure for handling touch events in the toytoolkit.
2013-08-12 16:50:26 -07:00
Rusty Lynch
f1407ff81d input: Store touch position and time when we start an implicit touch grab 2013-08-08 22:01:42 -07:00
Rusty Lynch
92e83929f0 evdev: Use touch ID 0 when generating touch up event
device->mt.slot is uninitialized when we're not receiving the
evdev slot events.  Always use ID 0 as we do when we generate the
touch down and motion events.
2013-08-08 22:01:42 -07:00
Adrian Negreanu
c838423b5e compositor: Setup weston-launch sock in fbdev
weston_launcher_open() was failing with:
    recvmsg: Socket operation on non-socket

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-08 22:01:42 -07:00
Peter Hutterer
499d8a4046 configure.ac: check for wayland scanner macro 2013-08-08 21:54:53 -07:00
Brian Lovin
1bf14815ef terminal.c: Check if fdopen() fails
If fdopen() fails we just close the fd and return, failing
the copy-and-paste.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-08 16:25:13 -07:00
Peter Hutterer
34be0608c7 weston-launch: always drop privileges before execve
The current code works if pw->pw_shell is bash because:
 "If the shell is started with the effective user (group) id not equal to
 the real user (group) id, and the -p option is not supplied, these actions
 are taken and the effective user id is set to the real user id."

Thus, for bash, weston's EUID == UID.

For zsh, the -p option "is enabled automatically on startup if the effective
user (group) ID is  not equal to the real user (group) ID."
Thus, weston's EUID = 0, and if pw_shell is zsh, /run/user/$UID/wayland-0 is
created with euid root and not writeable by the user, causing all clients to
fail.

Fix this by always dropping privileges to the user.

Regression introduced in 636156d.
2013-08-08 14:11:09 -07:00
Peter Hutterer
4477fee1c3 evdev: log when a device is used as touchpad 2013-08-08 14:04:58 -07:00
Peter Hutterer
6bb15cd4a8 evdev: call evdev_device_destroy on failure
Avoid keeping keeping what needs to be freed in sync in multiple places,
make evdev_device_destroy do the right thing instead.
2013-08-08 14:04:47 -07:00
Peter Hutterer
76d35286cf evdev: plug a potential memleak
For touchpads, device->dispatch is set up when exiting
evdev_handle_device() and a potential source for a memleak.
This can't actually happen at the moment, as evdev_handle_device() won't
fail for touchpads after setting up the dispatch but prevent this from
happening in the future.
2013-08-08 14:04:25 -07:00
Peter Hutterer
df66c5bf79 evdev: get the current slot value from the absinfo struct or mtdev
If touches are already present on the device, absinfo has the currently
active touch slot. There's a race condition where the slot may change before
we enable the fd and we thus miss out on the ABS_MT_SLOT event. It's still
slightly more correct than assuming whatever comes next is slot 0.
2013-08-08 14:03:23 -07:00
Peter Hutterer
0d061e3802 evdev: only use mtdev for Protocol A devices
For Protocol B devices, mtdev merely routes the events and is not needed.
For Protocol A devices, mtdev is needed, so fail for those devices now if we
mtdev fails.
2013-08-08 14:00:30 -07:00
Peter Hutterer
89af60e6f5 evdev: add comment why we're ignoring key value 2 2013-08-08 13:58:36 -07:00
Peter Hutterer
11f5bfbc09 evdev: prevent unterminated device name
The kernel copies up to sizeof(devname) bytes but doesn't null-terminate the
string if the device name exceeds the size of the supplied buffer.
2013-08-08 13:58:27 -07:00
Peter Hutterer
3ca59d3968 clients: fix an error message
_GNU_SOURCE is always true as of c228e23b05, so
program_invocation_short_name is available.
2013-08-08 13:46:14 -07:00
Peter Hutterer
96f0824892 tty: fix typo in error message 2013-08-08 13:46:14 -07:00
Peter Hutterer
45d659dd82 evdev: check for ABS_MT_POSITION_X/Y to determine mt devices
mtdev as currently used in weston is a noop. mtdev's purpose is to convert
Protocol A devices (without ABS_MT_SLOT) to Protocol B devices (slots).
For Protocol B devices mtdev merely routes the events, so checking for
slots and then using mtdev based on that adds no functionality.

Check for ABS_MT_POSITION_X/Y instead and use that to categorise a device
as MT device. mtdev will provide us with a slotted protocol for all devices.

https://bugs.freedesktop.org/show_bug.cgi?id=54428
2013-08-08 13:46:14 -07:00
Peter Hutterer
f3d62276d2 malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-08 13:46:13 -07:00
Peter Hutterer
b1bc4a68b0 Add zalloc(size_t) allocator function
Same as calloc(1, len).
2013-08-08 13:46:13 -07:00
Armin K
214e9ce6ff cms-colord: Don't redefine _GNU_SOURCE
warning: "_GNU_SOURCE" redefined [enabled by default]

See commit c228e23b
2013-08-07 16:30:17 -07:00
Brian Lovin
bc91926e0c clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-07 16:27:33 -07:00
Kristian Høgsberg
1c4f163c6d gl-renderer: Only check for subimage when we have extension at compile time
If weston is compiled against a gl2ext.h that doesn't have the subimage
extension, but then run against a gles2 library that does provide it,
we end up disabling the glTexImage2D falback without having the subimage
code paths compiled in.
2013-08-07 12:11:27 -07:00
Kristian Høgsberg
59758a8a9e Add workaround for broken GL_EXT_unpack_subimage tokens
Earlier versions of gl2ext.h defined the GL_EXT_unpack_subimage tokens
without the _EXT suffix.  That's been fixed and we're using the _EXT
tokens now, but just in case we're using an older, broken header, define
the _EXT tokens manually.
2013-08-07 12:05:08 -07:00
Kristian Høgsberg
4722939d18 gl-renderer.c: Cast wl_resource to void * to avoid warning
The extension has been updated to take a wl_resource * now, but to avoid
warnings when compiling against older versions, just cast to void *.
2013-08-07 11:59:54 -07:00
Kristian Høgsberg
ce7a5d8794 gl-renderer: Test for GL_EXT_unpack_subimage not GL_UNPACK_ROW_LENGTH
It is defined by the mesa #include, which is just a copy of the official
Khronos header.  It's just defined in a different section than the
extension tokens.  In the mean time, the extension tokens were renamed
to add a _EXT suffix (eg GL_UNPACK_ROW_LENGTH -> GL_UNPACK_ROW_LENGTH_EXT)
and we silently failed to used the subimage extension.
2013-08-07 09:55:07 -07:00
Kristian Høgsberg
cb61dcf2ce nested: Update to use weston-nested-client binary name 2013-08-07 09:50:12 -07:00
Kristian Høgsberg
3c17933de8 Use #define WL_HIDE_DEPRECATED to avoid deprecated warnings for wl_buffer 2013-08-06 19:27:04 -07:00
Stefan Schmidt
85c40f2d85 clients: Fix typo in simple-touch and simple-shm.
listenter -> listener. Better fix it now before it spreads further.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-08-06 17:02:59 -07:00
Bryce Harrington
c814c58adc Drop extraneous duplicate header includes
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-06 17:02:22 -07:00
Tomeu Vizoso
0368189bac rpi: Add support for SHM buffers in RGB565 format 2013-08-06 16:51:14 -07:00
Tomeu Vizoso
1c1fc29cf1 pixman-renderer: Add support for SHM buffers in RGB565 format 2013-08-06 16:50:59 -07:00
Tomeu Vizoso
12072b6a7c gl-renderer: Add support for SHM buffers in RGB565 format 2013-08-06 16:50:51 -07:00
Tomeu Vizoso
bee45a14cd window: Allow hinting of a preference for RGB565 when creating a window
And check if the renderer supports the RGB565 format for wl_shm buffers
before creating the cairo surface and requesting the buffer.

It can save quite some memory with big surfaces such as desktop
backgrounds.
2013-08-06 16:49:27 -07:00
Kristian Høgsberg
0ff7908767 compositor: Check wl_resource_create() return value
This fixes a number of call-sites to properly check for NULL and return
the no memory event when allocation fail.
2013-08-06 16:46:25 -07:00
Kristian Høgsberg
b10b44b58c data-device.c: Handle failure to allocate offer in weston_drag_set_focus
If we fail to allocate and send the offer, don't send the drag enter and
don't set the drag focus so we don't send motion events or leave.
2013-08-06 11:15:22 -07:00
Kristian Høgsberg
3c30f0f950 data-device.c: Handle OOM in weston_data_source_send_offer()
If we fail to allocate the resource, clean up and return NULL.
2013-08-06 10:24:04 -07:00