[PATCH wayland 2/5] server: set map entry to NULL after resource is destroyed

2016-05-13 Thread Marek Chalupa
we return NULL insted of a pointer to invalid memory, which could be OK API break. Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/wayland-server.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index f

[PATCH wayland 4/5] client-test: test posting no-mem error on client destruction

2016-05-13 Thread Marek Chalupa
while client is being destroyed, it destroys all its resources. Destroy handlers are called for the resources and if some destroy handler post no memory error, we get crash, because the display resource is NULL (it is destroyed as a first resource) Signed-off-by: Marek Chalupa <mch

Fwd: Re: [PATCH xwayland] xwayland-shm: fortify fallocate against EINTR

2016-04-25 Thread Marek Chalupa
On 04/25/16 12:20, Pekka Paalanen wrote: On Mon, 25 Apr 2016 11:33:00 +0200 Marek Chalupa <mchqwe...@gmail.com> wrote: If posix_fallocate or ftruncate is interrupted by signal while working, we return -1 as fd and the allocation process returns BadAlloc error. That causes xwayland c

[PATCH wayland] connection: remove redundant assignment

2016-04-22 Thread Marek Chalupa
the code is something like: if (object == NULL && ...) { object = NULL; return; } first, the object is already NULL, second, the assignment has no effect since we return from the function right away Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/co

[PATCH weston] simple-egl: use roundtrip after get_registry request

2016-03-14 Thread Marek Chalupa
these steps the weston-simple-egl aborts, because it has not got shell neither ivi-shell objects Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- clients/simple-egl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 78b4226..d

Re: [PATCH wayland] tests: Test creating a shm pool with 0 size

2016-02-22 Thread Marek Chalupa
Hi On 02/22/16 06:52, Jonas Ådahl wrote: Add a test case that tests the servers behaviour when creating a pool of size 0. The test suite will do the memory and fd leak check for us, so the test case is only a triggerer. Signed-off-by: Jonas Ådahl --- Makefile.am | 5

Re: [PATCH weston v2] config-parser: Check malloc and strdup returns

2016-02-22 Thread Marek Chalupa
Hi, Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Best, Marek On 02/18/16 05:46, Bryce Harrington wrote: Signed-off-by: Bryce Harrington <br...@osg.samsung.com> --- v2: Also check strdup return shared/config-parser.c | 22 ++ 1 file changed, 22 inserti

[PATCH wayland] tests: add test for receiving an error on destroyed object

2016-02-22 Thread Marek Chalupa
test if receiving an error on already destroyed object won't do any harm Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- tests/display-test.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/tests/display-test.c b/tests/display-

Re: [PATCH wayland] client: Don't segfault when receiving error on destroyed object

2016-02-22 Thread Marek Chalupa
wl_display_get_protocol_error() for the error analysis, so IMO its OK break. Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Cheers, Marek On 02/22/16 06:37, Jonas Ådahl wrote: If an error is received on a destroyed object, we'd get NULL passed to display_handle_error() instead of a pointer to a

Re: [PATCH wayland] resource-test: Use wl_seat instead of wl_display for testing

2016-02-12 Thread Marek Chalupa
Hi, added reviewed-by to the whole series in some previous e-mail, so just adding it here again, so that it can be seen in the patchwork Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Cheers, Marek On 01/14/16 21:32, Derek Foreman wrote: We're creating resources with versions u

[PATCH weston] compositor-x11: send pointer frame after axis event

2016-02-03 Thread Marek Chalupa
clients that implement pointer interface of version 5 wait for the frame event, so without it the scrolling does not work (GTK+ clients do not scroll now for example). Xcb axis events are discrete, so it's fine to send frame after every single axis event Signed-off-by: Marek Chalupa <mch

Re: [PATCH wayland-protocols v2] xdg-shell: Introduce xdg_tooltip

2016-02-03 Thread Marek Chalupa
On 02/03/16 09:39, Jonas Ådahl wrote: An xdg_tooltip is a new window type used to implement tooltip like surfaces. See the interface documentation for details. Signed-off-by: Jonas Ådahl --- Changes since v1: Various wording changes as suggested by Mike. Added missing

Re: [PATCH weston] input: Don't try to send pointer frames if no focus_client

2016-02-01 Thread Marek Chalupa
I ran into the same issue with gtk3-demo. When the popup was being destroyed, the focus was set to 0x0 and I got sigsegv, because popup grab tried to sent the frame. Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Regards, Marek On 01/29/2016 05:29 PM, Derek Foreman wrote: Pr

[PATCH] input: send frame after axis event in default grab

2016-02-01 Thread Marek Chalupa
kinetic scrolling or so) can decide when to send the frame itself Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/input.c b/src/input.c index 2539fa7..32ad20a 100644 --- a/src/input.c +++ b/src/input.c @@ -404,6

[PATCH wayland] cosmetic: return NULL instead of 0

2016-01-27 Thread Marek Chalupa
we're returning a pointer Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/wayland-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland-util.c b/src/wayland-util.c index e782309..3f95877 100644 --- a/src/wayland-util.c +++ b/src/wayland-

Re: [PATCH] config-parser: Check malloc returns

2016-01-15 Thread Marek Chalupa
Hi On 01/13/2016 09:30 PM, Bryce Harrington wrote: Signed-off-by: Bryce Harrington --- shared/config-parser.c | 4 1 file changed, 4 insertions(+) diff --git a/shared/config-parser.c b/shared/config-parser.c index a50773b..137a9f1 100644 ---

Re: [PATCH wayland] server: validate resource versions at creation time

2016-01-15 Thread Marek Chalupa
version, interface->name, interface->version); + return NULL; + } + resource = malloc(sizeof *resource); if (resource == NULL) return NULL; I think that checking the version is right, so Reviewed-by: Marek Chalupa <mchqwe...

Re: [PATCH weston] compositor: create_data_source(): Fix potential crash on OOM

2016-01-11 Thread Marek Chalupa
Hi, Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> (one small comment below) Cheers, Marek On 01/05/2016 05:18 PM, Lyude wrote: Noticed this while working on primary selection, in the event we run out of memory when trying to create a new data source, there's a chance we'l

Re: [PATCH wayland 2/6] scanner: Fail if 'since' is higher than the interface version

2016-01-11 Thread Marek Chalupa
Hi, patches 1-2 Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Cheers, Marek On 12/29/2015 03:10 AM, Jonas Ådahl wrote: If an event or request have a "since" attribute that is larger than the version of the interface it is in, fail with an explaining error message. Sign

Re: [PATCH wayland 3/6] Use zalloc instead of malloc + memset

2016-01-11 Thread Marek Chalupa
iler complains about implicit declaration of calloc() Maybe we could use zalloc even in tests/test-compositor.c? otherwise Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Regards, Marek + #endif diff --git a/src/wayland-server.c b/src/wayland-server.c index 55c0cf9..9e26b18

Re: [PATCH wayland v4] server: Add a socket with an existing fd

2016-01-11 Thread Marek Chalupa
On 12/18/2015 02:08 AM, Bryce Harrington wrote: This adds functionality to allow system-level control over handing out file descriptors for sockets, to allow tighter security when running a Wayland compositor under a Wayland session server. Signed-off-by: Bryce Harrington

Re: [PATCH wayland] client: Add missing arg in a wl_log invocation

2016-01-11 Thread Marek Chalupa
Hi, obviously correct Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> Cheers, Marek On 01/04/2016 11:09 AM, Victor Berger wrote: Without this 'proxy' argument, the '%p' formatter prints a constant garbage value. Signed-off-by: Victor Berger <victor.ber...@m4x.org> ---

[PATCH wayland v2] server: don't send an error to NULL display_resource

2016-01-11 Thread Marek Chalupa
://bugs.freedesktop.org/show_bug.cgi?id=91356 Reported-by: Ashim <ashim.s...@samsung.com> Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/wayland-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index 9e26b18..01

Re: [PATCH wayland 6/6] doc: Fix incorrect parameter name

2016-01-11 Thread Marek Chalupa
Reviewed-by: Marek Chalupa <mchqwe...@gmail.com> On 12/29/2015 03:10 AM, Jonas Ådahl wrote: e a shm_pool ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Re: [PATCH wayland] server: don't send an error to NULL display_resource

2015-12-11 Thread Marek Chalupa
Hi, On 12/07/2015 06:54 PM, Bill Spitzak wrote: On Mon, Dec 7, 2015 at 12:42 AM, Marek Chalupa <mchqwe...@gmail.com <mailto:mchqwe...@gmail.com>> wrote: diff --git a/src/wayland-server.c b/src/wayland-server.c index 1364d5d..b372aa9 100644 --- a/src/wayland-server

[PATCH wayland] server: don't send an error to NULL display_resource

2015-12-07 Thread Marek Chalupa
destructor or destroy signal handler calls wl_client_post_no_memory() while destroying client. https://bugs.freedesktop.org/show_bug.cgi?id=91356 Reported-by: Ashim <ashim.s...@samsung.com> Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/wayland-server.c | 11 ++- 1

Re: [PATCH wayland] add apis to enable/disable wayland debug at runtime

2015-12-07 Thread Marek Chalupa
Hi, I like this idea, it can be handy when debugging just a part of code (I wrote similar patch once actually, but then I forgot about it and never sent it to the list). However, the implementation could be better IMHO: I don't think we should move the variables to wayland-util.c. You don't

Re: [PATCH wayland] add apis to enable/disable wayland debug at runtime

2015-12-07 Thread Marek Chalupa
On 12/07/2015 01:05 PM, Pekka Paalanen wrote: On Mon, 7 Dec 2015 11:21:15 +0100 Marek Chalupa <mchqwe...@gmail.com> wrote: Hi, I like this idea, it can be handy when debugging just a part of code (I wrote similar patch once actually, but then I forgot about it and never sent it to th

[PATCH wayland] server: remove redundant include

2015-11-27 Thread Marek Chalupa
we don't use ffi in wayland-server.c Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/wayland-server.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wayland-server.c b/src/wayland-server.c index bac98bf..bee9a70 100644 --- a/src/wayland-server.c +++ b/src/wayland-se

Re: [PATCH 3/5] socket-test: Fix indentation to follow project code style policy

2015-11-23 Thread Marek Chalupa
Hi On 11/19/2015 08:23 PM, Bill Spitzak wrote: On Thu, Nov 19, 2015 at 1:36 AM, Bryce Harrington > wrote: From: Bryce Harrington > Signed-off-by: Bryce Harrington

Re: [PATCH 3/5] socket-test: Fix indentation to follow project code style policy

2015-11-22 Thread Marek Chalupa
Hi, I think the indentation already follows project code style. From doc/Contributing: "- indent with tabs, and a tab is always 8 characters wide" current code is: ^Ichar *val = getenv("XDG_RUNTIME_DIR");$ ^Iif (!val)$ ^I^Iassert(0 && "set $XDG_RUNTIME_DIR to run this test");$ with your

[PATCH wayland] add wl_abort private function

2015-11-16 Thread Marek Chalupa
On many places in the code we use wl_log + abort or wl_log + assert(0). Replace these with one call to wl_abort, so that we don't mix abort(), assert(0) and we'll save few lines Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/connection.c | 22 +++--- src/w

[PATCH wayland] event-loop: remove extra header

2015-11-16 Thread Marek Chalupa
we don't use assert() anywhere in this file, so remove #include Signed-off-by: Marek Chalupa <mchqwe...@gmail.com> --- src/event-loop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/event-loop.c b/src/event-loop.c index 130c7be..ea27b69 100644 --- a/src/event-loop.c +++ b/src

[PATCH weston] shell: fix maximizing windows on a secondary output

2015-10-09 Thread Marek Chalupa
commit f814c5dc9 changed get_output_work_area behaviour which broke the code for positioning maximized window. The x position was set to 2*output->x instead of to output->x fix https://bugs.freedesktop.org/show_bug.cgi?id=92357 Signed-off-by: Marek Chalupa <mchqwe...@gmail.com>

[PATCH weston v2] xwm: flush xcb connection only when we processed some event

2015-08-12 Thread Marek Chalupa
xwayland source is checked, so it dispatches twice on any event. If the other turn has no events to dispatch, we flush the connection redundantly v2. do not flood logs with 'unhandled event' messages Signed-off-by: Marek Chalupa mchqwe...@gmail.com Reviewed-by: Derek Foreman der

Re: [PATCH wayland v2] Introduce WAYLAND_SERVER_SOCKET_DIR to change socket directory without changing XDG_RUNTIME_DIR.

2015-08-06 Thread Marek Chalupa
Hey, Just to clarify my review of this series. I like WAYLAND_DISPLAY being able to handle absolute paths. I'm in for adding WAYLAND_SERVER_SOCKET_DIR, because currently it is the only way how to customize wl_display_add_socket_auto (In the future we could add something like

Re: [PATCH wayland v2 1/2] Extend WAYLAND_DISPLAY and name parameter semantics to support absolute paths.

2015-08-06 Thread Marek Chalupa
Hi, On 08/06/2015 01:49 PM, Davide Bettio wrote: Hello, On 2015-08-06 10:37, Marek Chalupa wrote: the patch does not apply in the first place: Applying: Extend WAYLAND_DISPLAY and name parameter semantics to support absolute paths. fatal: corrupt patch at line 15 Repository lacks necessary

Re: [PATCH wayland v2] Introduce WAYLAND_SERVER_SOCKET_DIR to change socket directory without changing XDG_RUNTIME_DIR.

2015-08-06 Thread Marek Chalupa
Hi, On 07/29/2015 11:23 AM, Davide Bettio wrote: Introduce WAYLAND_SERVER_SOCKET_DIR to change socket directory without changing XDG_RUNTIME_DIR. This might be useful to change socket directory in case wl_display_add_socket_auto is used. For example this will change the socket path for weston

Re: [PATCH wayland v2 1/2] Extend WAYLAND_DISPLAY and name parameter semantics to support absolute paths.

2015-08-06 Thread Marek Chalupa
Hi, the patch does not apply in the first place: Applying: Extend WAYLAND_DISPLAY and name parameter semantics to support absolute paths. fatal: corrupt patch at line 15 Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Most of my comment

Re: [PATCH wayland 2/2] Introduce WAYLAND_SERVER_SOCKET to change the path where the server will create the socket.

2015-08-06 Thread Marek Chalupa
Hi, IMO it would be better to implement this functionality in the compositor (command line argument or so) instead of adding new env var. Or is there a reason it must be env var? However, it is just my point of view, I don't want to block this patch. Regards, Marek On 07/28/2015 05:51 PM,

[PATCH wayland v3 3/3] scanner: use zxalloc

2015-07-30 Thread Marek Chalupa
Use xzalloc instead of xmalloc. This allows us to get rid of manual initializing the memory to 0s and the code is shorter and cleaner Suggested by Bryce Harrington Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 83

[PATCH wayland v3 1/3] scanner: refactor creating objects

2015-07-30 Thread Marek Chalupa
wrap creating and initializing objects (structures) into functions and use them in the code. v2. make create_.* functions consistent (no func will return NULL) Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 164

[PATCH wayland v3 2/3] scanner: get rid of leaks

2015-07-30 Thread Marek Chalupa
Free all the memory we have allocated during running. v2.: split creating objects and getting rid of leaks into two patches move check for NULL description into free_description v3.: rebase after previous patch fixes Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c

Re: [RFC wayland 2/2] protocol: Don't silently fail to create seat device objects

2015-07-30 Thread Marek Chalupa
On 07/30/2015 04:33 AM, Jonas Ådahl wrote: One of the principles of Wayland is that object creation never fails. If the object cannot be created, it should be reported as a protocol error and an offending client should be terminated. A current violation to this principle is the input device

Re: [RFC wayland 1/2] doc: Add a paragraph about the object creation guarantee

2015-07-30 Thread Marek Chalupa
Hi, On 07/30/2015 04:33 AM, Jonas Ådahl wrote: One of the principles of the Wayland protocol is that object creation always succeeds. If the server for some reason cannot create a valid object as a response to some request, this would typically be caused by a protocol violation and in such

[PATCH wayland] scanner: check sanity of version

2015-07-30 Thread Marek Chalupa
scanner does not complain if we put into version attribute things like -1 1x 1:3 etc. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/scanner.c b/src/scanner.c

Re: [PATCH] xwayland-input: Always set the xkb group index on modifiers events

2015-07-30 Thread Marek Chalupa
XkbAllModifiersMask; +XkbLatchModifiers(dev, XkbAllModifiersMask, + mods_latched XkbAllModifiersMask); +} I believe here it would deserve a comment why we care about the focus and why the group is updated unconditionally. Reviewed-by: Marek Chalupa

Re: [PATCH wayland v2 1/2] scanner: refactor creating objects

2015-07-27 Thread Marek Chalupa
Hi, thanks for review. On 07/23/2015 08:41 PM, Bryce Harrington wrote: On Thu, Jul 23, 2015 at 07:39:30AM +0200, Marek Chalupa wrote: wrap creating and initializing objects (structures) into functions and use them in the code. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src

Re: [PATCH wayland v2 2/2] scanner: get rid of leaks

2015-07-27 Thread Marek Chalupa
On 07/23/2015 08:50 PM, Bryce Harrington wrote: On Thu, Jul 23, 2015 at 07:39:31AM +0200, Marek Chalupa wrote: Free all the memory we have allocated during running. v2.: split creating objects and getting rid of leaks into two patches move check for NULL description

[PATCH wayland-web] extras: add wldbg tool

2015-07-23 Thread Marek Chalupa
wldbg is a tool for debugging wayland applications Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- extras.html | 6 ++ 1 file changed, 6 insertions(+) diff --git a/extras.html b/extras.html index 55ff35c..eba7133 100644 --- a/extras.html +++ b/extras.html @@ -120,6 +120,12 @@ act

Re: [PATCH] wayland-server: Fix null pointer dereferencing

2015-07-23 Thread Marek Chalupa
On 07/16/2015 09:37 AM, Marek Chalupa wrote: On 07/16/2015 09:27 AM, Marek Chalupa wrote: Nice catch (some static analysis tool? :). I'm not sure if this is the right way to fix it, though. If somebody calls wl_resource_post_error with NULL resource, it is his fault and program should

Re: announcing wldbg

2015-07-23 Thread Marek Chalupa
On 07/23/2015 11:22 AM, Pekka Paalanen wrote: On Wed, 22 Jul 2015 16:27:46 +0200 Marek Chalupa mchqwe...@gmail.com wrote: Hi folks, It's been some time since I started developing a tool called wldbg in my free time. I'm using it while debugging applications based on wayland and I think

Re: [PATCH wayland 1/2] scanner: refactor creating objects and get rid of leaks

2015-07-22 Thread Marek Chalupa
Thanks for review, On 07/17/2015 11:02 PM, Derek Foreman wrote: On 16/07/15 06:59 AM, Marek Chalupa wrote: Create functions for structures allocation (instead of inlining it into the code) and free the objects after we don't use them anymore. Signed-off-by: Marek Chalupa mchqwe...@gmail.com

Re: [PATCH wayland 1/2] scanner: refactor creating objects and get rid of leaks

2015-07-22 Thread Marek Chalupa
On 07/22/2015 07:43 PM, Derek Foreman wrote: On 22/07/15 02:25 AM, Marek Chalupa wrote: Thanks for review, On 07/17/2015 11:02 PM, Derek Foreman wrote: On 16/07/15 06:59 AM, Marek Chalupa wrote: Create functions for structures allocation (instead of inlining it into the code) and free

[PATCH wayland v2 2/2] scanner: get rid of leaks

2015-07-22 Thread Marek Chalupa
Free all the memory we have allocated during running. v2.: split creating objects and getting rid of leaks into two patches move check for NULL description into free_description Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 110

[PATCH wayland v2 1/2] scanner: refactor creating objects

2015-07-22 Thread Marek Chalupa
wrap creating and initializing objects (structures) into functions and use them in the code. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 158 ++ 1 file changed, 105 insertions(+), 53 deletions(-) diff --git a/src

announcing wldbg

2015-07-22 Thread Marek Chalupa
Hi folks, It's been some time since I started developing a tool called wldbg in my free time. I'm using it while debugging applications based on wayland and I think it is in enough good shape to bring it out (although there is still a lot of missing features I'd like to add/fix) It can work

Re: [PATCH weston] logind-util: Use %u for unsigned int in snprintf

2015-07-20 Thread Marek Chalupa
On Fri, Jul 17, 2015 at 2:06 PM, Pekka Paalanen ppaala...@gmail.com wrote: On Wed, 1 Jul 2015 12:29:00 +0200 Marek Chalupa mchqwe...@gmail.com wrote: sizeof operator returns size_t, which need not to be unsigned int, but can be long (long) unsigned int. So here the correct fix should

Re: [PATCH] wayland-server: Fix null pointer dereferencing

2015-07-16 Thread Marek Chalupa
Nice catch (some static analysis tool? :). I'm not sure if this is the right way to fix it, though. If somebody calls wl_resource_post_error with NULL resource, it is his fault and program should crash to reveal this error. So the right fix in this case would be to delete

Re: [PATCH] wayland-server: Fix null pointer dereferencing

2015-07-16 Thread Marek Chalupa
On 07/16/2015 09:22 AM, Giulio Camuffo wrote: 2015-07-16 9:27 GMT+03:00 Ashim ashim.s...@samsung.com: Initialising 'wl_client *client = NULL' and checking 'resource' for NULL and returning if found. This patch will avoid dereferencing of 'resource' if NULL I think in this case passing a

Re: [PATCH] wayland-server: Fix null pointer dereferencing

2015-07-16 Thread Marek Chalupa
On 07/16/2015 09:27 AM, Marek Chalupa wrote: Nice catch (some static analysis tool? :). I'm not sure if this is the right way to fix it, though. If somebody calls wl_resource_post_error with NULL resource, it is his fault and program should crash to reveal this error. So the right fix

[PATCH wayland 2/2] scanner: wrap few long lines

2015-07-16 Thread Marek Chalupa
Wrap few long lines to the length around 80 chars Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/scanner.c b/src/scanner.c index c652612..ac511f1 100644 --- a/src/scanner.c +++ b/src

[PATCH wayland 1/2] scanner: refactor creating objects and get rid of leaks

2015-07-16 Thread Marek Chalupa
Create functions for structures allocation (instead of inlining it into the code) and free the objects after we don't use them anymore. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- src/scanner.c | 266 +- 1 file changed, 209

Re: [PATCH v2 3/3] xwayland: Destroy xwl_output when wl_output gets removed

2015-07-15 Thread Marek Chalupa
before, I'm not in favor of patch 1 in this series. However, this patch needs patch 1 to work properly, so I'm in for using the version 1 of patch 1 (http://lists.freedesktop.org/archives/wayland-devel/2015-May/021909.html) With above mentioned this series is: Reviewed-by: Marek Chalupa

Re: [PATCH v2 2/3] xwayland: Remove a useless out-of-memory check

2015-07-15 Thread Marek Chalupa
Reviewed-by: Marek Chalupa mchqwe...@gmail.com (http://lists.freedesktop.org/archives/wayland-devel/2015-May/021952.html) On 05/16/2015 07:38 AM, Dima Ryazanov wrote: snprintf does not allocate memory, so we can never get an out-of-memory error. (Also, the error handler would free xwl_output

Re: [PATCH xwayland v2] xwayland: do not add output into output_list multiple times

2015-07-15 Thread Marek Chalupa
On 05/21/2015 03:43 PM, Marek Chalupa wrote: output.done event can be sent even on some property change, not only when announcing the output. Therefore we must check if we already have it otherwise we may corrupt the list by adding it multiple times. This fixes bug when xwayland looped

Re: [PATCH v2 3/3] xwayland: Destroy xwl_output when wl_output gets removed

2015-07-15 Thread Marek Chalupa
, this does not happen. And sometimes weston crashes, but it is probably different (weston's) bug. Looks like caused by call to RRCrtcDestroy in xwl_output_destroy, any idea why? I don't know much about X's internals... On 07/15/2015 11:21 AM, Marek Chalupa wrote: On 05/16/2015 07:38 AM, Dima

Re: [PATCH weston v2] logind-util: Use %lu for unsigned int in snprintf

2015-07-15 Thread Marek Chalupa
Reviewed-by: Marek Chalupa mchqwe...@gmail.com On Sat, Jul 11, 2015 at 4:51 AM, Bryce Harrington br...@osg.samsung.com wrote: Addresses this warning found by Denis Denisov: [src/logind-util.c:702]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned

Re: [PATCH] xwayland: Check return of xcb_get_property_reply() before deref

2015-07-10 Thread Marek Chalupa
On 07/10/2015 06:30 AM, Bryce Harrington wrote: From the man pages it appears this routine can return NULL on certain error conditions. Suggested by Marek Chalupa Signed-off-by: Bryce Harrington br...@osg.samsung.com --- xwayland/selection.c | 6 ++ 1 file changed, 6 insertions

[PATCH] fixed-benchmark: remove unused arguments in main

2015-07-03 Thread Marek Chalupa
Fixed benchmark uses main(int argc, char *argv[]) but does not use the arguments, so we can replace them with void Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/fixed-benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixed-benchmark.c b/tests

Re: [PATCH] xwayland: Always free reply from xcb_get_property_reply()

2015-07-01 Thread Marek Chalupa
. Reviewed-by: Marek Chalupa mchqwe...@gmail.com ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Re: [RFC wayland 1/2] client: Introduce 'proxy wrapper' concept

2015-07-01 Thread Marek Chalupa
On Wed, Jul 1, 2015 at 10:10 AM, Jonas Ådahl jad...@gmail.com wrote: On Wed, Jul 01, 2015 at 09:51:41AM +0200, Marek Chalupa wrote: On Wed, Jul 1, 2015 at 9:16 AM, Jonas Ådahl jad...@gmail.com wrote: On Wed, Jul 01, 2015 at 08:57:05AM +0200, Marek Chalupa wrote: On Mon, Jun 29, 2015

Re: [PATCH] weston-launch: Drop redundant exit()

2015-07-01 Thread Marek Chalupa
Reviewed-by: Marek Chalupa mchqwe...@gmail.com On Sat, Jun 20, 2015 at 12:47 AM, Bryce Harrington br...@osg.samsung.com wrote: error(1, ...) already will exit, per man page: If status has a nonzero value, then error() calls exit(3) to terminate the program using the given value as the exit

Re: [PATCH wayland 3/3] shm: wl_shm_buffer_get_data() requires a valid pool.

2015-07-01 Thread Marek Chalupa
On Fri, Jun 26, 2015 at 6:35 PM, Derek Foreman der...@osg.samsung.com wrote: There's no situation where a shm buffer without a pool makes sense, so we enforce the pool's existence a little more rigidly. Signed-off-by: Derek Foreman der...@osg.samsung.com --- src/wayland-shm.c | 10

Re: [PATCH weston] clients: Simplify memory allocation with xzalloc()

2015-07-01 Thread Marek Chalupa
Reviewed-by: Marek Chalupa mchqwe...@gmail.com On Sat, Jun 20, 2015 at 1:12 AM, Bryce Harrington br...@osg.samsung.com wrote: It is redundant to check x*alloc's return value for null pointers, since they are guaranteed to either return non-NULL or terminate the program. In cases where we

Re: [PATCH wayland 3/3] shm: wl_shm_buffer_get_data() requires a valid pool.

2015-07-01 Thread Marek Chalupa
On Wed, Jul 1, 2015 at 11:25 AM, Marek Chalupa mchqwe...@gmail.com wrote: On Fri, Jun 26, 2015 at 6:35 PM, Derek Foreman der...@osg.samsung.com wrote: There's no situation where a shm buffer without a pool makes sense, so we enforce the pool's existence a little more rigidly. Signed-off

Re: [PATCH] scanner: Close input resource when done to prevent leak

2015-07-01 Thread Marek Chalupa
To be up to good programming practices we should close the input even on the error paths on lines 1381, 1392 and 1400 (it can be stdin, but on exit it doesn't matter). Scanner is sooo leaky, that pedantically closing read-only input file on every error path may seem a little bit useless, but it is

Re: [PATCH weston] logind-util: Use %u for unsigned int in snprintf

2015-07-01 Thread Marek Chalupa
sizeof operator returns size_t, which need not to be unsigned int, but can be long (long) unsigned int. So here the correct fix should be either to use %zu (since C99) or cast it to unsigned long and use %lu Regards, Marek On Sat, Jun 20, 2015 at 1:28 AM, Bryce Harrington br...@osg.samsung.com

Re: [RFC wayland 1/2] client: Introduce 'proxy wrapper' concept

2015-07-01 Thread Marek Chalupa
On Mon, Jun 29, 2015 at 3:37 PM, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-06-29 14:30 GMT+03:00 Jonas Ådahl jad...@gmail.com: Arnaud Vrac discovered an issue in the libwayland client API causing race conditions when doing round trips using the wl_display object using non-default

Re: [RFC wayland 1/2] client: Introduce 'proxy wrapper' concept

2015-07-01 Thread Marek Chalupa
On Wed, Jul 1, 2015 at 9:16 AM, Jonas Ådahl jad...@gmail.com wrote: On Wed, Jul 01, 2015 at 08:57:05AM +0200, Marek Chalupa wrote: On Mon, Jun 29, 2015 at 3:37 PM, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-06-29 14:30 GMT+03:00 Jonas Ådahl jad...@gmail.com: Arnaud Vrac

Re: [PATCH xwayland] xwayland: do not add output into output_list multiple times

2015-05-21 Thread Marek Chalupa
at 9:37 AM, Dima Ryazanov d...@gmail.com wrote: Oh wow, I was playing around with outputs, and never realized output_handle_done was being called after any geometry change, not just after the output was created. On Thu, May 14, 2015 at 2:58 AM, Marek Chalupa mchqwe...@gmail.com wrote

Re: [PATCH v2 1/3] xwayland: Fix the addition and removal of outputs

2015-05-21 Thread Marek Chalupa
Hi, On Sat, May 16, 2015 at 7:38 AM, Dima Ryazanov d...@gmail.com wrote: Add the output to the list when it's created rather than when its properties change (as pointed out by Marek Chalupa). Remove the output from the list when it's destroyed. Signed-off-by: Dima Ryazanov d...@gmail.com

[PATCH xwayland v2] xwayland: do not add output into output_list multiple times

2015-05-21 Thread Marek Chalupa
common code into function move expecting_events into right branch Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- hw/xwayland/xwayland-output.c | 42 ++ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b

Re: [PATCH xwayland] xwayland: do not add output into output_list multiple times

2015-05-21 Thread Marek Chalupa
Hi, On Thu, May 14, 2015 at 6:37 PM, Dima Ryazanov d...@gmail.com wrote: Oh wow, I was playing around with outputs, and never realized output_handle_done was being called after any geometry change, not just after the output was created. On Thu, May 14, 2015 at 2:58 AM, Marek Chalupa

Re: [PATCH 2/4] xwayland: Remove a useless out-of-memory check

2015-05-14 Thread Marek Chalupa
Checking for negative return value of snprintf is wrong, but snprintf can actually fail. It can truncate the output. However, since sizeof name is 256 and the length of XWAYLAND%d is always shorter that this, it is safe here. Reviewed-by: Marek Chalupa mchqwe...@gmail.com On Tue, May 12, 2015

Re: [PATCH 3/4] xwayland: Keep a list of wayland globals

2015-05-14 Thread Marek Chalupa
On Tue, May 12, 2015 at 7:21 PM, Dima Ryazanov d...@gmail.com wrote: The logic is pretty much copied from weston's clients/window.c. Signed-off-by: Dima Ryazanov d...@gmail.com --- hw/xwayland/xwayland.c | 25 - hw/xwayland/xwayland.h | 8 2 files

[PATCH xwayland] xwayland: do not add output into output_list multiple times

2015-05-14 Thread Marek Chalupa
-by: Marek Chalupa mchqwe...@gmail.com --- hw/xwayland/xwayland-output.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 155cbc1..0c96e87 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw

[PATCH weston] xwm: flush xcb connection only when we processed some event

2015-05-14 Thread Marek Chalupa
And also write out a warning when we got some event that we cannot handle. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- xwayland/window-manager.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 039f0cd

Re: [PATCH wayland] introduce new headers wayland-client/server-core.h

2015-04-28 Thread Marek Chalupa
On Mon, Apr 27, 2015 at 4:06 PM, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-04-27 21:53 GMT+03:00 Bill Spitzak spit...@gmail.com: On 04/26/2015 11:48 PM, Marek Chalupa wrote: Is the --include-core-headers option necessary? Until now the scanner included wayland-client/server.h

Re: [PATCH 9/9] tests: Add test to verify tests' ini files get loaded

2015-04-03 Thread Marek Chalupa
On Fri, Apr 3, 2015 at 4:16 AM, Bryce Harrington br...@osg.samsung.com wrote: config-malformed uses an invalid configuration file to verify that the test harness is indeed attempting to load the test's requested config file. Signed-off-by: Bryce Harrington br...@osg.samsung.com ---

Re: [PATCH weston 2/9] tests: rename client_create to create_client_and_test_surface

2015-03-31 Thread Marek Chalupa
Hi, yep, I can confirm R-b for the two patches. Thanks, Marek On Tue, Mar 31, 2015 at 11:26 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Mon, 30 Mar 2015 06:52:37 -0400 Marek Chalupa mchqwe...@gmail.com wrote: Hehe, race in sending patches (I will have to rebase my patches I just

[PATCH wayland] protocol: add better description of wl_pointer.release

2015-03-30 Thread Marek Chalupa
Add note about what all wl_pointer.release does. Mainly that it destroys the proxy object, so programmer must not call wl_pointer_destroy() on the pointer any further. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- protocol/wayland.xml | 8 +++- 1 file changed, 7 insertions(+), 1

Re: [PATCH weston v2 5/5] tests: add tests for devices handling

2015-03-30 Thread Marek Chalupa
On Mon, Mar 30, 2015 at 8:22 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Mon, 30 Mar 2015 06:37:59 -0400 Marek Chalupa mchqwe...@gmail.com wrote: Test misc races when adding/releasing devices v2.: use one roundtrip after releasing devices add touch support Signed-off

[PATCH weston v2] tests: use special seat

2015-03-30 Thread Marek Chalupa
and then pick the one that we need and destroy the rest. The effect is the same, but this code is better understandable. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/weston-test-client-helper.c | 77 +-- tests/weston-test-client-helper.h | 9

[PATCH weston v2] tests: implement touch in test-helpers

2015-03-30 Thread Marek Chalupa
Let the client bind to wl_touch. Since we have our own seat, we know that the compositor will have wl_touch capability. v2: rebased due to changes in previous commit Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/weston-test-client-helper.c | 79

[PATCH weston v3] tests: add tests for devices handling

2015-03-30 Thread Marek Chalupa
Test misc races when adding/releasing devices v2.: use one roundtrip after releasing devices add touch support v3.: remove useless checks add few comments repeat tests 30 times instead of 100 times (it took too long, 30 is enough) Signed-off-by: Marek Chalupa mchqwe

[PATCH weston v2 3/5] tests: use special seat

2015-03-30 Thread Marek Chalupa
When running on different backends, we don't know what devices the backend provides. Create new seat for tests that contains everything what we need. This is also first step in adding touch support for tests. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/weston-test-client-helper.c

[PATCH weston v2 4/5] tests: implement touch in test-helpers

2015-03-30 Thread Marek Chalupa
Let the client bind to wl_touch. Since we have our own seat, we know that the compositor will have wl_touch capability. Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/weston-test-client-helper.c | 79 +++ tests/weston-test-client-helper.h | 13

[PATCH weston v2 2/5] tests: fix handling globals

2015-03-30 Thread Marek Chalupa
We used hard-coded version 1 for all globals. For testing newer methods and events we need use the current version of global. This patch fixes this and adds missing event handlers (for the events that were added in versions 1) Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- tests/weston

[PATCH weston v2 1/5] weston-test: add device_{release/add} into protocol

2015-03-30 Thread Marek Chalupa
This request simulates device creation/destruction from evdev (libinput) v2: added support for touch. Touch is not supported yet, but better be prepared Signed-off-by: Marek Chalupa mchqwe...@gmail.com --- protocol/weston-test.xml | 6 ++ tests/weston-test.c | 41

  1   2   3   4   >