Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
aeaa480b
Commit
aeaa480b
authored
Aug 16, 2021
by
David Edmundson
Browse files
Add API to record the socket name used by a given file descriptor
parent
d0a0c70d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/wayland/display.cpp
View file @
aeaa480b
...
...
@@ -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
;
}
...
...
src/wayland/display.h
View file @
aeaa480b
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment