profile/ivi/weston-ivi-shell.git
10 years agocompositor-drm: Pass the wl_resource to gbm_bo_import()
Kristian Høgsberg [Wed, 4 Sep 2013 05:27:08 +0000 (22:27 -0700)]
compositor-drm: Pass the wl_resource to gbm_bo_import()

Another silent regression from the wl_resource opaquify effort.  This was
causing our pageflip-to-client-buffer and sprites optimizations to
not kick in.

10 years agoxwm: Unmap frame window when client window is unmapped
Kristian Høgsberg [Tue, 3 Sep 2013 23:38:51 +0000 (16:38 -0700)]
xwm: Unmap frame window when client window is unmapped

We used to destroy the frame window and reparent the client window to
wm_window.  That means that we lose the destroy_notify event when the
client window is destroyed later, since we don't select for
substructure_notify on wm_window.

Instead of destroying and reparenting, just unmap the frame window.

10 years agoxwm: Split creation of frame window out into its own function
Kristian Høgsberg [Tue, 3 Sep 2013 23:19:18 +0000 (16:19 -0700)]
xwm: Split creation of frame window out into its own function

10 years agoxwm: Set window->surface to NULL when surface goes away
Kristian Høgsberg [Tue, 3 Sep 2013 23:15:42 +0000 (16:15 -0700)]
xwm: Set window->surface to NULL when surface goes away

Otherwise we may end up trying to remove the destroy listener if we
get the surface_destroy callback before the unmap_notify.

10 years agoxwm: Detect WM_NORMAL_HINTS fullscreen attempts
Kristian Høgsberg [Sat, 31 Aug 2013 07:12:25 +0000 (00:12 -0700)]
xwm: Detect WM_NORMAL_HINTS fullscreen attempts

10 years agoxwm: Detect legacy fullscreen modes
Kristian Høgsberg [Sat, 31 Aug 2013 07:08:27 +0000 (00:08 -0700)]
xwm: Detect legacy fullscreen modes

10 years agoxwm: Update size when override redirect windows change size
Kristian Høgsberg [Sat, 31 Aug 2013 07:00:57 +0000 (00:00 -0700)]
xwm: Update size when override redirect windows change size

10 years agoconfigure: Require wayland-server 1.2.90
Kristian Høgsberg [Fri, 30 Aug 2013 22:00:01 +0000 (15:00 -0700)]
configure: Require wayland-server 1.2.90

Make sure we look for a recent enough version of wayland-server for
the new wl_seat release requests.

10 years agowindow: Use new wl_pointer/keyboard_release request
Rob Bradford [Tue, 13 Aug 2013 19:11:03 +0000 (20:11 +0100)]
window: Use new wl_pointer/keyboard_release request

Since we bump the version we ask for from the compositor it is also
necessary to implement the new "name" event in the seat listener.

10 years agocompositor: Implement release request for input interfaces
Kristian Høgsberg [Tue, 13 Aug 2013 19:11:02 +0000 (20:11 +0100)]
compositor: Implement release request for input interfaces

v2 (Rob Bradford): Update the version numbering for this change

10 years agoconfigure.ac: Auto-enable vaapi recorder, but allow overrides
Kristian Høgsberg [Fri, 30 Aug 2013 21:28:22 +0000 (14:28 -0700)]
configure.ac: Auto-enable vaapi recorder, but allow overrides

If libva is available and recent, we'll enable the vaapi recorder feature,
but it can also be forced on or off by --enable/disable-vaapi-recorder.

10 years agocompositor-drm: Add hardware accelerated capture of screen using libva
Ander Conselvan de Oliveira [Fri, 23 Aug 2013 14:15:48 +0000 (17:15 +0300)]
compositor-drm: Add hardware accelerated capture of screen using libva

This patch adds a feature to the DRM backend that uses libva for
encoding the screen contents in H.264. Screen recording can be
activated by pressing mod-shift-space q. A file named capture.h264
will be created in the current directory, which can be muxed into
an MP4 file with gstreamer using

gst-launch filesrc location=capture.h264 ! h264parse ! mp4mux ! \
           filesink location=file.mp4

This is limitted to the DRM compositor in order to avoid a copy when
submitting the front buffer to libva. The code in vaapi-recorder.c
takes a dma_buf fd referencing it, does a colorspace conversion using
the video post processing pipeline and then uses that as input to the
encoder.

I'm sending this now so I get comments, but this is not ready for
prime time yet. I have a somewhat consistent GPU hang when using
i915 with SandyBridge. Sometimes a page flip never completes. If you
want to try this anyway and your system get stuck, you might need to
run the following:

  # echo 1 > /sys/kernel/debug/dri/0/i915_wedged

After that, alt-sysrq [rv] should work.

Once that's fixed it would also be good to make the parameters used by
the encoder more flexible. For now the QP parameter is hardcoded to 0
and we have only I and P frames (no B frames), which causes the
resulting files to be very large.

10 years agoautotools: Fix AC_PATH_PROG call
Quentin Glidic [Sat, 24 Aug 2013 18:36:10 +0000 (20:36 +0200)]
autotools: Fix AC_PATH_PROG call

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
10 years ago.gitignore: Reflect recent client binary rename
Bryce W. Harrington [Fri, 23 Aug 2013 19:57:04 +0000 (19:57 +0000)]
.gitignore: Reflect recent client binary rename

Commit 77ab1721 renamed the client binaries; this change updates
.gitignore to follow this change.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
10 years agowindow.c: Fix SIGSEGV in pointer_handle_motion
Paul Winwood [Thu, 29 Aug 2013 09:52:54 +0000 (10:52 +0100)]
window.c: Fix SIGSEGV in pointer_handle_motion

Move null pointer check and assignments before first window dereference.

10 years agoevdev: Don't parse config file again, use compositor->config
Kristian Høgsberg [Thu, 29 Aug 2013 20:49:35 +0000 (13:49 -0700)]
evdev: Don't parse config file again, use compositor->config

10 years agoshell: Make sure we have seat->pointer and seat->touch before dereferencing
Kristian Høgsberg [Thu, 29 Aug 2013 06:16:20 +0000 (23:16 -0700)]
shell: Make sure we have seat->pointer and seat->touch before dereferencing

Either of these may not be available when we handle wl_shell_surface.move,
and we need to not crash when that's the case.

https://bugs.freedesktop.org/show_bug.cgi?id=68649

10 years agogl-renderer: Use GL_UNSIGNED_SHORT for index array type
Kristian Høgsberg [Thu, 29 Aug 2013 06:05:29 +0000 (23:05 -0700)]
gl-renderer: Use GL_UNSIGNED_SHORT for index array type

GL_UNSIGNED_INT is only supported when GL_OES_element_index_uint is
available (mesa implements that extension).  We don't need 32-bit
indices, so just use GL_UNSIGNED_SHORT.

10 years agosubsurfaces: fix rendering problem with cairo-glesv2
Stanislav Vorobiov [Wed, 28 Aug 2013 06:14:35 +0000 (10:14 +0400)]
subsurfaces: fix rendering problem with cairo-glesv2

when using cairo-glesv2 subsurface rendering code
implicitly calls eglMakeCurrent(dpy, NULL, NULL, ctx)
(since EGL_KHR_surfaceless_context is used), thus,
triangle_frame_callback:eglSwapBuffers returns EGL_BAD_SURFACE
error for all invocations other that the first one

10 years agoconfigure.ac: fix broken compilation when configure with --disable-egl option
Samuel Iglesias Gonsalvez [Wed, 28 Aug 2013 09:22:41 +0000 (11:22 +0200)]
configure.ac: fix broken compilation when configure with --disable-egl option

Fix bug 67561: "configure with --disable-egl option breaks fbdev backend
compilation"

https://bugs.freedesktop.org/show_bug.cgi?id=67561

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
10 years agoconfigure.ac: Bump configure.ac version to 1.2.90
Kristian Høgsberg [Thu, 29 Aug 2013 05:16:10 +0000 (22:16 -0700)]
configure.ac: Bump configure.ac version to 1.2.90

We usually do this when we branch off the stable branch, better late than
never.

10 years agoevdev: Don't transform device->abs.x/y in place
Kristian Høgsberg [Thu, 29 Aug 2013 05:12:24 +0000 (22:12 -0700)]
evdev: Don't transform device->abs.x/y in place

We don't always get both an X and an Y event in a SYN report, so we end
up transforming the coordinate we don't get twice.  For example, if we
only receive an ABS_X event, we transform the already transformed
device->abs.y again in transform_absolute() when applying the calibration.

10 years agodesktop-shell: Add support for touch unlock
Brian J Lovin [Mon, 26 Aug 2013 22:58:22 +0000 (15:58 -0700)]
desktop-shell: Add support for touch unlock

Add support for unlocking on touch up using the
green button on the unlock dialog

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
10 years agoAdd a --shell option to override the default desktop-shell
Jason Ekstrand [Thu, 22 Aug 2013 22:28:03 +0000 (17:28 -0500)]
Add a --shell option to override the default desktop-shell

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
10 years agosimple-egl: Handle missing EGL_EXT_buffer_age better
Kristian Høgsberg [Thu, 22 Aug 2013 19:16:51 +0000 (12:16 -0700)]
simple-egl: Handle missing EGL_EXT_buffer_age better

Including src/weston-egl-ext.h breaks distcheck, so lets just copy the
one EGL_EXT_buffer_age into simple-egl.c.

10 years agocompositor.h: Don't include config.h
Pier Luigi Fiorini [Fri, 23 Aug 2013 21:43:23 +0000 (23:43 +0200)]
compositor.h: Don't include config.h

Public headers should not include config.h.

10 years agoAdd more missing config.h #includes
Kristian Høgsberg [Mon, 26 Aug 2013 21:43:17 +0000 (14:43 -0700)]
Add more missing config.h #includes

Now that we use AC_SYS_LARGEFILE, we need to pull in config.h at least
whereever we use mmap().  Fixes at least the test-suite and simple-shm
on 32 bit systems.

10 years agoevdev: Initliaze device->link so we can wl_list_remove() without crashing
Kristian Høgsberg [Mon, 26 Aug 2013 21:35:32 +0000 (14:35 -0700)]
evdev: Initliaze device->link so we can wl_list_remove() without crashing

We were testing for wl_list_empty() on a { NULL, NULL } list (which
returns false) and then wl_list_remove()ing the device (which crashes).

10 years agoxwm: Use window->x/y for override redirect surfaces
Kristian Høgsberg [Thu, 22 Aug 2013 23:24:15 +0000 (16:24 -0700)]
xwm: Use window->x/y for override redirect surfaces

window->x/y is the coordinate of the top-level surface (whether that's
the frame window or an override-redirect window) and the wayland surface
should be placed there, without the t->margin offset.

10 years agoxwm: Fix transform listener
Kristian Høgsberg [Thu, 22 Aug 2013 23:20:44 +0000 (16:20 -0700)]
xwm: Fix transform listener

The coordinate transformation was broken (worked for first output where
output->x/y was 0,0, broke on all other outputs).  We can just use
surface->geometry.x/y directly.  We can't use the full transformation,
the best we can do is to move the X window to the geometry.x/y location.

Get rid of the static old_sx/sy hack as well.

10 years agoxwm: Fix configure notify handler
Kristian Høgsberg [Thu, 22 Aug 2013 23:18:17 +0000 (16:18 -0700)]
xwm: Fix configure notify handler

We only get configure notify for toplevel (frame or override-redirect window)
and those are the cases where we want to update window->x/y.  The way the
code worked, we'd exit immeidately in those cases and window->x/y would
not be updated.

10 years agoxwm: Set _NET_WM_CM_S0 instead of relying on the xwayland module to do it
Kristian Høgsberg [Thu, 22 Aug 2013 05:14:58 +0000 (22:14 -0700)]
xwm: Set _NET_WM_CM_S0 instead of relying on the xwayland module to do it

Not sure why I made xwayland claim this selection, seem a little
awkward in retrospect.

10 years agocompositor-drm: Zero out create_arg when creating dumb framebuffers
Kristian Høgsberg [Thu, 22 Aug 2013 05:14:14 +0000 (22:14 -0700)]
compositor-drm: Zero out create_arg when creating dumb framebuffers

The create_arg struct has a flags member that we didn't properly set to 0.

10 years agoterminal: Include config.h instead of defining _XOPEN_SOURCE
Kristian Høgsberg [Thu, 22 Aug 2013 05:13:17 +0000 (22:13 -0700)]
terminal: Include config.h instead of defining _XOPEN_SOURCE

10 years agoconfigure.ac: Add AC_SYS_LARGEFILE for mmap()ing dumb GEM buffers
Kristian Høgsberg [Wed, 21 Aug 2013 22:44:57 +0000 (15:44 -0700)]
configure.ac: Add AC_SYS_LARGEFILE for mmap()ing dumb GEM buffers

We're mmap()ing buffers with 64 bit offsets coming from the
DRM_IOCTL_MODE_MAP_DUMB ioctl and need to make sure mmap accepts
those.

10 years agodata-device: Only bail out if we failed to allocate offer
Kristian Høgsberg [Tue, 20 Aug 2013 22:58:25 +0000 (15:58 -0700)]
data-device: Only bail out if we failed to allocate offer

It's valid to have a NULL data source (self-dnd) in which case we send
a NULL offer on enter.

10 years agocompositor: Only check buffer for NULL tried to allocate something
Kristian Høgsberg [Tue, 20 Aug 2013 18:30:54 +0000 (11:30 -0700)]
compositor: Only check buffer for NULL tried to allocate something

In particular, if we get a NULL buffer attach, it's ok for buffer to be NULL.

10 years agoautotools: Don't use wayland-scanner.m4
Daiki Ueno [Tue, 20 Aug 2013 07:56:52 +0000 (09:56 +0200)]
autotools: Don't use wayland-scanner.m4

10 years agoset RDP output enabled by default (stable 1.2)
Hardening [Fri, 16 Aug 2013 22:30:31 +0000 (00:30 +0200)]
set RDP output enabled by default (stable 1.2)

This patch fixes a bug found by Marek Romanowic: the RDP peer output must
be enabled by default, or we have to unfocus/focus the RDP client window to
have disable/enable output messages sent (and finally receive updates).

10 years agoFixes CJK wide character display
Peng Wu [Mon, 19 Aug 2013 02:59:21 +0000 (10:59 +0800)]
Fixes CJK wide character display

By jumping two columns when wide character prints,
and draw wide background under wide character.

10 years agoAdd touch support for wl_shell_surface_move
Rusty Lynch [Thu, 15 Aug 2013 16:10:08 +0000 (09:10 -0700)]
Add touch support for wl_shell_surface_move

10 years agonested: Fix skipping frames due to texture update without a context
Ander Conselvan de Oliveira [Tue, 16 Jul 2013 11:24:04 +0000 (14:24 +0300)]
nested: Fix skipping frames due to texture update without a context

Calls into cairo-gles may change the current context, so it was only by
chance that sometimes we had the proper one as current and updated the
correct texture in surface_attach().

In order to fix this, calling display_acquire_window_surface() before
binding the texture for setup is necessary. However this call has the
side effect of allocating a cairo surface for the window. At flush time,
the existence of this surface will cause an eglSwapBuffers(), even
if no rendering was done to it, leading to undefined contents on the
screen. This happens when the idle redraw task runs while there is a
pending frame callback.

Workaround this by moving the texture setup from surface_attach() to the
redraw handler, so that the cairo surface is only allocated when
redering is done.

10 years agonested: The wl_resouce is the buffer, not the wl_resource user data
Kristian Høgsberg [Thu, 15 Aug 2013 22:17:57 +0000 (15:17 -0700)]
nested: The wl_resouce is the buffer, not the wl_resource user data

10 years agoAdd more missing config.h includes
Daniel Stone [Thu, 15 Aug 2013 00:10:24 +0000 (01:10 +0100)]
Add more missing config.h includes

config.h includes were missing in a few files, including input.c, the
lack of which caused the X11 backend to segfault instantly due to not
having an xkbcommon context.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
10 years agowindow: Use xzalloc() instead of silently failing to add output
Kristian Høgsberg [Thu, 15 Aug 2013 21:28:25 +0000 (14:28 -0700)]
window: Use xzalloc() instead of silently failing to add output

10 years agoadd [xwayland] path weston.ini option
Maksim Melnikau [Wed, 14 Aug 2013 19:33:10 +0000 (22:33 +0300)]
add [xwayland] path weston.ini option

It sets the path to the xserver to run.

Signed-off-by: Maksim Melnikau <maxposedon@gmail.com>
10 years agoweston-info: Use xmalloc() in weston-info
Kristian Høgsberg [Thu, 15 Aug 2013 21:20:53 +0000 (14:20 -0700)]
weston-info: Use xmalloc() in weston-info

10 years agowindow: Use xzalloc() instead of failing to add input device
Kristian Høgsberg [Thu, 15 Aug 2013 21:17:13 +0000 (14:17 -0700)]
window: Use xzalloc() instead of failing to add input device

10 years agowindow: Fix logic for looking up widget default cursor
Kristian Høgsberg [Thu, 15 Aug 2013 21:15:18 +0000 (14:15 -0700)]
window: Fix logic for looking up widget default cursor

We may deref a NULL pointer if there is no grab and no focus widget.

10 years agocompositor: Handle OOM in weston_buffer_from_resource()
Kristian Høgsberg [Thu, 15 Aug 2013 19:26:42 +0000 (12:26 -0700)]
compositor: Handle OOM in weston_buffer_from_resource()

Handle NULL-return in call-sites as well.

10 years agowindow: Don't check for subcompositor in window_add_subsurface()
Kristian Høgsberg [Thu, 15 Aug 2013 18:56:41 +0000 (11:56 -0700)]
window: Don't check for subcompositor in window_add_subsurface()

Client should check for subcompositor support up front.  Now
window_add_surface() can never return NULL.

10 years agowindow: Add API to check for subcompositor, use in subsurface example
Kristian Høgsberg [Thu, 15 Aug 2013 18:54:03 +0000 (11:54 -0700)]
window: Add API to check for subcompositor, use in subsurface example

This way we can fail with a nice error message.

10 years agosimple-touch: Handle OOM when allocating struct touch
Kristian Høgsberg [Thu, 15 Aug 2013 18:40:30 +0000 (11:40 -0700)]
simple-touch: Handle OOM when allocating struct touch

10 years agosimple-shm: Handle OOM when allocating struct display
Kristian Høgsberg [Thu, 15 Aug 2013 18:39:52 +0000 (11:39 -0700)]
simple-shm: Handle OOM when allocating struct display

10 years agokeyboard: Don't use next_utf8_char() to go back where we came from
Kristian Høgsberg [Thu, 15 Aug 2013 18:37:09 +0000 (11:37 -0700)]
keyboard: Don't use next_utf8_char() to go back where we came from

We go one utf8 char back and then one forward.  Just remember the original
position instead, which also avoids a warning about potentially
dereferencing a NULL return value from next_utf8_char().

10 years agoautotools: Add configure summary
Armin K [Wed, 14 Aug 2013 01:13:53 +0000 (03:13 +0200)]
autotools: Add configure summary

10 years agoterminal: Make utf-8 state machine assemble unicode code point value
Kristian Høgsberg [Wed, 14 Aug 2013 00:23:54 +0000 (17:23 -0700)]
terminal: Make utf-8 state machine assemble unicode code point value

10 years agocompositor: ref-count weston_surface instances
Giulio Camuffo [Tue, 13 Aug 2013 21:10:14 +0000 (23:10 +0200)]
compositor: ref-count weston_surface instances

This allows a surface to live on after its resource has been
destroyed.  The ref-count can be increased in a resource destroy signal
listener, to keep the surface around for a destroy animation, for example.

10 years agoevdev: Ignore joystick devices
Kristian Høgsberg [Tue, 13 Aug 2013 21:55:39 +0000 (14:55 -0700)]
evdev: Ignore joystick devices

We don't handle them in any way now and having your steering wheel move
the cursor isn't useful.  Applications can still open evdev devices and
access them directly like they already do.

10 years agoxwm: do not crash when activating a NULL surface
Giulio Camuffo [Tue, 13 Aug 2013 09:42:02 +0000 (11:42 +0200)]
xwm: do not crash when activating a NULL surface

10 years agoevdev-touchpad: Set some options using weston.ini
Armin K [Tue, 30 Jul 2013 23:41:03 +0000 (01:41 +0200)]
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.

10 years agoweston-launch: Only pass non-NULL value into setenv()
Rob Bradford [Fri, 9 Aug 2013 10:30:38 +0000 (11:30 +0100)]
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

10 years agoevdev: write EV_SYN input_event along with led events to device
Rolf Morel [Fri, 9 Aug 2013 14:32:17 +0000 (16:32 +0200)]
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.

10 years agonested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display
Kristian Høgsberg [Tue, 13 Aug 2013 05:21:19 +0000 (22:21 -0700)]
nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display

10 years agobuild: Allow more control over cairo use in the clients
Rob Bradford [Fri, 9 Aug 2013 15:52:46 +0000 (16:52 +0100)]
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.

10 years agoscreenshooter: Add missing newline and use program_invocation_short_name
Kristian Høgsberg [Tue, 13 Aug 2013 05:15:38 +0000 (22:15 -0700)]
screenshooter: Add missing newline and use program_invocation_short_name

10 years agoscreenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
Kristian Høgsberg [Tue, 13 Aug 2013 04:45:19 +0000 (21:45 -0700)]
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.

10 years agoInstall shared/zalloc.h
Giulio Camuffo [Sat, 10 Aug 2013 12:41:04 +0000 (14:41 +0200)]
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

10 years agofix compile error when EGL_BUFFER_AGE_EXT is missing
Adrian Negreanu [Mon, 12 Aug 2013 13:30:11 +0000 (16:30 +0300)]
fix compile error when EGL_BUFFER_AGE_EXT is missing

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
10 years agoremove dependency on EGL_KHR_surfaceless_context
Adrian Negreanu [Mon, 12 Aug 2013 07:07:59 +0000 (10:07 +0300)]
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>
10 years agoinput: For serial generation get the display from the compositor
Rob Bradford [Mon, 22 Jul 2013 16:31:38 +0000 (17:31 +0100)]
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.

10 years agodesktop-shell: Add touch support to panel launcher icons
Rusty Lynch [Fri, 9 Aug 2013 04:28:22 +0000 (21:28 -0700)]
desktop-shell: Add touch support to panel launcher icons

10 years agocalibrator: Add touch support to calibrator
Rusty Lynch [Fri, 9 Aug 2013 04:24:19 +0000 (21:24 -0700)]
calibrator: Add touch support to calibrator

10 years agosmoke: Add touch support to smoke example
Rusty Lynch [Fri, 9 Aug 2013 04:22:40 +0000 (21:22 -0700)]
smoke: Add touch support to smoke example

10 years agowindow.c: Add touch handlers
Rusty Lynch [Fri, 9 Aug 2013 04:20:38 +0000 (21:20 -0700)]
window.c: Add touch handlers

This adds basic infrastructure for handling touch events in the toytoolkit.

10 years agoinput: Store touch position and time when we start an implicit touch grab
Rusty Lynch [Fri, 9 Aug 2013 04:13:57 +0000 (21:13 -0700)]
input: Store touch position and time when we start an implicit touch grab

10 years agoevdev: Use touch ID 0 when generating touch up event
Rusty Lynch [Fri, 9 Aug 2013 04:08:17 +0000 (21:08 -0700)]
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.

10 years agocompositor: Setup weston-launch sock in fbdev
Adrian Negreanu [Sun, 28 Jul 2013 15:27:23 +0000 (18:27 +0300)]
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>
10 years agoconfigure.ac: check for wayland scanner macro
Peter Hutterer [Fri, 9 Aug 2013 01:08:27 +0000 (11:08 +1000)]
configure.ac: check for wayland scanner macro

10 years agoterminal.c: Check if fdopen() fails
Brian Lovin [Thu, 8 Aug 2013 23:12:55 +0000 (16:12 -0700)]
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>
10 years agoweston-launch: always drop privileges before execve
Peter Hutterer [Tue, 6 Aug 2013 02:10:09 +0000 (12:10 +1000)]
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.

10 years agoevdev: log when a device is used as touchpad
Peter Hutterer [Wed, 7 Aug 2013 01:04:49 +0000 (11:04 +1000)]
evdev: log when a device is used as touchpad

10 years agoevdev: call evdev_device_destroy on failure
Peter Hutterer [Wed, 7 Aug 2013 01:04:48 +0000 (11:04 +1000)]
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.

10 years agoevdev: plug a potential memleak
Peter Hutterer [Wed, 7 Aug 2013 01:04:47 +0000 (11:04 +1000)]
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.

10 years agoevdev: get the current slot value from the absinfo struct or mtdev
Peter Hutterer [Wed, 7 Aug 2013 01:04:46 +0000 (11:04 +1000)]
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.

10 years agoevdev: only use mtdev for Protocol A devices
Peter Hutterer [Wed, 7 Aug 2013 01:04:45 +0000 (11:04 +1000)]
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.

10 years agoevdev: add comment why we're ignoring key value 2
Peter Hutterer [Wed, 7 Aug 2013 01:04:42 +0000 (11:04 +1000)]
evdev: add comment why we're ignoring key value 2

10 years agoevdev: prevent unterminated device name
Peter Hutterer [Wed, 7 Aug 2013 01:04:41 +0000 (11:04 +1000)]
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.

10 years agoclients: fix an error message
Peter Hutterer [Thu, 8 Aug 2013 07:13:47 +0000 (17:13 +1000)]
clients: fix an error message

_GNU_SOURCE is always true as of c228e23b055f54d29f2df, so
program_invocation_short_name is available.

10 years agotty: fix typo in error message
Peter Hutterer [Thu, 8 Aug 2013 07:13:46 +0000 (17:13 +1000)]
tty: fix typo in error message

10 years agoevdev: check for ABS_MT_POSITION_X/Y to determine mt devices
Peter Hutterer [Thu, 8 Aug 2013 02:03:08 +0000 (12:03 +1000)]
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

10 years agomalloc + memset -> zalloc
Peter Hutterer [Thu, 8 Aug 2013 01:57:05 +0000 (11:57 +1000)]
malloc + memset -> zalloc

And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10 years agoAdd zalloc(size_t) allocator function
Peter Hutterer [Thu, 8 Aug 2013 01:57:04 +0000 (11:57 +1000)]
Add zalloc(size_t) allocator function

Same as calloc(1, len).

10 years agocms-colord: Don't redefine _GNU_SOURCE
Armin K [Wed, 7 Aug 2013 15:45:23 +0000 (17:45 +0200)]
cms-colord: Don't redefine _GNU_SOURCE

warning: "_GNU_SOURCE" redefined [enabled by default]

See commit c228e23b

10 years agoclients: use xmalloc in more places
Brian Lovin [Wed, 7 Aug 2013 22:34:59 +0000 (15:34 -0700)]
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>
10 years agogl-renderer: Only check for subimage when we have extension at compile time
Kristian Høgsberg [Wed, 7 Aug 2013 19:11:27 +0000 (12:11 -0700)]
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.

10 years agoAdd workaround for broken GL_EXT_unpack_subimage tokens
Kristian Høgsberg [Wed, 7 Aug 2013 19:05:08 +0000 (12:05 -0700)]
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.

10 years agogl-renderer.c: Cast wl_resource to void * to avoid warning
Kristian Høgsberg [Wed, 7 Aug 2013 18:59:54 +0000 (11:59 -0700)]
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 *.

10 years agogl-renderer: Test for GL_EXT_unpack_subimage not GL_UNPACK_ROW_LENGTH
Kristian Høgsberg [Wed, 7 Aug 2013 16:55:07 +0000 (09:55 -0700)]
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.

10 years agonested: Update to use weston-nested-client binary name
Kristian Høgsberg [Wed, 7 Aug 2013 16:50:12 +0000 (09:50 -0700)]
nested: Update to use weston-nested-client binary name