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

Incorrect OSC+cursor interaction after leaving fullscreen #15967

Open
6 tasks done
fallingcats opened this issue Feb 26, 2025 · 1 comment · May be fixed by #15969
Open
6 tasks done

Incorrect OSC+cursor interaction after leaving fullscreen #15967

fallingcats opened this issue Feb 26, 2025 · 1 comment · May be fixed by #15969
Labels

Comments

@fallingcats
Copy link

fallingcats commented Feb 26, 2025

mpv Information

mpv v0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Nov 30 2024 08:18:38
libplacebo version: v7.349.0
FFmpeg version: n7.1
FFmpeg library versions:
   libavcodec      61.19.100
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

- Linux version: Arch Linux (2025-02-25)
- Kernel Version: 6.13.0-1-mainline-um5606
- GPU Model: Radeon 880M
- Mesa/GPU Driver Version: 24.3.4
- Window Manager and Version: KWin 6.3.1
- Source of mpv: ALHP Repo
- Latest known working version: -
- Issue started after the following happened: -

Reproduction Steps

I'd suspect it'd might be necessary to use a wayland compositor to reproduce

  1. OSC=always (not necessary but easier)
  2. move window to the top left with titlebar+borders offscreen
  3. remember the absolute position on screen where OSC elements are
  4. move the window anywhere
  5. enter fullscreen
  6. move the mouse to some position from step 3
  7. exit fullscreen without moving the mouse one pixel (keyboard and double click works)
  8. single click as often as you'd like on OSC elements while the cursor is somewhere else.

Expected Behavior

mpv should update the cursor position after entering/exiting fullscreen, because it will have moved relative to the window.

Actual Behavior

mpv seems to remember the position where the mouse was relative to the window origin while in fullscreen mode. If you then use left mbtn mpv registers the click as the same distance relative to the window origin as in fullscreen, disregarding the fact that exiting fullscreen moved the window relative to the cursor. If there is an OSC UI element now, it will get clicked even though the cursor isn't there.

If that was a bit confusing, I hope the video demo (uploaded as sample) clears it up.

I want to emphasize here that this isn't just a theoretical problem. If you're in fullscreen, grab the mouse and triple- instead of double click to exit, you will involuntarily seek somewhere if you're unlucky, even if the cursor hasn't significantly moved since entering fullscreen and is nowhere near the the OSC.

Log File

output.txt

Sample Files

Screencast_20250226_051111.mp4

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@Dudemanguy
Copy link
Member

Yeah that's caused by this.

if (!wl->toplevel_configured)
mp_input_set_mouse_pos(wl->vo->input_ctx, wl->mouse_x, wl->mouse_y);

Surprised nobody ever noticed that after all these years. We'll need a better solution. The reason for that is to avoid breaking the auto hide cursor.

Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Feb 26, 2025
Setting the mouse position always updates the cursor visibility state in
the core, but that's not always desired by the caller. Make it optional.
In practice, this is for wayland. Fixes mpv-player#15967.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants