[PATCH v2] client: Fix handling display-reader_count if poll fails

2013-09-25 Thread Neil Roberts
In wl_display_dispatch_queue, if poll fails then it would previously return immediately and leak a reference in display-reader_count. Then if the application ignores the error and tries to read again it will block forever. This can happen for example if the poll fails with EINTR which the

[PATCH] config: verify that the config file has been parsed

2013-09-25 Thread Alex DAMIAN
From: Alexandru DAMIAN alexandru.dam...@intel.com weston_config_parse may return NULL, leading to an ungraceful exit via SIGSEGV. Adding a nice check that gracefully exits the compositor when the config.ini parsing failed. Signed-off-by: Alexandru DAMIAN alexandru.dam...@intel.com ---

[PATCH v2 1/2] config: verify that the config file has been parsed

2013-09-25 Thread Alex DAMIAN
From: Alexandru DAMIAN alexandru.dam...@intel.com weston_config_parse may return NULL, leading to an ungraceful exit via SIGSEGV. Adding a nice check that gracefully exits the compositor when the config.ini parsing failed. Signed-off-by: Alexandru DAMIAN alexandru.dam...@intel.com ---

[PATCH v2 2/2] compositor: check if seteuid worked

2013-09-25 Thread Alex DAMIAN
From: Alexandru DAMIAN alexandru.dam...@intel.com Checking the return value from seteuid in order to not launch clients with the wrong effective uid. Signed-off-by: Alexandru DAMIAN alexandru.dam...@intel.com --- src/compositor.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-)

Re: [PATCH v2 2/2] compositor: check if seteuid worked

2013-09-25 Thread Emilio Pozuelo Monfort
Hi, On 25/09/13 14:48, Alex DAMIAN wrote: From: Alexandru DAMIAN alexandru.dam...@intel.com Checking the return value from seteuid in order to not launch clients with the wrong effective uid. Signed-off-by: Alexandru DAMIAN alexandru.dam...@intel.com --- src/compositor.c | 7 +--

[[PATCH v3 2/2]] compositor: check if seteuid worked

2013-09-25 Thread Alex DAMIAN
From: Alexandru DAMIAN alexandru.dam...@intel.com Checking the return value from seteuid in order to not launch clients with the wrong effective uid. Signed-off-by: Alexandru DAMIAN alexandru.dam...@intel.com --- src/compositor.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-)

Re: [PATCH v2 2/2] compositor: check if seteuid worked

2013-09-25 Thread Damian, Alexandru
Funky, I tested the correct patch and then submitted this garbage. Thanks for spotting this, new patch in the mail. Alex On Wed, Sep 25, 2013 at 2:36 PM, Emilio Pozuelo Monfort poch...@gmail.comwrote: Hi, On 25/09/13 14:48, Alex DAMIAN wrote: From: Alexandru DAMIAN

Re: [PATCH v2] Post buffer release events instead of queue when no frame callback

2013-09-25 Thread Tomeu Vizoso
On 16 September 2013 17:28, Neil Roberts n...@linux.intel.com wrote: Here is a second version of the patch to do the posting. It makes the patch for doing the queue disabling redundant. Have done some testing on the RPi and this patch allows me not having to sync in a loop while waiting for

Re: [PATCH v2] client: Fix handling display-reader_count if poll fails

2013-09-25 Thread Kristian Høgsberg
On Wed, Sep 25, 2013 at 10:39:12AM +0100, Neil Roberts wrote: In wl_display_dispatch_queue, if poll fails then it would previously return immediately and leak a reference in display-reader_count. Then if the application ignores the error and tries to read again it will block forever. This can

Re: [PATCH] config: verify that the config file has been parsed

2013-09-25 Thread Kristian Høgsberg
On Wed, Sep 25, 2013 at 01:34:17PM +0100, Alex DAMIAN wrote: From: Alexandru DAMIAN alexandru.dam...@intel.com weston_config_parse may return NULL, leading to an ungraceful exit via SIGSEGV. Adding a nice check that gracefully exits the compositor when the config.ini parsing failed. Ah,

[PATCH 1/3 wayland-fits] core/pointer: Keep track of the focus serial

2013-09-25 Thread Neil Roberts
The focus serial is needed to correctly send a cursor so it is useful to be able to verify that this is working correctly. --- src/test/core/pointer.cpp | 2 ++ src/test/core/pointer.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/test/core/pointer.cpp b/src/test/core/pointer.cpp

[PATCH 2/3 wayland-fits] core: Add a wrapper for the keyboard

2013-09-25 Thread Neil Roberts
This adds a wrapper for a wl_keyboard in a similar way to the pointer wrapper. It keeps track of the keys that are pressed so that they can be quickly verified. wayland-fits now depends on libxkbcommon so that the keyboard wrapper can pass the keymap to it and get the modifier indices. ---

[PATCH 3/3 wayland-fits] core: Add a test for multiple pointer and keyboard resources

2013-09-25 Thread Neil Roberts
This adds a test which creates multiple pointer and keyboard resources for the same client and verifies that they all receive events. It also tests various combiniations of pointer and keyboard focus and ensures that for example a keyboard created while the surface already has focus will correctly

[PATCH v3 1/2] config: verify that the config file is not null

2013-09-25 Thread Alex DAMIAN
From: Alexandru DAMIAN alexandru.dam...@intel.com weston_config_parse may return NULL, leading to an ungraceful exit via SIGSEGV if we try to reference the structure. Adding a check in weston_config_full_path so that we return the empty file /dev/null as filename if we started without a config

Re: [xkbcommon] How to distinguish left-shift and right-shift

2013-09-25 Thread Ran Benita
On Tue, Sep 24, 2013 at 08:02:30PM -0300, Wander Lairson Costa wrote: Hi, Hi, I am working for some time porting Blender to wayland [1] and I am now adding keyboard handing support. For that, I am following weston clients code as reference and using libxkbcommon. To make a long history

Re: [PATCH v3 1/2] config: verify that the config file is not null

2013-09-25 Thread Bill Spitzak
Do you think anything is really going to try to open and read the file, and then crash because it does not exist? If this is a concern then you also have to worry about the config file being deleted after Wayland starts up. I think returning or some other non-existent file (perhaps the

Re: [PATCH v3 1/2] config: verify that the config file is not null

2013-09-25 Thread Kristian Høgsberg
On Wed, Sep 25, 2013 at 11:07 AM, Alex DAMIAN alexandru.dam...@intel.com wrote: From: Alexandru DAMIAN alexandru.dam...@intel.com weston_config_parse may return NULL, leading to an ungraceful exit via SIGSEGV if we try to reference the structure. Adding a check in weston_config_full_path so

RE: [PATCH 2/3 wayland-fits] core: Add a wrapper for the keyboard

2013-09-25 Thread Eoff, Ullysses A
Comments inline. -Original Message- From: wayland-devel-bounces+ullysses.a.eoff=intel@lists.freedesktop.org [mailto:wayland-devel- bounces+ullysses.a.eoff=intel@lists.freedesktop.org] On Behalf Of Neil Roberts Sent: Wednesday, September 25, 2013 11:07 AM To:

Re: [PATCH v3 1/2] config: verify that the config file is not null

2013-09-25 Thread Damian, Alexandru
The nice thing was that even if some other code besides the _log tries to read the file path, that code can expect to open the path and read from it just fine, instead of receiving a NULL and maybe crashing. I'm gonna check tomorrow if this happens somewhere else in the code, and if not, modify