Re: [PATCH libinput] touchpad: reduce middle button size on Dell touchpads to 10mm

2016-07-12 Thread Yong Bakos
On Jul 12, 2016, at 4:51 PM, Peter Hutterer  wrote:
> 
> All Dell touchpas appear to have a visual marker on their touchpads. With a
> visible marker our middle button can (and should) be much smaller since we
> can rely on users to hit the button precisely.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=96710
> 
> Signed-off-by: Peter Hutterer 
> Tested-by: Andy Lutomirski 

This patch just adds the necessary evdev model and flag values; and the
logic for specifying the size of the Dell middle touchpad button. Makes
sense and is

Reviewed-by: Yong Bakos 

yong


Reviewed-by: Yong Bakos 

> ---
> src/evdev-mt-touchpad-buttons.c| 24 +---
> src/evdev.c|  1 +
> src/evdev.h|  1 +
> udev/90-libinput-model-quirks.hwdb |  7 +++
> 4 files changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
> index a2f3121..cf49c83 100644
> --- a/src/evdev-mt-touchpad-buttons.c
> +++ b/src/evdev-mt-touchpad-buttons.c
> @@ -544,13 +544,15 @@ tp_init_softbuttons(struct tp_dispatch *tp,
>   int width, height;
>   const struct input_absinfo *absinfo_x, *absinfo_y;
>   int xoffset, yoffset;
> - int yres;
> + int xres, yres;
> + int mb_le, mb_re; /* middle button left/right edge */
> 
>   absinfo_x = device->abs.absinfo_x;
>   absinfo_y = device->abs.absinfo_y;
> 
>   xoffset = absinfo_x->minimum,
>   yoffset = absinfo_y->minimum,
> + xres = absinfo_x->resolution;
>   yres = absinfo_y->resolution;
>   width = device->abs.dimensions.x;
>   height = device->abs.dimensions.y;
> @@ -575,9 +577,25 @@ tp_init_softbuttons(struct tp_dispatch *tp,
>* touchpads don't have markings for the middle button at all so we
>* need to make it big enough to reliably hit it but not too big so
>* it takes away all the space.
> +  *
> +  * On touchpads with visible markings we reduce the size of the
> +  * middle button since users have a visual guide.
> +  *
> +  * All Dell touchpads appear to have a middle marker.
>*/
> - tp->buttons.bottom_area.middlebutton_left_edge = width * 0.375 + 
> xoffset;
> - tp->buttons.bottom_area.rightbutton_left_edge = width * 0.625 + xoffset;
> + if (tp->device->model_flags & EVDEV_MODEL_DELL_TOUCHPAD) {
> + const int MIDDLE_BUTTON_WIDTH = 10; /* mm */
> + int half_width = MIDDLE_BUTTON_WIDTH/2 * xres; /* units */
> +
> + mb_le = xoffset + width/2 - half_width;
> + mb_re = xoffset + width/2 + half_width;
> + } else {
> + mb_le = xoffset + width * 0.375;
> + mb_re = xoffset + width * 0.625;
> + }
> +
> + tp->buttons.bottom_area.middlebutton_left_edge = mb_le;
> + tp->buttons.bottom_area.rightbutton_left_edge = mb_re;
> }
> 
> void
> diff --git a/src/evdev.c b/src/evdev.c
> index fdbaba1..6d231db 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1804,6 +1804,7 @@ evdev_read_model_flags(struct evdev_device *device)
>   MODEL(CYBORG_RAT),
>   MODEL(CYAPA),
>   MODEL(LENOVO_T450_TOUCHPAD),
> + MODEL(DELL_TOUCHPAD),
>   MODEL(TRACKBALL),
>   MODEL(APPLE_MAGICMOUSE),
>   { NULL, EVDEV_MODEL_DEFAULT },
> diff --git a/src/evdev.h b/src/evdev.h
> index 939a0b8..a3e76c5 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -115,6 +115,7 @@ enum evdev_device_model {
>   EVDEV_MODEL_CYBORG_RAT = (1 << 14),
>   EVDEV_MODEL_CYAPA = (1 << 15),
>   EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
> + EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
>   EVDEV_MODEL_TRACKBALL = (1 << 19),
>   EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
> };
> diff --git a/udev/90-libinput-model-quirks.hwdb 
> b/udev/90-libinput-model-quirks.hwdb
> index 5e5ea9a..ebce8d2 100644
> --- a/udev/90-libinput-model-quirks.hwdb
> +++ b/udev/90-libinput-model-quirks.hwdb
> @@ -48,6 +48,13 @@ libinput:mouse:input:b0003v06A3p0CD5*
>  LIBINPUT_MODEL_CYBORG_RAT=1
> 
> ##
> +# Dell
> +##
> +libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:*
> +libinput:name:* Touchpad:dmi:*svnDellInc.:*
> + LIBINPUT_MODEL_DELL_TOUCHPAD=1
> +
> +##
> # Elantech
> ##
> libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
> -- 
> 2.7.4
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 0/3] Standardize error checking for strtol calls

2016-07-12 Thread Bryce Harrington
Make error handling of most strtol calls consistent with each other.

The first patch fixes various cases that are straightforward refactors.
The second and third patch cover cases where some idiosyncracies need
highlighted in the commit messages.  All three patches can be squashed
if desired.

Note that intentional omissions are the strtol() calls in the terminal.c
and multi-resource.c clients, because those usages make use of
strtol()'s return of the unparsed portion of the string.  Those could
also use improvement of error handling but will be different enough to
need special attention.

Bryce Harrington (3):
  Standardize error checking for strtol calls
  xwayland: Improve error checking for strtol call
  option-parser: Improve error checking for strtol call

 compositor/main.c   |  3 ++-
 compositor/systemd-notify.c |  2 +-
 libweston/compositor.c  |  3 ++-
 libweston/libbacklight.c| 10 +-
 shared/option-parser.c  | 11 +--
 xwayland/launcher.c |  3 ++-
 6 files changed, 25 insertions(+), 7 deletions(-)

-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 3/3] option-parser: Improve error checking for strtol call

2016-07-12 Thread Bryce Harrington
Make the error checking consistent with other strtol() calls.

Note that since strtol(nptr, &endptr) sets endptr == nptr if there were
no digits, this catches the case where the string was blank, so there's
no need to test *value != '\0'.

Signed-off-by: Bryce Harrington 
---
 shared/option-parser.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/shared/option-parser.c b/shared/option-parser.c
index 33355b8..fb4a342 100644
--- a/shared/option-parser.c
+++ b/shared/option-parser.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "config-parser.h"
 
@@ -40,11 +41,17 @@ handle_option(const struct weston_option *option, char 
*value)
 
switch (option->type) {
case WESTON_OPTION_INTEGER:
+   errno = 0;
* (int32_t *) option->data = strtol(value, &p, 10);
-   return *value && !*p;
+   if (errno != 0 || p == value || *p != '\0')
+   return 0;
+   return 1;
case WESTON_OPTION_UNSIGNED_INTEGER:
+   errno = 0;
* (uint32_t *) option->data = strtoul(value, &p, 10);
-   return *value && !*p;
+   if (errno != 0 || p == value || *p != '\0')
+   return 0;
+   return 1;
case WESTON_OPTION_STRING:
* (char **) option->data = strdup(value);
return 1;
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 2/3] xwayland: Improve error checking for strtol call

2016-07-12 Thread Bryce Harrington
This updates the error checking for the strtol() call in xwayland's
create_lockfile to match other cases.  C.f. cbc05378 and other recent
patches.

A notable difference here is that the existing error checking was
verifying that exactly 10 digits were being read from the lock file,
but the fact that it's 10 digits is just an implementation detail for
how we're writing it.  The pid could be a shorter number of digits, and
would just be space-padded on the left.

This change allows the file to contain any number of digits, but it
can't be blank, all of the digits must be numeric, and the resulting
number must be within the accepted range.

Signed-off-by: Bryce Harrington 
---
 xwayland/launcher.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xwayland/launcher.c b/xwayland/launcher.c
index b7aee3b..5b81fef 100644
--- a/xwayland/launcher.c
+++ b/xwayland/launcher.c
@@ -164,8 +164,9 @@ create_lockfile(int display, char *lockfile, size_t lsize)
return -1;
}
 
+   errno = 0;
other = strtol(pid, &end, 10);
-   if (end != pid + 10) {
+   if (errno != 0 || end == pid || *end != '\0') {
weston_log("can't parse lock file %s\n",
lockfile);
close(fd);
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 1/3] Standardize error checking for strtol calls

2016-07-12 Thread Bryce Harrington
This tightens up the strtol() error checking in several places where it
is used for parsing environment variables, and in the backlight
interface that is reading numbers from files under /sys/class/backlight.
All of these uses are expecting strings containing decimal numbers and
nothing else, so the error checking can all be tightened up and made
consistent with other strtol() calls.

This follows the error checking style used in Wayland
(c.f. wayland-client.c and scanner.c) and c.f. commit cbc05378.

Signed-off-by: Bryce Harrington 
---
 compositor/main.c   |  3 ++-
 compositor/systemd-notify.c |  2 +-
 libweston/compositor.c  |  3 ++-
 libweston/libbacklight.c| 10 +-
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index 1f75ae0..27be973 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1684,8 +1684,9 @@ int main(int argc, char *argv[])
server_socket = getenv("WAYLAND_SERVER_SOCKET");
if (server_socket) {
weston_log("Running with single client\n");
+   errno = 0;
fd = strtol(server_socket, &end, 10);
-   if (*end != '\0')
+   if (errno != 0 || end == server_socket || *end != '\0')
fd = -1;
} else {
fd = -1;
diff --git a/compositor/systemd-notify.c b/compositor/systemd-notify.c
index 9fbd5ee..6104124 100644
--- a/compositor/systemd-notify.c
+++ b/compositor/systemd-notify.c
@@ -146,7 +146,7 @@ module_init(struct weston_compositor *compositor,
 
errno = 0;
watchdog_time_conv = strtol(watchdog_time_env, &tail, 10);
-   if ((errno != 0) || (*tail != '\0'))
+   if (errno != 0 || tail == watchdog_time_env || *tail != '\0')
return 0;
 
/* Convert 'WATCHDOG_USEC' to milliseconds and notify
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 96eeb17..67f334c 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -4617,8 +4617,9 @@ weston_environment_get_fd(const char *env)
e = getenv(env);
if (!e)
return -1;
+   errno = 0;
fd = strtol(e, &end, 10);
-   if (*end != '\0')
+   if (errno != 0 || end == e || *end != '\0')
return -1;
 
flags = fcntl(fd, F_GETFD);
diff --git a/libweston/libbacklight.c b/libweston/libbacklight.c
index 722d66f..f1205e8 100644
--- a/libweston/libbacklight.c
+++ b/libweston/libbacklight.c
@@ -47,6 +47,7 @@ static long backlight_get(struct backlight *backlight, char 
*node)
 {
char buffer[100];
char *path;
+   char *end;
int fd;
long value, ret;
 
@@ -64,8 +65,15 @@ static long backlight_get(struct backlight *backlight, char 
*node)
goto out;
}
 
-   value = strtol(buffer, NULL, 10);
+   errno = 0;
+   value = strtol(buffer, &end, 10);
+   if (errno != 0 || end == buffer || *end != '\0') {
+   ret = -1;
+   goto out;
+   }
+
ret = value;
+
 out:
if (fd >= 0)
close(fd);
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Peter Hutterer
On Tue, Jul 12, 2016 at 06:54:49PM -0700, Bryce Harrington wrote:
> On Wed, Jul 13, 2016 at 10:27:49AM +1000, Peter Hutterer wrote:
> > On Tue, Jul 12, 2016 at 04:51:27PM -0700, Bryce Harrington wrote:
> > > The third arg to strtol() specifies the base to assume for the number.
> > > When 0 is passed, as is currently done in option-parser.c, hexadecimal
> > > and octal numbers are permitted and automatically detected and
> > > converted.
> > > 
> > > This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
> > > to cover the remaining strtol() calls in Weston, where the routine is
> > > being used to read fds and pids - which are always expressed in base-10.
> > > It also changes the calls in config-parser, used by
> > > weston_config_section_get_int(), which in turn is being used to read
> > > scales, sizes, times, rates, and delays; these are all expressed in
> > > base-10 numbers only.
> > > 
> > > The benefit of limiting this to base-10 is to eliminate surprises when
> > > parsing numbers from the command line.  Also, by making the code
> > > consistent with other usages of strtol, it may make it possible to
> > > factor out the common code in the future.
> > > 
> > > Signed-off-by: Bryce Harrington 
> > 
> > code looks correct, but I didn't check all the callers, I'll just take
> > your word for the base-10 assumption :)
> > Reviewed-by: Peter Hutterer 
> 
> Thanks, both patches pushed:
>6351fb0..375759e  master -> master
> 
> For the strtol() calls the callers are pretty straightforward so this
> change should be just fine.
> 
> Where things get a bit tricker is the strtoul() call in
> weston_config_section_get_uint() which I'd also like to switch to
> base-10, however some of its callers are parsing colors - which are hex
> numbers and thus switching to base-10 would break those.  I haven't
> sorted out what to do there.  I could introduce a new routine like
> weston_config_section_get_hex() or even
> weston_config_section_get_color() to handle that case, thus allowing
> weston_config_section_get_uint() to be forced base-10; or I could just
> leave it as-is and let it autodetect decimal or hexadecimal as needed.
> Any opinions?

IMO anything that's explicitly only parsing hex should be a separate
function if for no other reason than obviousness in the caller.

Cheers,
   Peter

> > > ---
> > >  compositor/main.c  | 2 +-
> > >  libweston/compositor.c | 2 +-
> > >  shared/config-parser.c | 2 +-
> > >  xwayland/launcher.c| 2 +-
> > >  4 files changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/compositor/main.c b/compositor/main.c
> > > index 6cf9194..8400d70 100644
> > > --- a/compositor/main.c
> > > +++ b/compositor/main.c
> > > @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
> > >   server_socket = getenv("WAYLAND_SERVER_SOCKET");
> > >   if (server_socket) {
> > >   weston_log("Running with single client\n");
> > > - fd = strtol(server_socket, &end, 0);
> > > + fd = strtol(server_socket, &end, 10);
> > >   if (*end != '\0')
> > >   fd = -1;
> > >   } else {
> > > diff --git a/libweston/compositor.c b/libweston/compositor.c
> > > index 771f1c9..96eeb17 100644
> > > --- a/libweston/compositor.c
> > > +++ b/libweston/compositor.c
> > > @@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
> > >   e = getenv(env);
> > >   if (!e)
> > >   return -1;
> > > - fd = strtol(e, &end, 0);
> > > + fd = strtol(e, &end, 10);
> > >   if (*end != '\0')
> > >   return -1;
> > >  
> > > diff --git a/shared/config-parser.c b/shared/config-parser.c
> > > index 247e880..4c67220 100644
> > > --- a/shared/config-parser.c
> > > +++ b/shared/config-parser.c
> > > @@ -170,7 +170,7 @@ weston_config_section_get_int(struct 
> > > weston_config_section *section,
> > >   }
> > >  
> > >   errno = 0;
> > > - *value = strtol(entry->value, &end, 0);
> > > + *value = strtol(entry->value, &end, 10);
> > >   if (errno != 0 || end == entry->value || *end != '\0') {
> > >   *value = default_value;
> > >   errno = EINVAL;
> > > diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> > > index 614ef5b..b7aee3b 100644
> > > --- a/xwayland/launcher.c
> > > +++ b/xwayland/launcher.c
> > > @@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t 
> > > lsize)
> > >   return -1;
> > >   }
> > >  
> > > - other = strtol(pid, &end, 0);
> > > + other = strtol(pid, &end, 10);
> > >   if (end != pid + 10) {
> > >   weston_log("can't parse lock file %s\n",
> > >   lockfile);
> > > -- 
> > > 1.9.1
> > > 
> > > ___
> > > wayland-devel mailing list
> > > wayland-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> > > 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org

Re: [PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Yong Bakos
On Jul 12, 2016, at 4:51 PM, Bryce Harrington  wrote:
> 
> The third arg to strtol() specifies the base to assume for the number.
> When 0 is passed, as is currently done in option-parser.c, hexadecimal
> and octal numbers are permitted and automatically detected and
> converted.
> 
> This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
> to cover the remaining strtol() calls in Weston, where the routine is
> being used to read fds and pids - which are always expressed in base-10.

I believe you missed two calls, see:

config-parser.c: weston_config_section_get_uint
systemd-notify.c: module_init

yong


> It also changes the calls in config-parser, used by
> weston_config_section_get_int(), which in turn is being used to read
> scales, sizes, times, rates, and delays; these are all expressed in
> base-10 numbers only.
> 
> The benefit of limiting this to base-10 is to eliminate surprises when
> parsing numbers from the command line.  Also, by making the code
> consistent with other usages of strtol, it may make it possible to
> factor out the common code in the future.
> 
> Signed-off-by: Bryce Harrington 
> ---
> compositor/main.c  | 2 +-
> libweston/compositor.c | 2 +-
> shared/config-parser.c | 2 +-
> xwayland/launcher.c| 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/compositor/main.c b/compositor/main.c
> index 6cf9194..8400d70 100644
> --- a/compositor/main.c
> +++ b/compositor/main.c
> @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
>   server_socket = getenv("WAYLAND_SERVER_SOCKET");
>   if (server_socket) {
>   weston_log("Running with single client\n");
> - fd = strtol(server_socket, &end, 0);
> + fd = strtol(server_socket, &end, 10);
>   if (*end != '\0')
>   fd = -1;
>   } else {
> diff --git a/libweston/compositor.c b/libweston/compositor.c
> index 771f1c9..96eeb17 100644
> --- a/libweston/compositor.c
> +++ b/libweston/compositor.c
> @@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
>   e = getenv(env);
>   if (!e)
>   return -1;
> - fd = strtol(e, &end, 0);
> + fd = strtol(e, &end, 10);
>   if (*end != '\0')
>   return -1;
> 
> diff --git a/shared/config-parser.c b/shared/config-parser.c
> index 247e880..4c67220 100644
> --- a/shared/config-parser.c
> +++ b/shared/config-parser.c
> @@ -170,7 +170,7 @@ weston_config_section_get_int(struct 
> weston_config_section *section,
>   }
> 
>   errno = 0;
> - *value = strtol(entry->value, &end, 0);
> + *value = strtol(entry->value, &end, 10);
>   if (errno != 0 || end == entry->value || *end != '\0') {
>   *value = default_value;
>   errno = EINVAL;
> diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> index 614ef5b..b7aee3b 100644
> --- a/xwayland/launcher.c
> +++ b/xwayland/launcher.c
> @@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t lsize)
>   return -1;
>   }
> 
> - other = strtol(pid, &end, 0);
> + other = strtol(pid, &end, 10);
>   if (end != pid + 10) {
>   weston_log("can't parse lock file %s\n",
>   lockfile);
> -- 
> 1.9.1
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Bryce Harrington
On Tue, Jul 12, 2016 at 06:49:06PM -0700, Yong Bakos wrote:
> On Jul 12, 2016, at 4:51 PM, Bryce Harrington  wrote:
> > 
> > The third arg to strtol() specifies the base to assume for the number.
> > When 0 is passed, as is currently done in option-parser.c, hexadecimal
> > and octal numbers are permitted and automatically detected and
> > converted.
> > 
> > This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
> > to cover the remaining strtol() calls in Weston, where the routine is
> > being used to read fds and pids - which are always expressed in base-10.
> 
> I believe you missed two calls, see:
> 
> config-parser.c: weston_config_section_get_uint
> systemd-notify.c: module_init

Thanks for checking and catching.  I intentionally skipped changing
weston_config_section_get_uint() since is used to parse some color
values which are expressed as hexadecimal so forcing base-10 would break
those.  See my email to Peter.

But you're right that the strtol call in system-notify.c needs this fix
too.

Bryce


> > It also changes the calls in config-parser, used by
> > weston_config_section_get_int(), which in turn is being used to read
> > scales, sizes, times, rates, and delays; these are all expressed in
> > base-10 numbers only.
> > 
> > The benefit of limiting this to base-10 is to eliminate surprises when
> > parsing numbers from the command line.  Also, by making the code
> > consistent with other usages of strtol, it may make it possible to
> > factor out the common code in the future.
> > 
> > Signed-off-by: Bryce Harrington 
> > ---
> > compositor/main.c  | 2 +-
> > libweston/compositor.c | 2 +-
> > shared/config-parser.c | 2 +-
> > xwayland/launcher.c| 2 +-
> > 4 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/compositor/main.c b/compositor/main.c
> > index 6cf9194..8400d70 100644
> > --- a/compositor/main.c
> > +++ b/compositor/main.c
> > @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
> > server_socket = getenv("WAYLAND_SERVER_SOCKET");
> > if (server_socket) {
> > weston_log("Running with single client\n");
> > -   fd = strtol(server_socket, &end, 0);
> > +   fd = strtol(server_socket, &end, 10);
> > if (*end != '\0')
> > fd = -1;
> > } else {
> > diff --git a/libweston/compositor.c b/libweston/compositor.c
> > index 771f1c9..96eeb17 100644
> > --- a/libweston/compositor.c
> > +++ b/libweston/compositor.c
> > @@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
> > e = getenv(env);
> > if (!e)
> > return -1;
> > -   fd = strtol(e, &end, 0);
> > +   fd = strtol(e, &end, 10);
> > if (*end != '\0')
> > return -1;
> > 
> > diff --git a/shared/config-parser.c b/shared/config-parser.c
> > index 247e880..4c67220 100644
> > --- a/shared/config-parser.c
> > +++ b/shared/config-parser.c
> > @@ -170,7 +170,7 @@ weston_config_section_get_int(struct 
> > weston_config_section *section,
> > }
> > 
> > errno = 0;
> > -   *value = strtol(entry->value, &end, 0);
> > +   *value = strtol(entry->value, &end, 10);
> > if (errno != 0 || end == entry->value || *end != '\0') {
> > *value = default_value;
> > errno = EINVAL;
> > diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> > index 614ef5b..b7aee3b 100644
> > --- a/xwayland/launcher.c
> > +++ b/xwayland/launcher.c
> > @@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t 
> > lsize)
> > return -1;
> > }
> > 
> > -   other = strtol(pid, &end, 0);
> > +   other = strtol(pid, &end, 10);
> > if (end != pid + 10) {
> > weston_log("can't parse lock file %s\n",
> > lockfile);
> > -- 
> > 1.9.1
> > 
> > ___
> > wayland-devel mailing list
> > wayland-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Bryce Harrington
On Wed, Jul 13, 2016 at 10:27:49AM +1000, Peter Hutterer wrote:
> On Tue, Jul 12, 2016 at 04:51:27PM -0700, Bryce Harrington wrote:
> > The third arg to strtol() specifies the base to assume for the number.
> > When 0 is passed, as is currently done in option-parser.c, hexadecimal
> > and octal numbers are permitted and automatically detected and
> > converted.
> > 
> > This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
> > to cover the remaining strtol() calls in Weston, where the routine is
> > being used to read fds and pids - which are always expressed in base-10.
> > It also changes the calls in config-parser, used by
> > weston_config_section_get_int(), which in turn is being used to read
> > scales, sizes, times, rates, and delays; these are all expressed in
> > base-10 numbers only.
> > 
> > The benefit of limiting this to base-10 is to eliminate surprises when
> > parsing numbers from the command line.  Also, by making the code
> > consistent with other usages of strtol, it may make it possible to
> > factor out the common code in the future.
> > 
> > Signed-off-by: Bryce Harrington 
> 
> code looks correct, but I didn't check all the callers, I'll just take
> your word for the base-10 assumption :)
> Reviewed-by: Peter Hutterer 

Thanks, both patches pushed:
   6351fb0..375759e  master -> master

For the strtol() calls the callers are pretty straightforward so this
change should be just fine.

Where things get a bit tricker is the strtoul() call in
weston_config_section_get_uint() which I'd also like to switch to
base-10, however some of its callers are parsing colors - which are hex
numbers and thus switching to base-10 would break those.  I haven't
sorted out what to do there.  I could introduce a new routine like
weston_config_section_get_hex() or even
weston_config_section_get_color() to handle that case, thus allowing
weston_config_section_get_uint() to be forced base-10; or I could just
leave it as-is and let it autodetect decimal or hexadecimal as needed.
Any opinions?

Bryce

> Cheers,
>Peter
> 
> > ---
> >  compositor/main.c  | 2 +-
> >  libweston/compositor.c | 2 +-
> >  shared/config-parser.c | 2 +-
> >  xwayland/launcher.c| 2 +-
> >  4 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/compositor/main.c b/compositor/main.c
> > index 6cf9194..8400d70 100644
> > --- a/compositor/main.c
> > +++ b/compositor/main.c
> > @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
> > server_socket = getenv("WAYLAND_SERVER_SOCKET");
> > if (server_socket) {
> > weston_log("Running with single client\n");
> > -   fd = strtol(server_socket, &end, 0);
> > +   fd = strtol(server_socket, &end, 10);
> > if (*end != '\0')
> > fd = -1;
> > } else {
> > diff --git a/libweston/compositor.c b/libweston/compositor.c
> > index 771f1c9..96eeb17 100644
> > --- a/libweston/compositor.c
> > +++ b/libweston/compositor.c
> > @@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
> > e = getenv(env);
> > if (!e)
> > return -1;
> > -   fd = strtol(e, &end, 0);
> > +   fd = strtol(e, &end, 10);
> > if (*end != '\0')
> > return -1;
> >  
> > diff --git a/shared/config-parser.c b/shared/config-parser.c
> > index 247e880..4c67220 100644
> > --- a/shared/config-parser.c
> > +++ b/shared/config-parser.c
> > @@ -170,7 +170,7 @@ weston_config_section_get_int(struct 
> > weston_config_section *section,
> > }
> >  
> > errno = 0;
> > -   *value = strtol(entry->value, &end, 0);
> > +   *value = strtol(entry->value, &end, 10);
> > if (errno != 0 || end == entry->value || *end != '\0') {
> > *value = default_value;
> > errno = EINVAL;
> > diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> > index 614ef5b..b7aee3b 100644
> > --- a/xwayland/launcher.c
> > +++ b/xwayland/launcher.c
> > @@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t 
> > lsize)
> > return -1;
> > }
> >  
> > -   other = strtol(pid, &end, 0);
> > +   other = strtol(pid, &end, 10);
> > if (end != pid + 10) {
> > weston_log("can't parse lock file %s\n",
> > lockfile);
> > -- 
> > 1.9.1
> > 
> > ___
> > wayland-devel mailing list
> > wayland-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> > 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Include space in 'if ('

2016-07-12 Thread Bryce Harrington
On Wed, Jul 13, 2016 at 10:23:42AM +1000, Peter Hutterer wrote:
> On Tue, Jul 12, 2016 at 04:59:05PM -0700, Bryce Harrington wrote:
> > Signed-off-by: Bryce Harrington 
> > ---
> 
> Reviewed-by: Peter Hutterer 
> but seriously, imo you should push things like this directly, I'm not sure
> how many eyeballs whitespace changes really need :)

Yeah you're right, I debated it.  ;-)
Thanks for the r-b, will push with the other patch.

Bryce
 
> Cheers,
>Peter
> 
> >  compositor/main.c | 2 +-
> >  ivi-shell/ivi-layout-transition.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/compositor/main.c b/compositor/main.c
> > index 8400d70..1f75ae0 100644
> > --- a/compositor/main.c
> > +++ b/compositor/main.c
> > @@ -1499,7 +1499,7 @@ load_wayland_backend(struct weston_compositor *c,
> > int ret = 0;
> >  
> > ret = load_wayland_backend_config(c, argc, argv, wc, &config);
> > -   if(ret < 0) {
> > +   if (ret < 0) {
> > weston_wayland_backend_config_release(&config);
> > return ret;
> > }
> > diff --git a/ivi-shell/ivi-layout-transition.c 
> > b/ivi-shell/ivi-layout-transition.c
> > index 04b62a5..4913db4 100644
> > --- a/ivi-shell/ivi-layout-transition.c
> > +++ b/ivi-shell/ivi-layout-transition.c
> > @@ -439,7 +439,7 @@ ivi_layout_transition_move_resize_view(struct 
> > ivi_layout_surface *surface,
> > transition_move_resize_view_destroy,
> > duration);
> >  
> > -   if(transition && layout_transition_register(transition))
> > +   if (transition && layout_transition_register(transition))
> > return;
> > layout_transition_destroy(transition);
> >  }
> > -- 
> > 1.9.1
>  
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Peter Hutterer
On Tue, Jul 12, 2016 at 04:51:27PM -0700, Bryce Harrington wrote:
> The third arg to strtol() specifies the base to assume for the number.
> When 0 is passed, as is currently done in option-parser.c, hexadecimal
> and octal numbers are permitted and automatically detected and
> converted.
> 
> This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
> to cover the remaining strtol() calls in Weston, where the routine is
> being used to read fds and pids - which are always expressed in base-10.
> It also changes the calls in config-parser, used by
> weston_config_section_get_int(), which in turn is being used to read
> scales, sizes, times, rates, and delays; these are all expressed in
> base-10 numbers only.
> 
> The benefit of limiting this to base-10 is to eliminate surprises when
> parsing numbers from the command line.  Also, by making the code
> consistent with other usages of strtol, it may make it possible to
> factor out the common code in the future.
> 
> Signed-off-by: Bryce Harrington 

code looks correct, but I didn't check all the callers, I'll just take
your word for the base-10 assumption :)
Reviewed-by: Peter Hutterer 

Cheers,
   Peter

> ---
>  compositor/main.c  | 2 +-
>  libweston/compositor.c | 2 +-
>  shared/config-parser.c | 2 +-
>  xwayland/launcher.c| 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/compositor/main.c b/compositor/main.c
> index 6cf9194..8400d70 100644
> --- a/compositor/main.c
> +++ b/compositor/main.c
> @@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
>   server_socket = getenv("WAYLAND_SERVER_SOCKET");
>   if (server_socket) {
>   weston_log("Running with single client\n");
> - fd = strtol(server_socket, &end, 0);
> + fd = strtol(server_socket, &end, 10);
>   if (*end != '\0')
>   fd = -1;
>   } else {
> diff --git a/libweston/compositor.c b/libweston/compositor.c
> index 771f1c9..96eeb17 100644
> --- a/libweston/compositor.c
> +++ b/libweston/compositor.c
> @@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
>   e = getenv(env);
>   if (!e)
>   return -1;
> - fd = strtol(e, &end, 0);
> + fd = strtol(e, &end, 10);
>   if (*end != '\0')
>   return -1;
>  
> diff --git a/shared/config-parser.c b/shared/config-parser.c
> index 247e880..4c67220 100644
> --- a/shared/config-parser.c
> +++ b/shared/config-parser.c
> @@ -170,7 +170,7 @@ weston_config_section_get_int(struct 
> weston_config_section *section,
>   }
>  
>   errno = 0;
> - *value = strtol(entry->value, &end, 0);
> + *value = strtol(entry->value, &end, 10);
>   if (errno != 0 || end == entry->value || *end != '\0') {
>   *value = default_value;
>   errno = EINVAL;
> diff --git a/xwayland/launcher.c b/xwayland/launcher.c
> index 614ef5b..b7aee3b 100644
> --- a/xwayland/launcher.c
> +++ b/xwayland/launcher.c
> @@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t lsize)
>   return -1;
>   }
>  
> - other = strtol(pid, &end, 0);
> + other = strtol(pid, &end, 10);
>   if (end != pid + 10) {
>   weston_log("can't parse lock file %s\n",
>   lockfile);
> -- 
> 1.9.1
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] Include space in 'if ('

2016-07-12 Thread Peter Hutterer
On Tue, Jul 12, 2016 at 04:59:05PM -0700, Bryce Harrington wrote:
> Signed-off-by: Bryce Harrington 
> ---

Reviewed-by: Peter Hutterer 
but seriously, imo you should push things like this directly, I'm not sure
how many eyeballs whitespace changes really need :)

Cheers,
   Peter

>  compositor/main.c | 2 +-
>  ivi-shell/ivi-layout-transition.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/compositor/main.c b/compositor/main.c
> index 8400d70..1f75ae0 100644
> --- a/compositor/main.c
> +++ b/compositor/main.c
> @@ -1499,7 +1499,7 @@ load_wayland_backend(struct weston_compositor *c,
>   int ret = 0;
>  
>   ret = load_wayland_backend_config(c, argc, argv, wc, &config);
> - if(ret < 0) {
> + if (ret < 0) {
>   weston_wayland_backend_config_release(&config);
>   return ret;
>   }
> diff --git a/ivi-shell/ivi-layout-transition.c 
> b/ivi-shell/ivi-layout-transition.c
> index 04b62a5..4913db4 100644
> --- a/ivi-shell/ivi-layout-transition.c
> +++ b/ivi-shell/ivi-layout-transition.c
> @@ -439,7 +439,7 @@ ivi_layout_transition_move_resize_view(struct 
> ivi_layout_surface *surface,
>   transition_move_resize_view_destroy,
>   duration);
>  
> - if(transition && layout_transition_register(transition))
> + if (transition && layout_transition_register(transition))
>   return;
>   layout_transition_destroy(transition);
>  }
> -- 
> 1.9.1
 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] Include space in 'if ('

2016-07-12 Thread Bryce Harrington
Signed-off-by: Bryce Harrington 
---
 compositor/main.c | 2 +-
 ivi-shell/ivi-layout-transition.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index 8400d70..1f75ae0 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1499,7 +1499,7 @@ load_wayland_backend(struct weston_compositor *c,
int ret = 0;
 
ret = load_wayland_backend_config(c, argc, argv, wc, &config);
-   if(ret < 0) {
+   if (ret < 0) {
weston_wayland_backend_config_release(&config);
return ret;
}
diff --git a/ivi-shell/ivi-layout-transition.c 
b/ivi-shell/ivi-layout-transition.c
index 04b62a5..4913db4 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -439,7 +439,7 @@ ivi_layout_transition_move_resize_view(struct 
ivi_layout_surface *surface,
transition_move_resize_view_destroy,
duration);
 
-   if(transition && layout_transition_register(transition))
+   if (transition && layout_transition_register(transition))
return;
layout_transition_destroy(transition);
 }
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] Require base-10 for strtol() calls

2016-07-12 Thread Bryce Harrington
The third arg to strtol() specifies the base to assume for the number.
When 0 is passed, as is currently done in option-parser.c, hexadecimal
and octal numbers are permitted and automatically detected and
converted.

This change is an expansion of f6051cbab84c0e577473b67f0585c0f329eb80fe
to cover the remaining strtol() calls in Weston, where the routine is
being used to read fds and pids - which are always expressed in base-10.
It also changes the calls in config-parser, used by
weston_config_section_get_int(), which in turn is being used to read
scales, sizes, times, rates, and delays; these are all expressed in
base-10 numbers only.

The benefit of limiting this to base-10 is to eliminate surprises when
parsing numbers from the command line.  Also, by making the code
consistent with other usages of strtol, it may make it possible to
factor out the common code in the future.

Signed-off-by: Bryce Harrington 
---
 compositor/main.c  | 2 +-
 libweston/compositor.c | 2 +-
 shared/config-parser.c | 2 +-
 xwayland/launcher.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index 6cf9194..8400d70 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -1684,7 +1684,7 @@ int main(int argc, char *argv[])
server_socket = getenv("WAYLAND_SERVER_SOCKET");
if (server_socket) {
weston_log("Running with single client\n");
-   fd = strtol(server_socket, &end, 0);
+   fd = strtol(server_socket, &end, 10);
if (*end != '\0')
fd = -1;
} else {
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 771f1c9..96eeb17 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -4617,7 +4617,7 @@ weston_environment_get_fd(const char *env)
e = getenv(env);
if (!e)
return -1;
-   fd = strtol(e, &end, 0);
+   fd = strtol(e, &end, 10);
if (*end != '\0')
return -1;
 
diff --git a/shared/config-parser.c b/shared/config-parser.c
index 247e880..4c67220 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -170,7 +170,7 @@ weston_config_section_get_int(struct weston_config_section 
*section,
}
 
errno = 0;
-   *value = strtol(entry->value, &end, 0);
+   *value = strtol(entry->value, &end, 10);
if (errno != 0 || end == entry->value || *end != '\0') {
*value = default_value;
errno = EINVAL;
diff --git a/xwayland/launcher.c b/xwayland/launcher.c
index 614ef5b..b7aee3b 100644
--- a/xwayland/launcher.c
+++ b/xwayland/launcher.c
@@ -164,7 +164,7 @@ create_lockfile(int display, char *lockfile, size_t lsize)
return -1;
}
 
-   other = strtol(pid, &end, 0);
+   other = strtol(pid, &end, 10);
if (end != pid + 10) {
weston_log("can't parse lock file %s\n",
lockfile);
-- 
1.9.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput] touchpad: reduce middle button size on Dell touchpads to 10mm

2016-07-12 Thread Peter Hutterer
All Dell touchpas appear to have a visual marker on their touchpads. With a
visible marker our middle button can (and should) be much smaller since we
can rely on users to hit the button precisely.

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

Signed-off-by: Peter Hutterer 
Tested-by: Andy Lutomirski 
---
 src/evdev-mt-touchpad-buttons.c| 24 +---
 src/evdev.c|  1 +
 src/evdev.h|  1 +
 udev/90-libinput-model-quirks.hwdb |  7 +++
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index a2f3121..cf49c83 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -544,13 +544,15 @@ tp_init_softbuttons(struct tp_dispatch *tp,
int width, height;
const struct input_absinfo *absinfo_x, *absinfo_y;
int xoffset, yoffset;
-   int yres;
+   int xres, yres;
+   int mb_le, mb_re; /* middle button left/right edge */
 
absinfo_x = device->abs.absinfo_x;
absinfo_y = device->abs.absinfo_y;
 
xoffset = absinfo_x->minimum,
yoffset = absinfo_y->minimum,
+   xres = absinfo_x->resolution;
yres = absinfo_y->resolution;
width = device->abs.dimensions.x;
height = device->abs.dimensions.y;
@@ -575,9 +577,25 @@ tp_init_softbuttons(struct tp_dispatch *tp,
 * touchpads don't have markings for the middle button at all so we
 * need to make it big enough to reliably hit it but not too big so
 * it takes away all the space.
+*
+* On touchpads with visible markings we reduce the size of the
+* middle button since users have a visual guide.
+*
+* All Dell touchpads appear to have a middle marker.
 */
-   tp->buttons.bottom_area.middlebutton_left_edge = width * 0.375 + 
xoffset;
-   tp->buttons.bottom_area.rightbutton_left_edge = width * 0.625 + xoffset;
+   if (tp->device->model_flags & EVDEV_MODEL_DELL_TOUCHPAD) {
+   const int MIDDLE_BUTTON_WIDTH = 10; /* mm */
+   int half_width = MIDDLE_BUTTON_WIDTH/2 * xres; /* units */
+
+   mb_le = xoffset + width/2 - half_width;
+   mb_re = xoffset + width/2 + half_width;
+   } else {
+   mb_le = xoffset + width * 0.375;
+   mb_re = xoffset + width * 0.625;
+   }
+
+   tp->buttons.bottom_area.middlebutton_left_edge = mb_le;
+   tp->buttons.bottom_area.rightbutton_left_edge = mb_re;
 }
 
 void
diff --git a/src/evdev.c b/src/evdev.c
index fdbaba1..6d231db 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1804,6 +1804,7 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(CYBORG_RAT),
MODEL(CYAPA),
MODEL(LENOVO_T450_TOUCHPAD),
+   MODEL(DELL_TOUCHPAD),
MODEL(TRACKBALL),
MODEL(APPLE_MAGICMOUSE),
{ NULL, EVDEV_MODEL_DEFAULT },
diff --git a/src/evdev.h b/src/evdev.h
index 939a0b8..a3e76c5 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -115,6 +115,7 @@ enum evdev_device_model {
EVDEV_MODEL_CYBORG_RAT = (1 << 14),
EVDEV_MODEL_CYAPA = (1 << 15),
EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17),
+   EVDEV_MODEL_DELL_TOUCHPAD = (1 << 18),
EVDEV_MODEL_TRACKBALL = (1 << 19),
EVDEV_MODEL_APPLE_MAGICMOUSE = (1 << 20),
 };
diff --git a/udev/90-libinput-model-quirks.hwdb 
b/udev/90-libinput-model-quirks.hwdb
index 5e5ea9a..ebce8d2 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -48,6 +48,13 @@ libinput:mouse:input:b0003v06A3p0CD5*
  LIBINPUT_MODEL_CYBORG_RAT=1
 
 ##
+# Dell
+##
+libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnDellInc.:*
+libinput:name:* Touchpad:dmi:*svnDellInc.:*
+ LIBINPUT_MODEL_DELL_TOUCHPAD=1
+
+##
 # Elantech
 ##
 libinput:name:*ETPS/2 Elantech Touchpad*:dmi:*
-- 
2.7.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] config-parser: Catch negative numbers assigned to unsigned config values

2016-07-12 Thread Bryce Harrington
On Tue, Jul 12, 2016 at 01:17:20PM +0100, Eric Engestrom wrote:
> On Mon, Jul 11, 2016 at 05:55:15PM -0700, Bryce Harrington wrote:
> > strtoul() has a side effect that when given a string representing a
> > negative number, it returns a negated version as the value, and does not
> > flag an error.  IOW, strtoul("-42", &val) sets val to 42.  This could
> > potentially result in unintended surprise behaviors, such as if one were
> > to inadvertantly set a config param to -1 expecting that to disable it,
> > but with the result of setting the param to 1 instead.
> > 
> > Catch this by using strtol() and then manually check for the negative
> > value.  This logic is modelled after Wayland's strtouint().
> > 
> > Note that this change unfortunately reduces the range of parseable
> > numbers from [0,UINT_MAX] to [0,INT_MAX].  The current users of
> > weston_config_section_get_uint() are anticipating numbers far smaller
> > than either of these limits, so the change is believed to have no impact
> > in practice.
> > 
> > Also add a test case for negative numbers that catches this error
> > condition.
> > 
> > Signed-off-by: Bryce Harrington 
> 
> Looks good to me.
> Reviewed-by: Eric Engestrom 

Thanks, pushed:
   5ba41eb..6351fb0  master -> master
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] config-parser: Catch negative numbers assigned to unsigned config values

2016-07-12 Thread Bryce Harrington
On Tue, Jul 12, 2016 at 10:58:05AM -0700, Bill Spitzak wrote:
> I tested this and at least for libc on linux it returns 0x1-n, ie
> "-1" is 0x.
> 
> This is actually pretty useful when the unsigned value is bitflags or you
> want to guarantee you typed in the largest number possible. I am not sure
> you really want to disable it, especially if it prevents entry for 1/2 the
> possible numbers.

Sure, but nothing using this routine requires either of those
capabilities.

Bryce

> On Tue, Jul 12, 2016 at 5:17 AM, Eric Engestrom 
> wrote:
> 
> > On Mon, Jul 11, 2016 at 05:55:15PM -0700, Bryce Harrington wrote:
> > > strtoul() has a side effect that when given a string representing a
> > > negative number, it returns a negated version as the value, and does not
> > > flag an error.  IOW, strtoul("-42", &val) sets val to 42.  This could
> > > potentially result in unintended surprise behaviors, such as if one were
> > > to inadvertantly set a config param to -1 expecting that to disable it,
> > > but with the result of setting the param to 1 instead.
> > >
> > > Catch this by using strtol() and then manually check for the negative
> > > value.  This logic is modelled after Wayland's strtouint().
> > >
> > > Note that this change unfortunately reduces the range of parseable
> > > numbers from [0,UINT_MAX] to [0,INT_MAX].  The current users of
> > > weston_config_section_get_uint() are anticipating numbers far smaller
> > > than either of these limits, so the change is believed to have no impact
> > > in practice.
> > >
> > > Also add a test case for negative numbers that catches this error
> > > condition.
> > >
> > > Signed-off-by: Bryce Harrington 
> >
> > Looks good to me.
> > Reviewed-by: Eric Engestrom 
> > ___
> > wayland-devel mailing list
> > wayland-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> >
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] rdp: Check for non-digits and errno in strtol call

2016-07-12 Thread Bryce Harrington
On Tue, Jul 12, 2016 at 08:12:37AM -0700, Yong Bakos wrote:
> On Jul 11, 2016, at 5:02 PM, Bryce Harrington  wrote:
> > 
> > Improve error checking for situations like RDP_FD=42foo, or where the
> > provided number is out of range.
> > 
> > Suggestion by Yong Bakos.
> > 
> > Signed-off-by: Bryce Harrington 
> 
> The condition addresses all failure cases, so this is
> Reviewed-by: Yong Bakos 
> 
> yong

Thanks Yong and Eric, I've pushed with your R-b's:
   7fc000c..5ba41eb  master -> master


> > ---
> > libweston/compositor-rdp.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
> > index 79f0687..53c7124 100644
> > --- a/libweston/compositor-rdp.c
> > +++ b/libweston/compositor-rdp.c
> > @@ -1263,7 +1263,8 @@ rdp_backend_create(struct weston_compositor 
> > *compositor,
> > }
> > 
> > fd = strtoul(fd_str, &fd_tail, 10);
> > -   if (fd_tail == fd_str || rdp_peer_init(freerdp_peer_new(fd), b))
> > +   if (errno != 0 || fd_tail == fd_str || *fd_tail != '\0'
> > +   || rdp_peer_init(freerdp_peer_new(fd), b))
> > goto err_output;
> > }
> > 
> > -- 
> > 1.9.1
> > 
> > ___
> > wayland-devel mailing list
> > wayland-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: Building wayland-ivi-extension source code error

2016-07-12 Thread Yong Bakos
On Jul 12, 2016, at 6:02 AM, Anthenony  wrote:
> 
> Hi,All:
> 
> Dose anyone have the same problem in building wayland-ivi-extension as me?

Did you build and install wayland itself? Seems you don't have wayland-scanner.

yong



> yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ 
> cmake ../wayland-ivi-extension/
> -- The C compiler identification is GNU 4.9.2
> -- The CXX compiler identification is GNU 4.9.2
> -- Check for working C compiler: 
> /opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
> -- Check for working C compiler: 
> /opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
>  -- works
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working CXX compiler: 
> /opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
> -- Check for working CXX compiler: 
> /opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
>  -- works
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Found PkgConfig: 
> /opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/pkg-config 
> (found version "0.28") 
> -- checking for module 'wayland-client>=1.9.0'
> --   found wayland-client, version 1.9.0
> -- checking for module 'wayland-server>=1.9.0'
> --   found wayland-server, version 1.9.0
> -- checking for module 'weston>=1.9.0'
> --   found weston, version 1.9.0
> -- checking for module 'pixman-1'
> --   found pixman-1, version 0.32.6
> -- Looking for include file pthread.h
> -- Looking for include file pthread.h - found
> -- Looking for pthread_create
> -- Looking for pthread_create - not found
> -- Looking for pthread_create in pthreads
> -- Looking for pthread_create in pthreads - not found
> -- Looking for pthread_create in pthread
> -- Looking for pthread_create in pthread - found
> -- Found Threads: TRUE  
> -- gtest_INCLUDE_DIRS: gtest_INCLUDE_DIRS-NOTFOUND
> -- gtest_LIBRARIES:
> -- gtest not found, disabling unit tests (BUILD_ILM_API_TESTS=OFF)
> -- checking for module 'glesv2'
> --   found glesv2, version 8.0
> -- checking for module 'egl'
> --   found egl, version 8.0
> -- Configuring done
> -- Generating done
> -- Build files have been written to: 
> /home/yuanjiawei/wayland-ivi-entension/wayland-ivi-extension-so/build
> yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ 
> make
> [  1%] Generating ivi-share-protocol.c
> /bin/sh: 1: WAYLAND_SCANNER_EXECUTABLE-NOTFOUND: not found
> make[2]: *** [protocol/ivi-share-protocol.c] error 127
> make[1]: *** [protocol/CMakeFiles/ivi-extension-protocol.dir/all] error 2
> make: *** [all] error 2
> yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ 
> 
> 
>  
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: XDC 2016 : Call for paper

2016-07-12 Thread Martin Peres

On 13/05/16 01:56, Martin Peres wrote:

Hello,

I have the pleasure to announce that the X.org Developer Conference 2016
will be held in Helsinki from September 21 to September 23. The venue is
located at Haaga-Helia university[0], next to the Pasila station.

The official page for the event is http://www.x.org/wiki/Events/XDC2016
while the call for paper is at http://www.x.org/wiki/Other/Press/CFP2016/


Friendly reminder that the deadline for the abstracts is in about a 
month (August 17th).


Please also remember to register for the conference by adding yourself 
to the attendees list[1] or asking me to do it.


See you there!

Martin

[1] http://www.x.org/wiki/Events/XDC2016


As usual, we are open to talks across the layers of the graphics stack,
from
the kernel to desktop environments / graphical applications and about how
to make things better for the developers who build them. If you're not sure
if something might fit, mail me or add it to the ideas list found in the
program page.

The conference is free of charge and opened to the general public. If
you plan on coming, please add yourself to the attendees list. We'll
use this list to make badges and plan for the catering, so if you are
attending please add your name as early as possible.

I am looking forward to seeing you there, if you have any
inquiries/questions, please send them to me (please also CC: board at
foundation.x.org).

Martin Peres

[0]
https://www.google.fi/maps/place/Ratapihantie+13,+00520+Helsinki/@60.2013725,24.931852,17z/data=!3m1!4b1!4m5!3m4!1s0x469209921fdba137:0x841c90a2862185af!8m2!3d60.2013725!4d24.9340407


___
dri-devel mailing list
dri-de...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Building wayland-ivi-extension source code error

2016-07-12 Thread Anthenony
Hi,All:


Dose anyone have the same problem in building wayland-ivi-extension as me?


yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ 
cmake ../wayland-ivi-extension/
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: 
/opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
-- Check for working C compiler: 
/opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc
 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: 
/opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
-- Check for working CXX compiler: 
/opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: 
/opt/fsl-imx-gui/3.14.52-1.1.0/sysroots/i686-pokysdk-linux/usr/bin/pkg-config 
(found version "0.28") 
-- checking for module 'wayland-client>=1.9.0'
--   found wayland-client, version 1.9.0
-- checking for module 'wayland-server>=1.9.0'
--   found wayland-server, version 1.9.0
-- checking for module 'weston>=1.9.0'
--   found weston, version 1.9.0
-- checking for module 'pixman-1'
--   found pixman-1, version 0.32.6
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- gtest_INCLUDE_DIRS: gtest_INCLUDE_DIRS-NOTFOUND
-- gtest_LIBRARIES:
-- gtest not found, disabling unit tests (BUILD_ILM_API_TESTS=OFF)
-- checking for module 'glesv2'
--   found glesv2, version 8.0
-- checking for module 'egl'
--   found egl, version 8.0
-- Configuring done
-- Generating done
-- Build files have been written to: 
/home/yuanjiawei/wayland-ivi-entension/wayland-ivi-extension-so/build
yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ 
make
[  1%] Generating ivi-share-protocol.c
/bin/sh: 1: WAYLAND_SCANNER_EXECUTABLE-NOTFOUND: not found
make[2]: *** [protocol/ivi-share-protocol.c] error 127
make[1]: *** [protocol/CMakeFiles/ivi-extension-protocol.dir/all] error 2
make: *** [all] error 2
yuanjiawei@yuanjiawei:~/wayland-ivi-entension/wayland-ivi-extension-so/build$ ___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] rdp: Check for non-digits and errno in strtol call

2016-07-12 Thread Eric Engestrom
On Mon, Jul 11, 2016 at 05:02:44PM -0700, Bryce Harrington wrote:
> Improve error checking for situations like RDP_FD=42foo, or where the
> provided number is out of range.
> 
> Suggestion by Yong Bakos.
> 
> Signed-off-by: Bryce Harrington 

Reviewed-by: Eric Engestrom 

> ---
>  libweston/compositor-rdp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libweston/compositor-rdp.c b/libweston/compositor-rdp.c
> index 79f0687..53c7124 100644
> --- a/libweston/compositor-rdp.c
> +++ b/libweston/compositor-rdp.c
> @@ -1263,7 +1263,8 @@ rdp_backend_create(struct weston_compositor *compositor,
>   }
>  
>   fd = strtoul(fd_str, &fd_tail, 10);
> - if (fd_tail == fd_str || rdp_peer_init(freerdp_peer_new(fd), b))
> + if (errno != 0 || fd_tail == fd_str || *fd_tail != '\0'
> + || rdp_peer_init(freerdp_peer_new(fd), b))
>   goto err_output;
>   }
>  
> -- 
> 1.9.1
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] config-parser: Catch negative numbers assigned to unsigned config values

2016-07-12 Thread Eric Engestrom
On Mon, Jul 11, 2016 at 05:55:15PM -0700, Bryce Harrington wrote:
> strtoul() has a side effect that when given a string representing a
> negative number, it returns a negated version as the value, and does not
> flag an error.  IOW, strtoul("-42", &val) sets val to 42.  This could
> potentially result in unintended surprise behaviors, such as if one were
> to inadvertantly set a config param to -1 expecting that to disable it,
> but with the result of setting the param to 1 instead.
> 
> Catch this by using strtol() and then manually check for the negative
> value.  This logic is modelled after Wayland's strtouint().
> 
> Note that this change unfortunately reduces the range of parseable
> numbers from [0,UINT_MAX] to [0,INT_MAX].  The current users of
> weston_config_section_get_uint() are anticipating numbers far smaller
> than either of these limits, so the change is believed to have no impact
> in practice.
> 
> Also add a test case for negative numbers that catches this error
> condition.
> 
> Signed-off-by: Bryce Harrington 

Looks good to me.
Reviewed-by: Eric Engestrom 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel