Re: Return values in Wayland XML specification
In Wayland array can contain only integers. See how listing of outputs is done. Server creates one global `wl_output` per output, client binds to the global, server sends events with output parameters (list of modes among them) and then event `done` to indicate it stopped sending info about this output. You probably don't want one global per window. I'd go with one global `window_manager` which sends events (one per window) after bind and after creation of window (or on request, depending on your needs). ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Return values in Wayland XML specification
> On 26 Apr 2017, at 08:23, Pekka Paalanenwrote: > > If you need a client to receive something as a reply to a request, you > need to specify an event for delivering it. There are no shortcuts for > that, because each roundtrip makes everything a tiny bit slower, and > that accumulates. Therefore one should reconsider if a roundtrip is > really necessary, or if things could be designed to be asynchronous > instead. For example, getting a list of windows and returning it as an array. How would this be done? How are arrays represented in Wayland XML? Regards adlo ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH libinput 0/2] Small fixes
On Sun, May 14, 2017 at 04:33:15PM +0200, Gabriel Laskar wrote: > As said in > https://lists.freedesktop.org/archives/wayland-devel/2017-May/034074.html, we > probably can assume that offsetof will be supported by the compiler. > > Also some bugs came by: > * hwdb_parser.py assumes that python3 lives in /usr/bin, this forbid the usage > of virtualenv (or a python not installed in /usr/bin) > * The test suite seems broken on recent versions of libcheck, there is a > report > here: https://github.com/libcheck/check/issues/18. > > I have seen another issue in the usage of container_of, maybe I am wrong but > here, container_of takes a variable instead of a type name. This causes all > the > usages in the following files to have a unused variable in order for > container_of to work: > * src/evdev-lid.c > * src/evdev-mt-touchpad.h > * src/evdev-tablet.h > * src/evdev.h > > This requires minimal changes, but a change in the semantics of the version of > container_of that is used to match more closely the one used in the linux > kernel. > > Would you care for a patch for that? yeah, that would work for me. These two are pushed, thanks. 695facc1..cef2a095 master -> master Cheers, Peter > > Gabriel Laskar (2): > util: use offsetof in container_of > udev/hwdb_parser.py: use python3 from env instead of /usr/bin > > src/libinput-util.h | 5 +++-- > udev/parse_hwdb.py | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > > -- > 2.12.2 > > ___ > 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 libinput 1/2] util: use offsetof in container_of
gcc and clang supports offsetof (defined in stddef.h) as defined by C99 and POSIX.1-2001, use it in container_of. Signed-off-by: Gabriel Laskar--- src/libinput-util.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libinput-util.h b/src/libinput-util.h index 9ecded7..6d9bbe2 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -86,8 +87,8 @@ void list_remove(struct list *elm); bool list_empty(const struct list *list); #define container_of(ptr, sample, member) \ - (__typeof__(sample))((char *)(ptr) - \ -((char *)&((typeof(sample))0)->member)) + (__typeof__(sample))((char *)(ptr) -\ +offsetof(__typeof__(*sample), member)) #define list_for_each(pos, head, member) \ for (pos = 0, pos = container_of((head)->next, pos, member);\ -- 2.12.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH libinput 0/2] Small fixes
As said in https://lists.freedesktop.org/archives/wayland-devel/2017-May/034074.html, we probably can assume that offsetof will be supported by the compiler. Also some bugs came by: * hwdb_parser.py assumes that python3 lives in /usr/bin, this forbid the usage of virtualenv (or a python not installed in /usr/bin) * The test suite seems broken on recent versions of libcheck, there is a report here: https://github.com/libcheck/check/issues/18. I have seen another issue in the usage of container_of, maybe I am wrong but here, container_of takes a variable instead of a type name. This causes all the usages in the following files to have a unused variable in order for container_of to work: * src/evdev-lid.c * src/evdev-mt-touchpad.h * src/evdev-tablet.h * src/evdev.h This requires minimal changes, but a change in the semantics of the version of container_of that is used to match more closely the one used in the linux kernel. Would you care for a patch for that? Gabriel Laskar (2): util: use offsetof in container_of udev/hwdb_parser.py: use python3 from env instead of /usr/bin src/libinput-util.h | 5 +++-- udev/parse_hwdb.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) -- 2.12.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel