mirror of
				https://github.com/vim/vim.git
				synced 2025-10-27 09:24:23 -04:00 
			
		
		
		
	patch 9.1.1784: Wayland code can be improved
Problem: Wayland code can be improved Solution: Refactor Wayland Clipboard code (Foxe Chen). This the second attempt to refactor the Wayland code base: - Move clipboard code from wayland.c to clipboard.c - Use C99 bool type - Properly poll the Wayland display file descriptor - Instead of checking if the data source is not NULL in order to determine if a selection event comes from us, use a special mime type to identify selection events coming from ourselves. The problem with the previous approach is that race conditions may occur. - Put the focus stealing code under a new feature "wayland_focus_steal" - Use ELAPSED_* macros instead of gettimeofday() - Pass tests - Reimplement commented out code - Update docs - Make Wayland clipboard behaviour more in line with X11 when connection is lost - add missing malloc checks and possible memory leaks + refactored some tests. closes: #18324 Signed-off-by: Foxe Chen <chen.foxe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
		
				
					committed by
					
						 Christian Brabandt
						Christian Brabandt
					
				
			
			
				
	
			
			
			
						parent
						
							70d745a61b
						
					
				
				
					commit
					368710abcf
				
			| @@ -682,15 +682,18 @@ vim_main2(void) | ||||
|     if (!gui.in_use) | ||||
| # endif | ||||
|     { | ||||
| 	if (wayland_init_client(wayland_display_name) == OK) | ||||
| 	sprintf(wayland_vim_special_mime, "application/x-vim-instance-%ld", | ||||
| 		mch_get_pid()); | ||||
|  | ||||
| 	if (wayland_init_connection(wayland_display_name) == OK) | ||||
| 	{ | ||||
| 	    TIME_MSG("connected to Wayland display"); | ||||
|  | ||||
| # ifdef FEAT_WAYLAND_CLIPBOARD | ||||
| 	    if (wayland_cb_init((char*)p_wse) == OK) | ||||
| 	    if (clip_init_wayland() == OK) | ||||
| 		TIME_MSG("setup Wayland clipboard"); | ||||
| 	} | ||||
| # endif | ||||
| 	} | ||||
|     } | ||||
| #endif | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user