@ -1578,7 +1578,7 @@ static void dataSourceHandleTarget(void* userData,
struct wl_data_source * source ,
struct wl_data_source * source ,
const char * mimeType )
const char * mimeType )
{
{
if ( _glfw . wl . data Source ! = source )
if ( _glfw . wl . selection Source ! = source )
{
{
_glfwInputError ( GLFW_PLATFORM_ERROR ,
_glfwInputError ( GLFW_PLATFORM_ERROR ,
" Wayland: Unknown clipboard data source " ) ;
" Wayland: Unknown clipboard data source " ) ;
@ -1595,7 +1595,7 @@ static void dataSourceHandleSend(void* userData,
size_t len = strlen ( string ) ;
size_t len = strlen ( string ) ;
int ret ;
int ret ;
if ( _glfw . wl . data Source ! = source )
if ( _glfw . wl . selection Source ! = source )
{
{
_glfwInputError ( GLFW_PLATFORM_ERROR ,
_glfwInputError ( GLFW_PLATFORM_ERROR ,
" Wayland: Unknown clipboard data source " ) ;
" Wayland: Unknown clipboard data source " ) ;
@ -1643,14 +1643,14 @@ static void dataSourceHandleCancelled(void* userData,
{
{
wl_data_source_destroy ( source ) ;
wl_data_source_destroy ( source ) ;
if ( _glfw . wl . data Source ! = source )
if ( _glfw . wl . selection Source ! = source )
{
{
_glfwInputError ( GLFW_PLATFORM_ERROR ,
_glfwInputError ( GLFW_PLATFORM_ERROR ,
" Wayland: Unknown clipboard data source " ) ;
" Wayland: Unknown clipboard data source " ) ;
return ;
return ;
}
}
_glfw . wl . data Source = NULL ;
_glfw . wl . selection Source = NULL ;
}
}
static const struct wl_data_source_listener dataSourceListener = {
static const struct wl_data_source_listener dataSourceListener = {
@ -1661,10 +1661,10 @@ static const struct wl_data_source_listener dataSourceListener = {
void _glfwSetClipboardStringWayland ( const char * string )
void _glfwSetClipboardStringWayland ( const char * string )
{
{
if ( _glfw . wl . data Source)
if ( _glfw . wl . selection Source)
{
{
wl_data_source_destroy ( _glfw . wl . data Source) ;
wl_data_source_destroy ( _glfw . wl . selection Source) ;
_glfw . wl . data Source = NULL ;
_glfw . wl . selection Source = NULL ;
}
}
char * copy = _glfw_strdup ( string ) ;
char * copy = _glfw_strdup ( string ) ;
@ -1678,9 +1678,9 @@ void _glfwSetClipboardStringWayland(const char* string)
_glfw_free ( _glfw . wl . clipboardSendString ) ;
_glfw_free ( _glfw . wl . clipboardSendString ) ;
_glfw . wl . clipboardSendString = copy ;
_glfw . wl . clipboardSendString = copy ;
_glfw . wl . data Source =
_glfw . wl . selection Source =
wl_data_device_manager_create_data_source ( _glfw . wl . dataDeviceManager ) ;
wl_data_device_manager_create_data_source ( _glfw . wl . dataDeviceManager ) ;
if ( ! _glfw . wl . data Source)
if ( ! _glfw . wl . selection Source)
{
{
_glfwInputError ( GLFW_PLATFORM_ERROR ,
_glfwInputError ( GLFW_PLATFORM_ERROR ,
" Wayland: Failed to create clipboard data source " ) ;
" Wayland: Failed to create clipboard data source " ) ;
@ -1688,12 +1688,12 @@ void _glfwSetClipboardStringWayland(const char* string)
_glfw . wl . clipboardSendString = NULL ;
_glfw . wl . clipboardSendString = NULL ;
return ;
return ;
}
}
wl_data_source_add_listener ( _glfw . wl . data Source,
wl_data_source_add_listener ( _glfw . wl . selection Source,
& dataSourceListener ,
& dataSourceListener ,
NULL ) ;
NULL ) ;
wl_data_source_offer ( _glfw . wl . data Source, " text/plain;charset=utf-8 " ) ;
wl_data_source_offer ( _glfw . wl . selection Source, " text/plain;charset=utf-8 " ) ;
wl_data_device_set_selection ( _glfw . wl . dataDevice ,
wl_data_device_set_selection ( _glfw . wl . dataDevice ,
_glfw . wl . data Source,
_glfw . wl . selection Source,
_glfw . wl . serial ) ;
_glfw . wl . serial ) ;
}
}
@ -1719,14 +1719,14 @@ const char* _glfwGetClipboardStringWayland(void)
int ret ;
int ret ;
size_t len = 0 ;
size_t len = 0 ;
if ( ! _glfw . wl . data Offer)
if ( ! _glfw . wl . selection Offer)
{
{
_glfwInputError ( GLFW_FORMAT_UNAVAILABLE ,
_glfwInputError ( GLFW_FORMAT_UNAVAILABLE ,
" Wayland: No clipboard data available " ) ;
" Wayland: No clipboard data available " ) ;
return NULL ;
return NULL ;
}
}
if ( _glfw . wl . data Source)
if ( _glfw . wl . selection Source)
return _glfw . wl . clipboardSendString ;
return _glfw . wl . clipboardSendString ;
ret = pipe2 ( fds , O_CLOEXEC ) ;
ret = pipe2 ( fds , O_CLOEXEC ) ;
@ -1738,7 +1738,7 @@ const char* _glfwGetClipboardStringWayland(void)
return NULL ;
return NULL ;
}
}
wl_data_offer_receive ( _glfw . wl . data Offer, " text/plain;charset=utf-8 " , fds [ 1 ] ) ;
wl_data_offer_receive ( _glfw . wl . selection Offer, " text/plain;charset=utf-8 " , fds [ 1 ] ) ;
flushDisplay ( ) ;
flushDisplay ( ) ;
close ( fds [ 1 ] ) ;
close ( fds [ 1 ] ) ;