]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1725: Wayland code can be improved v9.1.1725
authorFoxe Chen <chen.foxe@gmail.com>
Mon, 1 Sep 2025 18:52:44 +0000 (20:52 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 1 Sep 2025 18:52:44 +0000 (20:52 +0200)
commitf50504a87b99daed032755122ba6a39aab7b7eb5
treeb5ecf73d9e49a97c2ba6941ff8361ed81b9de913
parent6a2d0496a1d72d6a8a1d9e053949532f8824df54
patch 9.1.1725: Wayland code can be improved

Problem:  Wayland code can be improved
Solution: Refactor Wayland Clipboard code (Foxe Chen)

This refactor makes the Wayland codebase less convoluted:
- Move clipboard code in 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: #18139

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
29 files changed:
Filelist
runtime/doc/builtin.txt
runtime/doc/gui_x11.txt
runtime/doc/options.txt
runtime/doc/tags
runtime/doc/various.txt
runtime/doc/wayland.txt
runtime/optwin.vim
src/Makefile
src/auto/configure
src/clipboard.c
src/config.h.in
src/configure.ac
src/evalfunc.c
src/feature.h
src/globals.h
src/main.c
src/option.c
src/option.h
src/optiondefs.h
src/optionstr.c
src/os_unix.c
src/proto/clipboard.pro
src/proto/wayland.pro
src/structs.h
src/testdir/test_wayland.vim
src/version.c
src/wayland.c
src/wayland.h [new file with mode: 0644]