gvim (on Wayland) uses legacy X11 cursor names which are missing in GDK4
Steps to reproduce
- In a terminal run
GVIM_ENABLE_WAYLAND=1 gvim --clean -d /etc/passwd /etc/passwd- gvimdiff with enabled wayland with any files. - With a mouse cursor click on a separator of windows.
- In the terminal a message is displayed: "Gdk-Message: 12:21:46.527: Unable to load sizing from the cursor theme"
Expected behaviour
No message or warning is displayed in the terminal.
Version of Vim
9.1.1169
Environment
Operating system: Fedora 41
Gnome: 47
Wayland
Adwaita (cursor) theme - adwaita-cursor-theme-47.0-1.fc41.noarch
Logs and stack traces
I believe this is connected with:
- Issue Drop Legacy X11 cursors and its MR cursors: only use gtk/css names on 2023-11-08,
- later build: Reinstate symlinks from legacy names to closest CSS names on 2024-02-19 restored some X11 cursor names
There are more X11 cursor names used by gvim but there are no compatibility links:
-
x_cursor- I'm not sure how to reproduce this, I only found it in the terminal -
right_ptr- with non-clean configuration, but I'm not sure which all settings is necessary; when selecting text with a cursor.
On my system:
$ ls /usr/share/icons/Adwaita/cursors/{x_cursor,right_ptr,sizing}
ls: cannot access '/usr/share/icons/Adwaita/cursors/x_cursor': No such file or directory
ls: cannot access '/usr/share/icons/Adwaita/cursors/right_ptr': No such file or directory
ls: cannot access '/usr/share/icons/Adwaita/cursors/sizing': No such file or directory
and this could be worked around with symlinking to close-enough cursor names:
$ cd /usr/share/icons/Adwaita/cursors/
$ sudo ln -s not-allowed x_cursor
$ sudo ln -s default right_ptr
$ sudo ln -s move sizing
$ stat -c %N {x_cursor,right_ptr,sizing}
'x_cursor' -> 'not-allowed'
'right_ptr' -> 'default'
'sizing' -> 'move'
and restarting gvim. I think this does not belong to Adwaita upstream though since appearance/semantic of those cursors is different. IMHO correct way would be to adapt gvim's code.
IMHO correct way would be to adapt gvim's code.
So you want to go ahead with a PR then?
IMHO correct way would be to adapt gvim's code.
So you want to go ahead with a PR then?
I'm afraid I can't since I don't have any knowledge of vim's code to do this.
I hope it didn't sound that I pushed on maintainers or contributors to fix the issue that I reported.
With this sentence I meant to imply that I don't think it is a bug in Gnome or Adwaita or in their decision that broke backward compatibility which vim should rely on. But rather vim's code might need to be adapted to this new environment.
@pbabinca I have a draft PR open related to GTK's cursor naming changes: https://github.com/vim/vim/pull/14610. If you're able to use git to checkout that branch and compile vim from source, it would be helpful to know whether that change addresses your issue.
@pbabinca I have a draft PR open related to GTK's cursor naming changes: https://github.com/vim/vim/pull/14610. If you're able to use git to checkout that branch and compile vim from source, it would be helpful to know whether that change addresses your issue.
Yes it did solved my issue. Thanks for work on this!
For anybody to follow, roughly what I did:
-
install build deps - I'm not sure which all are needed,
-
in git checkout of
masterbranch,srcdirectory:
./configure --enable-gnome-check --with-x=yes --enable-gui=gtk-3 --with-gnome && make
- once it succeeded, make sure that no system/packaged gvim is installed - for some reason the issue happened to manifested when it was installed:
sudo dnf remove -y vim-X11
- install it in the system:
sudo make install
-
test it out as above to make sure that the issue still appears
-
switch to Drew's pull request
-
run same
configureas above,makeandsudo make install. -
test it out as above
Thanks for testing it @pbabinca.
@chrisbra I've rebased the branch to be current and marked the PR as ready for review.
@chrisbra Since you merged these changes in https://github.com/vim/vim/pull/14610#issuecomment-2860012787 I think this issue can be closed.
Thanks, closing then