Commit Graph

3514 Commits

Author SHA1 Message Date
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
Rob Bradford
09252d4b5e desktop-shell: Refactor launcher configuration reading to avoid leaking 2013-07-30 11:06:42 -07:00
Rob Bradford
5c4245d70d compositor-x11: Don't leak the looked up name for skipped outputs 2013-07-30 11:06:06 -07:00
Rob Bradford
5ab9c75d59 window: Free the allocated display if we fail to setup libxkbcommon 2013-07-30 11:05:42 -07:00
Rob Bradford
c48c34d6fa tablet-shell: Avoid leaking the path on failed icon loading 2013-07-30 11:05:23 -07:00
Rob Bradford
c9213e7353 image: Free filename saved into structure on error path 2013-07-30 11:04:58 -07:00
Rob Bradford
307e09ee34 compositor-drm: Use a format width parameter for the modeline sscanf 2013-07-30 11:04:46 -07:00
Rob Bradford
581b3fd779 compositor-fbdev: Close fd used for re-enabling if that fails
The device will be opened again in fbdev_output_create().
2013-07-30 11:04:29 -07:00
Rob Bradford
f8ef42feae compositor-fbdev: Avoid dereferencing a pointer in freed memory
fbdev_output_destroy will free the memory passed into in and since we
want to pass the device name into fbdev_output_create we need to save
this to an intermediate value
2013-07-30 11:04:11 -07:00
Rob Bradford
5c89710166 tty: Correctly check if the opening of the file descriptor failed 2013-07-30 11:03:35 -07:00
Rob Bradford
12a2ff3482 wcap-decode: Close file descriptor when destroying the decoder 2013-07-30 11:03:19 -07:00
Rob Bradford
45c15b83c0 drm: close the drm file descriptor when the compositor is destroyed 2013-07-30 11:02:56 -07:00
Armin K
a02d154b13 autotools: Correctly prefix simple-egl client name 2013-07-30 10:56:42 -07:00
Eduardo Lima
d0357bbb97 weston-launch: Fix signal mask typo 2013-07-30 10:45:26 -07:00
Kristian Høgsberg
73c60ab6e9 weston-launch: Unblock our signalfd signals before execing child
Giovanni Campagna ran into this with mutter.
2013-07-30 09:45:04 -07:00
Rob Bradford
c30c4bd6c8 clipboard: remove the weston_seat destruction listener on destroy
Prior to freeing the memory in which the link node for the signal is
emedded we should remove the link node from the list to prevent the list
from being corrupted.

https://bugs.freedesktop.org/show_bug.cgi?id=67231
2013-07-29 16:37:04 -07:00
Rob Bradford
ead3ef8c77 text-backend: remove the weston_seat destruction listener on destroy
Prior to freeing the memory in which the link node for the signal is
emedded we should remove the link node from the list to prevent the list
from being corrupted.

https://bugs.freedesktop.org/show_bug.cgi?id=67231
2013-07-29 16:36:58 -07:00
Bryce W. Harrington
3d2046ed4b screenshot: Drop extraneous 'is' to improve warning msg grammar
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-29 16:32:51 -07:00
Michael Fu
a2bb7919de Reset touch focus in unmap
Otherwise, there will be race condition of visiting invalid surface data.
2013-07-29 16:31:47 -07:00
Louis-Francis Ratté-Boulianne
dce3dacc37 xwayland: Remove transform listener when destroying the wm
Fix a segfault occuring after the last X window was closed.
2013-07-29 15:47:19 -07:00
Armin K
aac6021bc0 autotools: Add an option to install demo clients
This patch adds a configure option which will enable
user to install demo clients if desired. It is disabled
by default.

v2: Remove AC_DEFINE as it is not necesary
2013-07-29 10:51:19 -07:00
Armin K
77ab1721b8 autotools: Rename demo clients
Prefix demo clients names with weston-, so they can
be installed if user desires.
2013-07-29 10:51:15 -07:00