vim icon indicating copy to clipboard operation
vim copied to clipboard

gvim (on Wayland) uses legacy X11 cursor names which are missing in GDK4

Open pbabinca opened this issue 10 months ago • 6 comments

Steps to reproduce

  1. In a terminal run GVIM_ENABLE_WAYLAND=1 gvim --clean -d /etc/passwd /etc/passwd - gvimdiff with enabled wayland with any files.
  2. With a mouse cursor click on a separator of windows.
  3. 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


pbabinca avatar Mar 18 '25 12:03 pbabinca

I believe this is connected with:

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.

pbabinca avatar Mar 18 '25 12:03 pbabinca

IMHO correct way would be to adapt gvim's code.

So you want to go ahead with a PR then?

chrisbra avatar Mar 18 '25 17:03 chrisbra

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 avatar Mar 19 '25 09:03 pbabinca

@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.

dvogel avatar Apr 27 '25 14:04 dvogel

@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:

  1. install build deps - I'm not sure which all are needed,

  2. in git checkout of master branch, src directory:

./configure --enable-gnome-check --with-x=yes --enable-gui=gtk-3 --with-gnome && make
  1. 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
  1. install it in the system:
sudo make install
  1. test it out as above to make sure that the issue still appears

  2. switch to Drew's pull request

  3. run same configure as above, make and sudo make install.

  4. test it out as above

pbabinca avatar Apr 30 '25 09:04 pbabinca

Thanks for testing it @pbabinca.

@chrisbra I've rebased the branch to be current and marked the PR as ready for review.

dvogel avatar May 04 '25 15:05 dvogel

@chrisbra Since you merged these changes in https://github.com/vim/vim/pull/14610#issuecomment-2860012787 I think this issue can be closed.

dvogel avatar Oct 04 '25 12:10 dvogel

Thanks, closing then

chrisbra avatar Oct 04 '25 16:10 chrisbra