Pekka Paalanen | 3 Aug 2012 13:36
Picon

pull: evdev and android

Hi Kristian,

here is the reworked series for android evdev input[1]. I will reply to
this email with the patch series, and it can be found in the git
mentioned below.

The main idea is to move udev code from evdev.c into compositor-drm.c.
For that, the generic code in evdev.c is cleaned up from udev and
launcher-util references, and struct evdev_seat is removed. Instead,
there are structs drm_seat and android_seat in the backends.

Evdev input devices are now mentioned in the log, when they are
detected or removed. Miscellaneous patches include bug fixes, more
logging, and fixes for Android build. And of course the evdev support
in the Android backend.

The following changes since commit 0fb797596a03132bca590b2a6847251d136b9e57:

  compositor: Use uint32_t for the msecs value consistently (2012-08-02 11:06:44 -0400)

are available in the git repository at:
  git://git.collabora.co.uk/git/user/pq/wayland-demos.git for-krh

Pekka Paalanen (20):
      evdev: rename device_removed() to  evdev_input_device_destroy()
      evdev: move device opening out from evdev_input_device_create
      evdev: merge evdev-private.h into evdev.h
      evdev: change evdev_seat into weston_seat in struct evdev_input_device
      evdev: make evdev_led_update independent from struct evdev_seat
      evdev: make evdev_notify_keyboard_focus() independent of evdev_seat
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:38
Picon

[PATCH weston 01/20] evdev: rename device_removed() to evdev_input_device_destroy()

evdev_input_device_destroy() will completement the API of
evdev_input_device_create(), both being independent from udev.

Since the udev-specific device_removed() would only call
evdev_input_device_destroy() and do nothing else, device_remove() calls
are simply replaced with evdev_input_device_destroy().

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 6141bca..9b1a7e6 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -354,7 +354,7  <at>  <at>  evdev_input_device_data(int fd, uint32_t mask, void *data)
 			len = read(fd, &ev, sizeof ev);

 		if (len < 0 || len % sizeof ev[0] != 0) {
-			/* FIXME: call device_removed when errno is ENODEV. */
+			/* FIXME: call evdev_input_device_destroy when errno is ENODEV. */
 			return 1;
 		}

 <at>  <at>  -529,6 +529,24  <at>  <at>  err0:
 	return NULL;
 }

+static void
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:38
Picon

[PATCH weston 02/20] evdev: move device opening out from evdev_input_device_create

This makes the generic evdev code (i.e. the functions not relying on
udev) independent of launcher-util too. The aim is to allow re-using the
generic evdev code in the Android backend, where neither udev nor
launcher-util are available.

evdev_input_device_create() signature is changed:
- add the opened device file descriptor
- remove wl_display as unused

Also add a bit of failure logging.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 9b1a7e6..7e142a4 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -464,7 +464,7  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)

 static struct evdev_input_device *
 evdev_input_device_create(struct evdev_seat *master,
-			  struct wl_display *display, const char *path)
+			  const char *path, int device_fd)
 {
 	struct evdev_input_device *device;
 	struct weston_compositor *ec;
 <at>  <at>  -485,13 +485,7  <at>  <at>  evdev_input_device_create(struct evdev_seat *master,
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:38
Picon

[PATCH weston 03/20] evdev: merge evdev-private.h into evdev.h

Signed-off-by: Pekka Paalanen <ppaalanen <at> gmail.com>
---
 src/Makefile.am      |    1 -
 src/evdev-private.h  |  115 --------------------------------------------------
 src/evdev-touchpad.c |    2 +-
 src/evdev.c          |    1 -
 src/evdev.h          |   95 ++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 95 insertions(+), 119 deletions(-)
 delete mode 100644 src/evdev-private.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 03f610e..2cf9d6b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
 <at>  <at>  -102,7 +102,6  <at>  <at>  drm_backend_la_SOURCES =			\
 	tty.c					\
 	evdev.c					\
 	evdev.h					\
-	evdev-private.h				\
 	evdev-touchpad.c			\
 	launcher-util.c				\
 	launcher-util.h				\
diff --git a/src/evdev-private.h b/src/evdev-private.h
deleted file mode 100644
index 7b56b54..0000000
--- a/src/evdev-private.h
+++ /dev/null
 <at>  <at>  -1,115 +0,0  <at>  <at> 
-/*
- * Copyright © 2012 Intel Corporation
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 04/20] evdev: change evdev_seat into weston_seat in struct evdev_input_device

We are phasing out struct evdev_seat.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev-touchpad.c |    2 +-
 src/evdev.c          |   20 ++++++++++----------
 src/evdev.h          |    2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index 45c00cb..f613fb9 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
 <at>  <at>  -442,7 +442,7  <at>  <at>  process_key(struct touchpad_dispatch *touchpad,
 	case BTN_FORWARD:
 	case BTN_BACK:
 	case BTN_TASK:
-		notify_button(&device->master->base.seat,
+		notify_button(&device->seat->seat,
 			      time, e->code,
 			      e->value ? WL_POINTER_BUTTON_STATE_PRESSED :
 			                 WL_POINTER_BUTTON_STATE_RELEASED);
diff --git a/src/evdev.c b/src/evdev.c
index 08d2c99..3ea50e5 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -76,14 +76,14  <at>  <at>  evdev_process_key(struct evdev_input_device *device,
 	case BTN_FORWARD:
 	case BTN_BACK:
 	case BTN_TASK:
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 05/20] evdev: make evdev_led_update independent from struct evdev_seat

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 3ea50e5..bd14f14 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -32,7 +32,7  <at>  <at> 
 #include "launcher-util.h"

 static void
-evdev_led_update(struct weston_seat *seat_base, enum weston_led leds)
+evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)
 {
 	static const struct {
 		enum weston_led weston;
 <at>  <at>  -42,7 +42,6  <at>  <at>  evdev_led_update(struct weston_seat *seat_base, enum weston_led leds)
 		{ LED_CAPS_LOCK, LED_CAPSL },
 		{ LED_SCROLL_LOCK, LED_SCROLLL },
 	};
-	struct evdev_seat *seat = (struct evdev_seat *) seat_base;
 	struct evdev_input_device *device;
 	struct input_event ev[ARRAY_LENGTH(map)];
 	unsigned int i;
 <at>  <at>  -54,12 +53,20  <at>  <at>  evdev_led_update(struct weston_seat *seat_base, enum weston_led leds)
 		ev[i].value = !!(leds & map[i].weston);
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 07/20] evdev: pass weston_seat to evdev_input_device_create()

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 40f6080..7a46a5c 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -469,7 +469,7  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)
 }

 static struct evdev_input_device *
-evdev_input_device_create(struct evdev_seat *master,
+evdev_input_device_create(struct weston_seat *seat,
 			  const char *path, int device_fd)
 {
 	struct evdev_input_device *device;
 <at>  <at>  -478,12 +478,13  <at>  <at>  evdev_input_device_create(struct evdev_seat *master,
 	device = malloc(sizeof *device);
 	if (device == NULL)
 		return NULL;
+	memset(device, 0, sizeof *device);

-	ec = master->base.compositor;
+	ec = seat->compositor;
 	device->output =
 		container_of(ec->output_list.next, struct weston_output, link);
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 06/20] evdev: make evdev_notify_keyboard_focus() independent of evdev_seat

in preparation of removing evdev_seat

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index bd14f14..40f6080 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -583,7 +583,8  <at>  <at>  device_added(struct udev_device *udev_device, struct evdev_seat *master)
 }

 static void
-evdev_notify_keyboard_focus(struct evdev_seat *seat)
+evdev_notify_keyboard_focus(struct weston_seat *seat,
+			    struct wl_list *evdev_devices)
 {
 	struct evdev_input_device *device;
 	struct wl_array keys;
 <at>  <at>  -593,7 +594,7  <at>  <at>  evdev_notify_keyboard_focus(struct evdev_seat *seat)
 	int ret;

 	memset(all_keys, 0, sizeof all_keys);
-	wl_list_for_each(device, &seat->devices_list, link) {
+	wl_list_for_each(device, evdev_devices, link) {
 		memset(evdev_keys, 0, sizeof evdev_keys);
 		ret = ioctl(device->fd,
 			    EVIOCGKEY(sizeof evdev_keys), evdev_keys);
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 08/20] evdev: rename evdev_seat to drm_seat

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   18 +++++++++---------
 src/evdev.h |    2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 7a46a5c..896702d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -62,7 +62,7  <at>  <at>  evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)
 static void
 drm_led_update(struct weston_seat *seat_base, enum weston_led leds)
 {
-	struct evdev_seat *seat = (struct evdev_seat *) seat_base;
+	struct drm_seat *seat = (struct drm_seat *) seat_base;

 	evdev_led_update(&seat->devices_list, leds);
 }
 <at>  <at>  -547,7 +547,7  <at>  <at>  evdev_input_device_destroy(struct evdev_input_device *device)
 static const char default_seat[] = "seat0";

 static void
-device_added(struct udev_device *udev_device, struct evdev_seat *master)
+device_added(struct udev_device *udev_device, struct drm_seat *master)
 {
 	struct weston_compositor *c;
 	struct evdev_input_device *device;
 <at>  <at>  -626,7 +626,7  <at>  <at>  evdev_notify_keyboard_focus(struct weston_seat *seat,
 void
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 09/20] evdev: expose the generic evdev API

This API does not depend on udev or launcher-util.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |    8 ++++----
 src/evdev.h |   14 ++++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 896702d..92ac934 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -31,7 +31,7  <at>  <at> 
 #include "evdev.h"
 #include "launcher-util.h"

-static void
+void
 evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)
 {
 	static const struct {
 <at>  <at>  -468,7 +468,7  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)
 	return 0;
 }

-static struct evdev_input_device *
+struct evdev_input_device *
 evdev_input_device_create(struct weston_seat *seat,
 			  const char *path, int device_fd)
 {
(Continue reading)

Kristian Høgsberg | 3 Aug 2012 19:22
Picon
Gravatar

Re: [PATCH weston 09/20] evdev: expose the generic evdev API

On Fri, Aug 03, 2012 at 02:39:05PM +0300, Pekka Paalanen wrote:
> This API does not depend on udev or launcher-util.
> 
> Signed-off-by: Pekka Paalanen <ppaalanen@...>
> ---
>  src/evdev.c |    8 ++++----
>  src/evdev.h |   14 ++++++++++++++
>  2 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index 896702d..92ac934 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
>  <at>  <at>  -31,7 +31,7  <at>  <at> 
>  #include "evdev.h"
>  #include "launcher-util.h"
>  
> -static void
> +void
>  evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)
>  {
>  	static const struct {
>  <at>  <at>  -468,7 +468,7  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)
>  	return 0;
>  }
>  
> -static struct evdev_input_device *
> +struct evdev_input_device *
>  evdev_input_device_create(struct weston_seat *seat,
>  			  const char *path, int device_fd)
(Continue reading)

Pekka Paalanen | 6 Aug 2012 13:16
Picon

Re: [PATCH weston 09/20] evdev: expose the generic evdev API

On Fri, 3 Aug 2012 13:22:37 -0400
Kristian Høgsberg <hoegsberg@...> wrote:

> On Fri, Aug 03, 2012 at 02:39:05PM +0300, Pekka Paalanen wrote:
> > This API does not depend on udev or launcher-util.
...
> > diff --git a/src/evdev.h b/src/evdev.h
> > index 2455770..66773e7 100644
> > --- a/src/evdev.h
> > +++ b/src/evdev.h
> >  <at>  <at>  -132,4 +132,18  <at>  <at>  evdev_enable_udev_monitor(struct udev *udev, struct weston_seat *seat_base);
> >  void
> >  evdev_disable_udev_monitor(struct weston_seat *seat_base);
> >  
> > +void
> > +evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds);
> > +
> > +struct evdev_input_device *
> > +evdev_input_device_create(struct weston_seat *seat,
> > +			  const char *path, int device_fd);
> > +
> > +void
> > +evdev_input_device_destroy(struct evdev_input_device *device);
> > +
> > +void
> > +evdev_notify_keyboard_focus(struct weston_seat *seat,
> > +			    struct wl_list *evdev_devices);
> > +
> 
> I'm committing this as-is, but I think the API is a little odd here with the wl_list arg.  It may be cleaner to
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 10/20] evdev: move udev code into compositor-drm.c

Move all udev-related and now drm backend specific code into
compositor-drm.c.

This makes evdev.c free of udev and launcher-util, and allows it to be
used on Android.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor-drm.c |  238 +++++++++++++++++++++++++++++++++++++++++++++++++-
 src/evdev.c          |  228 -----------------------------------------------
 src/evdev.h          |   28 ------
 3 files changed, 236 insertions(+), 258 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 8616527..efbc6eb 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
 <at>  <at>  -37,6 +37,7  <at>  <at> 

 #include <gbm.h>
 #include <libbacklight.h>
+#include <libudev.h>

 #include "compositor.h"
 #include "evdev.h"
 <at>  <at>  -166,6 +167,14  <at>  <at>  struct drm_sprite {
 	uint32_t formats[];
 };

+struct drm_seat {
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 11/20] evdev: log input devices

Write information about found input devices into the log. Also fetch and
record the device name.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |   27 +++++++++++++++++++++++----
 src/evdev.h |    1 +
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 8f57c42..7efbc7d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -445,16 +445,29  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)
 	/* This rule tries to catch accelerometer devices and opt out. We may
 	 * want to adjust the protocol later adding a proper event for dealing
 	 * with accelerometers and implement here accordingly */
-	if (has_abs && !has_key && !device->is_mt)
+	if (has_abs && !has_key && !device->is_mt) {
+		weston_log("input device %s, %s "
+			   "ignored: unsupported device type\n",
+			   device->devname, device->devnode);
 		return -1;
+	}

 	if ((device->caps &
-	     (EVDEV_MOTION_ABS | EVDEV_MOTION_REL | EVDEV_BUTTON)))
+	     (EVDEV_MOTION_ABS | EVDEV_MOTION_REL | EVDEV_BUTTON))) {
 		weston_seat_init_pointer(device->seat);
-	if ((device->caps & EVDEV_KEYBOARD))
(Continue reading)

Kristian Høgsberg | 3 Aug 2012 19:23
Picon
Gravatar

Re: [PATCH weston 11/20] evdev: log input devices

On Fri, Aug 03, 2012 at 02:39:07PM +0300, Pekka Paalanen wrote:
> Write information about found input devices into the log. Also fetch and
> record the device name.

Thats pretty useful.

Kristian

> Signed-off-by: Pekka Paalanen <ppaalanen@...>
> ---
>  src/evdev.c |   27 +++++++++++++++++++++++----
>  src/evdev.h |    1 +
>  2 files changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index 8f57c42..7efbc7d 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
>  <at>  <at>  -445,16 +445,29  <at>  <at>  evdev_configure_device(struct evdev_input_device *device)
>  	/* This rule tries to catch accelerometer devices and opt out. We may
>  	 * want to adjust the protocol later adding a proper event for dealing
>  	 * with accelerometers and implement here accordingly */
> -	if (has_abs && !has_key && !device->is_mt)
> +	if (has_abs && !has_key && !device->is_mt) {
> +		weston_log("input device %s, %s "
> +			   "ignored: unsupported device type\n",
> +			   device->devname, device->devnode);
>  		return -1;
> +	}
>  
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 12/20] compositor-drm: fix leak in evdev_udev_handler()

If the sysname of the udev device did not start with "event", the
function returned without unreferencing udev_device.

The function is refactored to have a common exit path that unrefs
udev_device. The return value semantics are not changed.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor-drm.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index efbc6eb..7888ce1 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
 <at>  <at>  -1868,34 +1868,36  <at>  <at>  evdev_add_devices(struct udev *udev, struct weston_seat *seat_base)
 static int
 evdev_udev_handler(int fd, uint32_t mask, void *data)
 {
-	struct drm_seat *master = data;
+	struct drm_seat *seat = data;
 	struct udev_device *udev_device;
 	struct evdev_input_device *device, *next;
 	const char *action;
 	const char *devnode;

-	udev_device = udev_monitor_receive_device(master->udev_monitor);
+	udev_device = udev_monitor_receive_device(seat->udev_monitor);
 	if (!udev_device)
 		return 1;
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 13/20] compositor-drm: log input device hot-unplugs

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor-drm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 7888ce1..dcb3a14 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
 <at>  <at>  -1892,6 +1892,8  <at>  <at>  evdev_udev_handler(int fd, uint32_t mask, void *data)
 		devnode = udev_device_get_devnode(udev_device);
 		wl_list_for_each_safe(device, next, &seat->devices_list, link)
 			if (!strcmp(device->devnode, devnode)) {
+				weston_log("input device %s, %s removed\n",
+					   device->devname, device->devnode);
 				evdev_input_device_destroy(device);
 				break;
 			}
--

-- 
1.7.8.6
Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 14/20] compositor-drm: log enter/leave VT

All input devices are re-added during enter VT, so these messages in the
log will clarify what happened with input.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor-drm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index dcb3a14..cc0a11a 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
 <at>  <at>  -2087,6 +2087,7  <at>  <at>  vt_func(struct weston_compositor *compositor, int event)

 	switch (event) {
 	case TTY_ENTER_VT:
+		weston_log("entering VT\n");
 		compositor->focus = 1;
 		if (weston_launcher_drm_set_master(&ec->base, ec->drm.fd, 1)) {
 			weston_log("failed to set master: %m\n");
 <at>  <at>  -2101,6 +2102,7  <at>  <at>  vt_func(struct weston_compositor *compositor, int event)
 		}
 		break;
 	case TTY_LEAVE_VT:
+		weston_log("leaving VT\n");
 		wl_list_for_each(seat, &compositor->seat_list, link) {
 			evdev_disable_udev_monitor(seat);
 			evdev_remove_devices(seat);
--

-- 
1.7.8.6
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 15/20] compositor-drm, evdev: don't crash on missing keyboard

Weston's notify_keyboard_focus_*() assume that a keyboard is present, if
they are called. With evdev, there might not always be a keyboard.

Also clean up the variable definition in evdev_notify_keyborad_focus().
I read that function through many times and finally had to grep where
does 'all_keys' come from.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor-drm.c |    3 ++-
 src/evdev.c          |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index cc0a11a..275e117 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
 <at>  <at>  -1999,7 +1999,8  <at>  <at>  evdev_remove_devices(struct weston_seat *seat_base)
 	wl_list_for_each_safe(device, next, &seat->devices_list, link)
 		evdev_input_device_destroy(device);

-	notify_keyboard_focus_out(&seat->base.seat);
+	if (seat->base.seat.keyboard)
+		notify_keyboard_focus_out(&seat->base.seat);
 }

 static void
diff --git a/src/evdev.c b/src/evdev.c
index 7efbc7d..09275f4 100644
--- a/src/evdev.c
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 16/20] compositor: log program launches

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/compositor.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 2d03a14..1a0764c 100644
--- a/src/compositor.c
+++ b/src/compositor.c
 <at>  <at>  -140,6 +140,8  <at>  <at>  weston_client_launch(struct weston_compositor *compositor,
 	pid_t pid;
 	struct wl_client *client;

+	weston_log("launching '%s'\n", path);
+
 	if (os_socketpair_cloexec(AF_UNIX, SOCK_STREAM, 0, sv) < 0) {
 		weston_log("weston_client_launch: "
 			"socketpair failed while launching '%s': %m\n",
--

-- 
1.7.8.6
Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 17/20] android: add basic evdev input support

Android backend needs mtdev now, and evdev-touchpad.c, too.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 configure.ac             |    1 +
 src/Makefile.am          |   16 +++++--
 src/compositor-android.c |  105 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 117 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index e67ad50..754469f 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -115,6 +115,7  <at>  <at>  AC_ARG_ENABLE(android-compositor,
 AM_CONDITIONAL(ENABLE_ANDROID_COMPOSITOR, test x$enable_android_compositor = xyes)
 if test x$enable_android_compositor = xyes; then
   AC_DEFINE([BUILD_ANDROID_COMPOSITOR], [1], [Build the compositor for Android 4.0])
+  PKG_CHECK_MODULES(ANDROID_COMPOSITOR, [mtdev >= 1.1.0])
 fi

 
diff --git a/src/Makefile.am b/src/Makefile.am
index 2cf9d6b..8096849 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
 <at>  <at>  -124,12 +124,18  <at>  <at>  endif
 if ENABLE_ANDROID_COMPOSITOR
 android_backend = android-backend.la
 android_backend_la_LDFLAGS = -module -avoid-version
-android_backend_la_LIBADD = $(COMPOSITOR_LIBS)
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 18/20] evdev: kill a warning in evdev_led_update()

evdev.c: In function 'evdev_led_update':
evdev.c:57:9: warning: ignoring return value of 'write', declared with
attribute warn_unused_result

Useless in this case.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 src/evdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 09275f4..7d93564 100644
--- a/src/evdev.c
+++ b/src/evdev.c
 <at>  <at>  -54,7 +54,8  <at>  <at>  evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)

 	wl_list_for_each(device, evdev_devices, link) {
 		if (device->caps & EVDEV_KEYBOARD)
-			write(device->fd, ev, sizeof ev);
+			i = write(device->fd, ev, sizeof ev);
+		(void)i; /* no, we really don't care about the return value */
 	}
 }

--

-- 
1.7.8.6
Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 19/20] desktop-shell: use the standard 'environ' variable

The variable '__environ' seems to be libc implementation specific, and
not avaible on Android.

Use the POSIX standard variable 'environ', which also luckily happens to
be available on Android, which is not POSIX.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 clients/desktop-shell.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 082a30a..97b2066 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
 <at>  <at>  -44,6 +44,8  <at>  <at> 

 #include "desktop-shell-client-protocol.h"

+extern char **environ; /* defined by libc */
+
 struct desktop {
 	struct display *display;
 	struct desktop_shell *shell;
 <at>  <at>  -484,9 +486,9  <at>  <at>  panel_add_launcher(struct panel *panel, const char *icon, const char *path)

 	wl_array_init(&launcher->envp);
 	wl_array_init(&launcher->argv);
-	for (i = 0; __environ[i]; i++) {
+	for (i = 0; environ[i]; i++) {
(Continue reading)

Pekka Paalanen | 3 Aug 2012 13:39
Picon

[PATCH weston 20/20] configure: make setbacklight optional

Modify the pkg-config check for setbacklight so that failure only
disables building setbacklight, instead of failing the whole configure.

Signed-off-by: Pekka Paalanen <ppaalanen@...>
---
 configure.ac      |    3 ++-
 tests/Makefile.am |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 754469f..f8a1b6a 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -216,7 +216,8  <at>  <at>  fi
 AC_CHECK_PROG(RSVG_CONVERT, rsvg-convert, rsvg-convert)
 AM_CONDITIONAL(HAVE_RSVG_CONVERT, test -n "$RSVG_CONVERT")

-PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm])
+PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no)
+AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes")

 if test "x$GCC" = "xyes"; then
 	my_common_gcc_flags="-Wall -Wextra -Wno-unused-parameter \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1f5514f..80f6db8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
 <at>  <at>  -22,7 +22,7  <at>  <at>  event_test_la_SOURCES = event-test.c $(test_runner_src)
 test_client_SOURCES = test-client.c
 test_client_LDADD = $(SIMPLE_CLIENT_LIBS)
(Continue reading)


Gmane