util/uuid: replace with util/token, remove libuuid

Use 128-bit hexadecimal string tokens generated with /dev/urandom
instead of UUIDs for xdg-foreign handles, removing the libuuid
dependency. Update readme and CI. Closes #2830.

build: remove xdg-foreign feature

With no external dependencies required, there's no reason not to always
build it. Remove WLR_HAS_XDG_FOREIGN as well.
This commit is contained in:
Ryan Farley 2021-04-07 13:10:43 -05:00 committed by Simon Ser
parent 5a178c4a23
commit b29ac8fbac
14 changed files with 44 additions and 81 deletions

View file

@ -63,13 +63,9 @@ wlr_files += files(
'wlr_virtual_pointer_v1.c',
'wlr_xcursor_manager.c',
'wlr_xdg_decoration_v1.c',
'wlr_xdg_foreign_v1.c',
'wlr_xdg_foreign_v2.c',
'wlr_xdg_foreign_registry.c',
'wlr_xdg_output_v1.c',
)
if features.get('xdg-foreign')
wlr_files += files(
'wlr_xdg_foreign_v1.c',
'wlr_xdg_foreign_v2.c',
'wlr_xdg_foreign_registry.c',
)
endif

View file

@ -1,6 +1,6 @@
#include <wlr/types/wlr_xdg_foreign_registry.h>
#include "util/signal.h"
#include "util/uuid.h"
#include "util/token.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@ -9,7 +9,7 @@ bool wlr_xdg_foreign_exported_init(
struct wlr_xdg_foreign_exported *exported,
struct wlr_xdg_foreign_registry *registry) {
do {
if (!generate_uuid(exported->handle)) {
if (!generate_token(exported->handle)) {
return false;
}
} while (wlr_xdg_foreign_registry_find_by_handle(registry, exported->handle) != NULL);