@ -2293,7 +2293,7 @@ void _glfwSetCursorWin32(_GLFWwindow* window, _GLFWcursor* cursor) 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					void  _glfwSetClipboardStringWin32 ( const  char *  string ) void  _glfwSetClipboardStringWin32 ( const  char *  string )  
			
		
	
		
		
			
				
					
					{ {  
			
		
	
		
		
			
				
					
					    int  characterCount ;      int  characterCount ,  tries  =  0 ;   
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    HANDLE  object ;      HANDLE  object ;   
			
		
	
		
		
			
				
					
					    WCHAR *  buffer ;      WCHAR *  buffer ;   
			
		
	
		
		
			
				
					
					
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -2321,12 +2321,20 @@ void _glfwSetClipboardStringWin32(const char* string) 
			
		
	
		
		
			
				
					
					    MultiByteToWideChar ( CP_UTF8 ,  0 ,  string ,  - 1 ,  buffer ,  characterCount ) ;      MultiByteToWideChar ( CP_UTF8 ,  0 ,  string ,  - 1 ,  buffer ,  characterCount ) ;   
			
		
	
		
		
			
				
					
					    GlobalUnlock ( object ) ;      GlobalUnlock ( object ) ;   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    if  ( ! OpenClipboard ( _glfw . win32 . helperWindowHandle ) )      // NOTE: Retry clipboard opening a few times as some other application may have it
   
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    //       open and also the Windows Clipboard History reads it after each update
   
			
		
	
		
		
			
				
					
					    while  ( ! OpenClipboard ( _glfw . win32 . helperWindowHandle ) )   
			
		
	
		
		
			
				
					
					    {      {   
			
		
	
		
		
			
				
					
					        _glfwInputErrorWin32 ( GLFW_PLATFORM_ERROR ,          Sleep ( 1 ) ;   
			
				
				
			
		
	
		
		
			
				
					
					                             " Win32: Failed to open clipboard " ) ;          tries + + ;   
			
				
				
			
		
	
		
		
			
				
					
					        GlobalFree ( object ) ;  
 
			
				
				
			
		
	
		
		
			
				
					
					        return ;          if  ( tries  = =  3 )   
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					        {   
			
		
	
		
		
			
				
					
					            _glfwInputErrorWin32 ( GLFW_PLATFORM_ERROR ,   
			
		
	
		
		
			
				
					
					                                 " Win32: Failed to open clipboard " ) ;   
			
		
	
		
		
			
				
					
					            GlobalFree ( object ) ;   
			
		
	
		
		
			
				
					
					            return ;   
			
		
	
		
		
			
				
					
					        }   
			
		
	
		
		
			
				
					
					    }      }   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    EmptyClipboard ( ) ;      EmptyClipboard ( ) ;   
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -2338,12 +2346,21 @@ const char* _glfwGetClipboardStringWin32(void) 
			
		
	
		
		
			
				
					
					{ {  
			
		
	
		
		
			
				
					
					    HANDLE  object ;      HANDLE  object ;   
			
		
	
		
		
			
				
					
					    WCHAR *  buffer ;      WCHAR *  buffer ;   
			
		
	
		
		
			
				
					
					    int  tries  =  0 ;   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    if  ( ! OpenClipboard ( _glfw . win32 . helperWindowHandle ) )      // NOTE: Retry clipboard opening a few times as some other application may have it
   
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    //       open and also the Windows Clipboard History reads it after each update
   
			
		
	
		
		
			
				
					
					    while  ( ! OpenClipboard ( _glfw . win32 . helperWindowHandle ) )   
			
		
	
		
		
			
				
					
					    {      {   
			
		
	
		
		
			
				
					
					        _glfwInputErrorWin32 ( GLFW_PLATFORM_ERROR ,          Sleep ( 1 ) ;   
			
				
				
			
		
	
		
		
			
				
					
					                             " Win32: Failed to open clipboard " ) ;          tries + + ;   
			
				
				
			
		
	
		
		
			
				
					
					        return  NULL ;  
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					        if  ( tries  = =  3 )   
			
		
	
		
		
			
				
					
					        {   
			
		
	
		
		
			
				
					
					            _glfwInputErrorWin32 ( GLFW_PLATFORM_ERROR ,   
			
		
	
		
		
			
				
					
					                                 " Win32: Failed to open clipboard " ) ;   
			
		
	
		
		
			
				
					
					            return  NULL ;   
			
		
	
		
		
			
				
					
					        }   
			
		
	
		
		
			
				
					
					    }      }   
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    object  =  GetClipboardData ( CF_UNICODETEXT ) ;      object  =  GetClipboardData ( CF_UNICODETEXT ) ;