Skip to content
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

Merged
2 commits merged into from Sep 21, 2019
Merged

Conversation

Dudemanguy
Copy link
Member

@Dudemanguy Dudemanguy commented Feb 27, 2019

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 and set_cursor_visibility(wl, wl->cursor_visible) is more than clear and sufficient. I left reset_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.

@Dudemanguy Dudemanguy force-pushed the fix-wayland-cursor branch 2 times, most recently from 8eb79a5 to 6740fb0 Compare February 28, 2019 00:40
video/out/wayland_common.c Outdated Show resolved Hide resolved
@zc62
Copy link
Contributor

zc62 commented Feb 28, 2019

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.

@Dudemanguy
Copy link
Member Author

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.

@zc62
Copy link
Contributor

zc62 commented Feb 28, 2019

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.

@Dudemanguy
Copy link
Member Author

Dudemanguy commented Mar 1, 2019

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.

t-8ch and others added 2 commits May 3, 2019 18:55
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>
@Dudemanguy
Copy link
Member Author

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.

@t-8ch
Copy link
Contributor

t-8ch commented Jul 24, 2019

@jeeb Any chance you could have a look at this?

@ghost ghost merged commit cdad5cc into mpv-player:master Sep 21, 2019
@Dudemanguy Dudemanguy deleted the fix-wayland-cursor branch September 21, 2019 15:08
This pull request was closed.
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.

Gnome Wayland: mpv only hides the cursor if I move it
4 participants