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
wayland: match x11 cursor behavior #6525
Conversation
8eb79a5
to
6740fb0
Compare
Maybe better to edit the original commit so that the one line function never appears in the git history, rather than adding an extra commit to manually delete it later. |
The idea wasn't originally mine though (the reason why I forked it from the other PR to begin with), so I don't think it's appropriate to rewrite history like that. |
It is not uncommon to slightly modify the commit while maintaining the original authorship of that commit. I don't see why it is inappropriate to do that. Anyway, this is just my point of view. It's up to the members to decide if this is okay. |
Fair enough point. Personally, I prefer not to modify other people's commits directly, but certainly there are people that do that. And yeah, I'll happily go with whatever approach is preferred by mpv devs. |
479c4f6
to
42aa2eb
Compare
On wayland the cursor has to be configured each time the pointer enters. Currently if the window (re)gains the focus, the pointer is not hidden, even when configured. After the mouse has been moved the pointer hides correctly. https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer: wl_pointer::enter - enter event ... When a seat's focus enters a surface, the pointer image is undefined and a client should respond to this event by setting an appropriate pointer image with the set_cursor request. Fixes mpv-player#6185. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Revisiting this, I changed my mind and figured zc62 was right. It looks much cleaner. I went ahead and squashed those commits so now it's just two. Pinging @haasn and/or @atomnuker to take another look at this. |
@jeeb Any chance you could have a look at this? |
This is forked from #6480 with just a few more lines to fix what I had mentioned there. I only made this since there didn't seem to be any activity from @t-8ch. This also fixes #6185. On wayland, the cursor should automatically hide without having to move it (which is the current behavior). Also, the cursor shouldn't reappear when going to fullscreen (which is what happened with @t-8ch's fix).
Also as a side note, I personally don't really think it's necessary to define a whole new
reset_cursor
function. I think the name is misleading andset_cursor_visibility(wl, wl->cursor_visible)
is more than clear and sufficient. I leftreset_cursor
since like 50% of this is stolen from @t-8ch anyway, but I'll happily change it if the devs agree with me.I agree that my changes can be relicensed to LGPL 2.1 or later.