diff options
author | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2011-05-25 09:24:37 (GMT) |
---|---|---|
committer | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2011-05-25 12:24:16 (GMT) |
commit | dffe4d8d180e34955ebe23540e37ce7ba0d76853 (patch) | |
tree | b4be69feccf4bc9f016402bf8f307ecd7817c5db /src/3rdparty/wayland | |
parent | a6642e4659b3d45ffa94f9a3c6413124d49f2b91 (diff) | |
download | Qt-dffe4d8d180e34955ebe23540e37ce7ba0d76853.zip Qt-dffe4d8d180e34955ebe23540e37ce7ba0d76853.tar.gz Qt-dffe4d8d180e34955ebe23540e37ce7ba0d76853.tar.bz2 |
Add authentication token support for wayland windows
For compositors that support it, the wayland clients can associate themselves
with an auth token, specified by WL_AUTHENTICATION_TOKEN env var, or by
directly specifying it in the wayland client plugin.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/3rdparty/wayland')
-rw-r--r-- | src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h | 40 | ||||
-rw-r--r-- | src/3rdparty/wayland/wayland-windowmanager-protocol.c | 3 |
2 files changed, 36 insertions, 7 deletions
diff --git a/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h b/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h index ec776c5..73673ae 100644 --- a/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h +++ b/src/3rdparty/wayland/qwaylandwindowmanager-client-protocol.h @@ -36,16 +36,37 @@ struct wl_client; struct wl_windowmanager; +struct wl_proxy; + +extern void +wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...); +extern struct wl_proxy * +wl_proxy_create(struct wl_proxy *factory, + const struct wl_interface *interface); +extern struct wl_proxy * +wl_proxy_create_for_id(struct wl_display *display, + const struct wl_interface *interface, uint32_t id); +extern void +wl_proxy_destroy(struct wl_proxy *proxy); + +extern int +wl_proxy_add_listener(struct wl_proxy *proxy, + void (**implementation)(void), void *data); + +extern void +wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data); + +extern void * +wl_proxy_get_user_data(struct wl_proxy *proxy); + extern const struct wl_interface wl_windowmanager_interface; -#define WL_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS 0 +#define wl_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS 0 +#define wl_WINDOWMANAGER_AUTHENTICATE_WITH_TOKEN 1 static inline struct wl_windowmanager * -wl_windowmanager_create(struct wl_display *display, uint32_t id, uint32_t /*version*/) +wl_windowmanager_create(struct wl_display *display, uint32_t id) { - // ### does not run without latest wayland. must be enabled later - //wl_display_bind(display, id, "wl_windowmanager", version); - return (struct wl_windowmanager *) wl_proxy_create_for_id(display, &wl_windowmanager_interface, id); } @@ -72,7 +93,14 @@ static inline void wl_windowmanager_map_client_to_process(struct wl_windowmanager *wl_windowmanager, uint32_t processid) { wl_proxy_marshal((struct wl_proxy *) wl_windowmanager, - WL_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS, processid); + wl_WINDOWMANAGER_MAP_CLIENT_TO_PROCESS, processid); +} + +static inline void +wl_windowmanager_authenticate_with_token(struct wl_windowmanager *wl_windowmanager, const char *wl_authentication_token) +{ + wl_proxy_marshal((struct wl_proxy *) wl_windowmanager, + wl_WINDOWMANAGER_AUTHENTICATE_WITH_TOKEN, wl_authentication_token); } #ifdef __cplusplus diff --git a/src/3rdparty/wayland/wayland-windowmanager-protocol.c b/src/3rdparty/wayland/wayland-windowmanager-protocol.c index 48049d8..0250801 100644 --- a/src/3rdparty/wayland/wayland-windowmanager-protocol.c +++ b/src/3rdparty/wayland/wayland-windowmanager-protocol.c @@ -26,7 +26,8 @@ #include "wayland-util.h" static const struct wl_message wl_windowmanager_requests[] = { - { "map_client_to_process", "u", NULL }, + { "map_client_to_process", "u" }, + { "authenticate_with_token", "s" }, }; WL_EXPORT const struct wl_interface wl_windowmanager_interface = { |