From 68a0a83b60890ef5d9719e5b00b3559751ea6d2b Mon Sep 17 00:00:00 2001 From: Hiroki Tagato Date: Fri, 29 Aug 2025 23:13:43 +0900 Subject: x11/waycheck: add port: Simple GUI that displays the protocols implemented by a Wayland compositor Waycheck is a simple Qt6 application that displays all of the Wayland protocols that your compositor supports, and all of the protocols that it doesn't support. It can be used to compare protocol support between compositors, or if you're working on your own compositor, to keep track of which protocols you still need to implement. WWW: https://gitlab.freedesktop.org/serebit/waycheck --- x11/waycheck/files/patch-src_window.cpp | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 x11/waycheck/files/patch-src_window.cpp (limited to 'x11/waycheck/files/patch-src_window.cpp') diff --git a/x11/waycheck/files/patch-src_window.cpp b/x11/waycheck/files/patch-src_window.cpp new file mode 100644 index 000000000000..6e976a9c5ffb --- /dev/null +++ b/x11/waycheck/files/patch-src_window.cpp @@ -0,0 +1,56 @@ +--- src/window.cpp.orig 2025-06-27 19:43:51 UTC ++++ src/window.cpp +@@ -13,7 +13,24 @@ + #include + #include + ++#if defined(__FreeBSD__) ++#include ++#include ++#include ++#include ++#include ++#endif ++ + static pid_t pid_from_fd(const int fd) { ++#if defined(__FreeBSD__) ++ xucred cred{}; ++ socklen_t len = sizeof(struct xucred); ++ if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERCRED, &cred, &len) == -1) { ++ perror("getsockopt failed"); ++ exit(1); ++ } ++ return cred.cr_pid; ++#else + ucred cred{}; + socklen_t len = sizeof(struct ucred); + if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) == -1) { +@@ -21,9 +38,19 @@ static pid_t pid_from_fd(const int fd) { + exit(1); + } + return cred.pid; ++#endif + } + + static std::string process_name_from_pid(const pid_t pid) { ++#if defined(__FreeBSD__) ++ struct kinfo_proc *proc = kinfo_getproc(pid); ++ ++ if (proc) { ++ std::string out = proc->ki_comm; ++ free(proc); ++ return out; ++ } ++#else + const std::string procpath = QString::asprintf("/proc/%d/comm", pid).toStdString(); + + std::ifstream infile(procpath); +@@ -38,7 +65,7 @@ static std::string process_name_from_pid(const pid_t p + // running in a flatpak or a snap, most likely + return "Unknown (Sandboxed)"; + } +- ++#endif + return "Unknown"; + } + -- cgit v1.2.3