mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 01:08:10 +02:00
Debug output: Show name and version of Wayland compositor
This commit is contained in:
@@ -315,6 +315,7 @@ def generate_wrappers(glfw_header: str) -> None:
|
||||
bool glfwWaylandSetTitlebarColor(GLFWwindow *handle, uint32_t color, bool use_system_color)
|
||||
void glfwWaylandRedrawCSDWindowTitle(GLFWwindow *handle)
|
||||
void glfwWaylandSetupLayerShellForNextWindow(GLFWLayerShellConfig c)
|
||||
pid_t glfwWaylandCompositorPID(void)
|
||||
unsigned long long glfwDBusUserNotify(const char *app_name, const char* icon, const char *summary, const char *body, \
|
||||
const char *action_text, int32_t timeout, GLFWDBusnotificationcreatedfun callback, void *data)
|
||||
void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler)
|
||||
|
||||
14
glfw/wl_init.c
vendored
14
glfw/wl_init.c
vendored
@@ -41,6 +41,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <wayland-client.h>
|
||||
// Needed for the BTN_* defines
|
||||
#ifdef __has_include
|
||||
@@ -815,6 +816,19 @@ GLFWAPI int glfwGetCurrentSystemColorTheme(void) {
|
||||
return glfw_current_system_color_theme();
|
||||
}
|
||||
|
||||
GLFWAPI pid_t glfwWaylandCompositorPID(void) {
|
||||
if (!_glfw.wl.display) return -1;
|
||||
int fd = wl_display_get_fd(_glfw.wl.display);
|
||||
if (fd < 0) return -1;
|
||||
struct ucred ucred;
|
||||
socklen_t len = sizeof(struct ucred);
|
||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) == -1) {
|
||||
perror("getsockopt failed");
|
||||
return -1;
|
||||
}
|
||||
return ucred.pid;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user