-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Wayland Support #2046
Comments
I don't mind having Wayland support. Or, more correctly: I would be very happy if I could claim VimTeX works perfectly well on Wayland. As you say, the first step is to know exactly what is lacking on Wayland. As far as I know, the main hurdle is that the Zathura and MuPDF viewers rely on the Another obvious hurdle: I don't use Wayland yet myself. The main, and big, implication: I won't actively work to solve this issue. But I will be more than interested in helping anyone who is interested and able to suggest a solution!
Since I don't use Wayland myself, I think the main impact the thumbs up's may give here is attention to the issue, and perhaps motivation for someone who can help me solve this. |
I'm closing this now; not because I'm not interested in progress, but because I won't act on it myself. I would be very happy to see PRs or concrete suggestions, but as long as I don't use Wayland I will require active users who can help both with implementing and testing. |
Can we reopen this? I think its still valuable even if it isn't a priority right now. |
It's not about priority - instead, it is due to me not having any plan of working on it. I need (competent) users to help with this. I agree it is valuable! I can reopen and tag this as "help wanted" and "won't fix", though. |
Hello everyone. I'm using Wayland and I don't have the To auto reload Update |
Yes, that's probably right. Still, I'm not aware of any actual issues with this in my ~20 year experience with Linux and I am quite sure that this issue is not such a big deal. I'm no expert and of course, I can be wrong. In any case, I'm glad you got it working! |
My University's CS lab have migrated to a wayland-only login session (with fallback to linux console) on the shared lab computers. Have other users tried and tested vimtex on Wayland? What's the experience so far? |
I believe |
The Sway window manager lists a few potential alternatives for Wayland: https://github.com/swaywm/sway/wiki/i3-Migration-Guide#common-x11-apps-used-on-i3-with-wayland-alternatives |
So, one of these tools can be incorporated as a backend for automating the viewer interaction in VimTeX, right? There might be some complexity in detecting whether we are in |
Yes, I would believe so. I already noticed Specifically, we would need to implement something like these lines, except with Wayland options instead of vimtex/autoload/vimtex/view/_template.vim Lines 127 to 190 in dfaca59
Then one could copy zathura.vim and make a
Well, I wouldn't make it too complicated. As a first proof of concept, I would simply copy an existing viewer and make a new one (e.g. I would be more than happy to assist someone to make a PR! :) |
I have some time this week and I would like to help out. What would I need to do in a PR? |
As a first step, I would modify the existing vimtex/autoload/vimtex/view/_template.vim Lines 124 to 125 in 411a22a
In total, it is about 140 lines of code, so my suggestion would be to first read that code and try and understand what it does. The most important parts are the ones that concern finding the window ID, because it is the part that we use to ensure we only open a single instance. The last three functions are not so important, but nice to have. So: We need to know if there is something similar to the xwindow ID that we get from I would start with something like this:
|
Hmm, I noticed that there seems to be an issue - the three main |
Yes, that seems to be an issue. As mentioned, the main point of |
I agree; that would probably be the best approach (vs poking those who run the I looked at the source code for
A few considerations/thoughts against this approach:
Thoughts? |
Agreed. Of course, I won't mind if anyone did it and it works, but I would hope and more or less guess that it could be solved in a simpler way. For instance, perhaps it is sufficient to instead rely on inspecting processes with I mean, again, the main point is to avoid window duplication, which essentially means process duplication, right? |
Ah yes, that would probably be a bit more efficient. Perhaps I can start with testing something that if I can find duplicates using I think something like this is probably helpful as inspiration, so I'll probably try to take a similar approach with this, perhaps in Vim Script. What I have so far:
|
Notice, FYI, I already use vimtex/autoload/vimtex/view/zathura.vim Lines 68 to 82 in 5641242
Yes, great. That seems relevant. The less dependencies the better!
This is similar to what I already do for Zathura, specifically.
You will only have permissions if you are the user who owns the process. I think that should be more than sufficient. Also, I don't think we need to care about the window IDs anymore. Instead, we need to detect e.g. Zathura processes that has a specified file open. I'm thinking something like this:
|
Looks good to me! I think I have an idea of what could work then with inspiration from the psuedocode; however, when I was working with Other than that, I think I could try implementing the function in Vim Script as a standalone function first, then test this with the VimTeX plugin. On that note, do you have any insight on updating and testing code in VimTeX/plugins in general? Would it be just fork VimTeX, update code for Zathura, visual test using |
Strange. When I do
Sounds good. It could still be smart to rely on e.g.
In general, I use simple vimscript files for testing VimTeX combined with Makefiles for automatic testing. Most of VimTeX is under automatic tests in this way. You'll find the various tests under However, VimTeX + Zathura is hard to test automatically. So I haven't done that. Instead, I have simple examples or test cases that I can easily use for quickly doing manual testing. For this specific feature, the main idea is really to update the |
I can see the list and that I have permissions; however, when using any
Sounds good - what are some possible tests that I could do? |
Strange! I have no idea why this is happening on your side.. :\
Well, what we want is to avoid duplicate viewer instances. In this case, I would do something like this:
" test.vim
set nocompatible
set runtimepath^=~/.local/plugged/vimtex
set runtimepath+=~/.local/plugged/vimtex/after
filetype plugin indent on
syntax enable
nnoremap q :qall!<cr>
let g:vimtex_view_method = 'zathura'
let g:vimtex_view_forward_search_on_start = 0
silent edit test.tex
VimtexCompile
" give time to compile!
sleep 2
" If it works, then the following will not open multiple viewer windows
VimtexView
sleep 200m
VimtexView
sleep 200m
VimtexView
quitall The |
I see this issue has a |
Another question: Is this something that is limited by the inherent security permissions of the Wayland composer, or is there some way that a specific PDF reader could bypass ? |
Former. I did start drafting some stuff up but then I ended up moving to Sioyek where this isn't as relevant for me + lack the time to dedicate to it during the academic year. Can't speak as much to your other question but from what I gathered before some problems came from |
@evesdropper answered well; I (still) don't use Wayland, and so working on this particular feature has little value to me personally. And it is hard to work on without using Wayland. Thus, I don't close the issue as someone else may be interested and have the time and skills necessary - I'll be glad to help by reviewing code and discussing.
The problem in this particular case is that the tool PS! Is it ever correct to have a space before a question or exclamation mark? |
I spend quite some time trying to understand the existing code and writing a fix. I tried using However, for some reason the replacing the body of Tested:
What doesn't work is programmatically changing focus from Vim to Zathura within Vim (after I suppose this is all true, because testing for existence is easily done using |
This is more a test than anything else. I'm not sure it will actually work well yet. refer: #2046
This is a simpler version of the Zathura viewer that does not depend on xdotool. It should work better on systems that do not use Xorg, e.g. on Wayland. refer: #2046
First, thank you @rrueger for the effort of looking into this! I've closed your PR because I don't agree with the solution, but the work you did was useful because it seems to indicate that a nice solution for Zathura on Wayland is simply to ignore the |
I am proposing that #2639 is a solution for this issue. Please let me know if you think it is not a sufficient solution. @lorenzleutgeb |
Closing this as I think #2639 should suffice. Of course, feel free to object! |
Indeed. The reason is, that even once we get a "window id", we do nothing with it. Simply, because we can't. At the moment there are no tools for sending keys to specific windows in Wayland. Another issue, is that the notion of a window id in Wayland, appears to be compositor dependent. This means a In Sway, this can be easily done with
will return the sway specific window id. A cursory internet search shows that GNOME has no interface for listing open windows. |
Thanks for the info! |
This is a simpler version of the Zathura viewer that does not depend on xdotool. It should work better on systems that do not use Xorg, e.g. on Wayland. refer: #2046
Currently, some vimtex Features, e.g. cursor sync with Zathura, are not compatible with Wayland. I'd like to request making it compatible. This involves finding out which features are not compatible, first.
The topic has come up in (at least) the two issues linked below. I create this request to allow tracking of Wayland support and to invite other Wayland users to give their "thumbs up" to show its importance.
Is your feature request related to a problem?
Please refer to
#1775
#1719
Describe the solution you'd like
vimtex should support interaction with Wayland, with minimal user-configuration/-interaction.
Describe alternatives you've considered
None. Note that I don't think use "Use X11." is an alternative worth considering.
Additional context
None.
The text was updated successfully, but these errors were encountered: