Skip to content

Add wayland viewer workaround option g:vimtex_wayland#2633

Closed
rrueger wants to merge 1 commit intolervag:masterfrom
rrueger:master
Closed

Add wayland viewer workaround option g:vimtex_wayland#2633
rrueger wants to merge 1 commit intolervag:masterfrom
rrueger:master

Conversation

@rrueger
Copy link
Copy Markdown

@rrueger rrueger commented Feb 18, 2023

Attempts to fix #2046

More information at #2046 (comment)

I have not updated the documentation yet to reflect this change. @lervag I would need some pointers to do this (Where in the documentation hierarchy this should go, etc.)

Adding a g:vimtex_wayland option is somewhat conservative, since it ensures backward compatibility

@lervag
Copy link
Copy Markdown
Owner

lervag commented Feb 19, 2023

Thanks for looking into this and for suggesting a way forward!

Adding a g:vimtex_wayland option is somewhat conservative, since it ensures backward compatibility

Sorry, but this is not the direction I want to go. I've pushed a branch with an experimental alternative and will explain the idea in #2046.

Some comments:

I spend quite some time trying to understand the existing code and writing a fix. I tried using swaymsg to get window settings directly from sway (the Wayland Compositor in my case), using lsof and pgrep.

It is not surprising that this was not so trivial. I still believe it may be possible, but perhaps it is not necessary.

However, for some reason the replacing the body of s:viewer.xdo_find_win_id_by_pid() with return 1 fixes most of the functionality using Zathura under Sway.

This solution is not a solution, it is simply a hack that basically disables the xdotool stuff. However, it seems you are pointing out that the existing Zathura implementation in VimTeX works quite well for Wayland if we simply ignore the xdotool things that improve some quality of life. That is indeed interesting.

What doesn't work is programmatically changing focus from Vim to Zathura within Vim (after :VimtexView, focus stays on Vim)

And I don't know any good ways to achieve this without xdotool, sorry.

@lervag lervag closed this Feb 19, 2023
@lervag
Copy link
Copy Markdown
Owner

lervag commented Feb 19, 2023

Please see #2639 for the alternative approach from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: Wayland Support

2 participants