diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-15 13:47:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-15 13:58:34 +0900 |
| commit | a91920310d20e1fc472dea044fce8fd9438835df (patch) | |
| tree | 378cba47d8586e798130a2855f91a685e05244a3 /internal/system/wayland/wayland.go | |
| parent | 16e674782abbda8c85eac2e7d0c5c22e8cfbf5de (diff) | |
internal: relocate packages
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/system/wayland/wayland.go')
| -rw-r--r-- | internal/system/wayland/wayland.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/internal/system/wayland/wayland.go b/internal/system/wayland/wayland.go deleted file mode 100644 index 7a8694cd..00000000 --- a/internal/system/wayland/wayland.go +++ /dev/null @@ -1,48 +0,0 @@ -// Package wayland implements Wayland security_context_v1 protocol. -package wayland - -//go:generate sh -c "wayland-scanner client-header `pkg-config --variable=datarootdir wayland-protocols`/wayland-protocols/staging/security-context/security-context-v1.xml security-context-v1-protocol.h" -//go:generate sh -c "wayland-scanner private-code `pkg-config --variable=datarootdir wayland-protocols`/wayland-protocols/staging/security-context/security-context-v1.xml security-context-v1-protocol.c" - -/* -#cgo linux pkg-config: --static wayland-client -#cgo freebsd openbsd LDFLAGS: -lwayland-client - -#include "wayland-client-helper.h" -*/ -import "C" -import ( - "errors" - "strings" - "syscall" -) - -const ( - // Display contains the name of the server socket - // (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1147) - // which is concatenated with XDG_RUNTIME_DIR - // (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1171) - // or used as-is if absolute - // (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1176). - Display = "WAYLAND_DISPLAY" - - // FallbackName is used as the wayland socket name if WAYLAND_DISPLAY is unset - // (https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.1/src/wayland-client.c#L1149). - FallbackName = "wayland-0" -) - -var resErr = [...]error{ - 0: nil, - 1: errors.New("wl_display_connect_to_fd() failed"), - 2: errors.New("wp_security_context_v1 not available"), -} - -func bindWaylandFd(socketPath string, fd uintptr, appID, instanceID string, syncFd uintptr) error { - if hasNull(appID) || hasNull(instanceID) { - return syscall.EINVAL - } - res := C.hakurei_bind_wayland_fd(C.CString(socketPath), C.int(fd), C.CString(appID), C.CString(instanceID), C.int(syncFd)) - return resErr[int32(res)] -} - -func hasNull(s string) bool { return strings.IndexByte(s, 0) > -1 } |
