Commit aeaa480b authored by David Edmundson's avatar David Edmundson
Browse files

Add API to record the socket name used by a given file descriptor

parent d0a0c70d
......@@ -50,12 +50,15 @@ Display::~Display()
wl_display_destroy(d->display);
}
bool Display::addSocketFileDescriptor(int fileDescriptor)
bool Display::addSocketFileDescriptor(int fileDescriptor, const QString &name)
{
if (wl_display_add_socket_fd(d->display, fileDescriptor)) {
qCWarning(KWAYLAND_SERVER, "Failed to add %d fd to display", fileDescriptor);
return false;
}
if (!name.isEmpty()) {
d->registerSocketName(name);
}
return true;
}
......
......@@ -57,10 +57,11 @@ public:
* returns @c true if the socket has been added successfully; otherwise returns @c false.
*
* The compositor can call this function even after the display has been started.
* @arg socketName can optionally be parsed to store the socket name represented by the given file-descriptor
*
* @see start()
*/
bool addSocketFileDescriptor(int fileDescriptor);
bool addSocketFileDescriptor(int fileDescriptor, const QString &socketName = QString());
/**
* Adds a UNIX socket with the specified @p name to the Wayland display. This function
* returns @c true if the socket has been added successfully; otherwise returns @c false.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment