mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Wayland: Return our clipboard without roundtrips
(cherry picked from commit 89d3ea8d69
)
This commit is contained in:
parent
75b27849f6
commit
c89899a428
@ -1860,6 +1860,9 @@ const char* _glfwPlatformGetClipboardString(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_glfw.wl.dataSource)
|
||||||
|
return _glfw.wl.clipboardSendString;
|
||||||
|
|
||||||
ret = pipe2(fds, O_CLOEXEC);
|
ret = pipe2(fds, O_CLOEXEC);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
@ -1870,10 +1873,9 @@ const char* _glfwPlatformGetClipboardString(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wl_data_offer_receive(_glfw.wl.dataOffer, "text/plain;charset=utf-8", fds[1]);
|
wl_data_offer_receive(_glfw.wl.dataOffer, "text/plain;charset=utf-8", fds[1]);
|
||||||
close(fds[1]);
|
|
||||||
|
|
||||||
// XXX: this is a huge hack, this function shouldn’t be synchronous!
|
flushDisplay();
|
||||||
handleEvents(NULL);
|
close(fds[1]);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user