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

Cursor doesn't properly disappear with Pipewire capture #4895

Closed
rmnvgr opened this issue Jun 13, 2021 · 12 comments · Fixed by #8467
Closed

Cursor doesn't properly disappear with Pipewire capture #4895

rmnvgr opened this issue Jun 13, 2021 · 12 comments · Fixed by #8467
Labels
Linux Affects Linux

Comments

@rmnvgr
Copy link
Contributor

rmnvgr commented Jun 13, 2021

Operating System Info

Other

Other OS

Fedora 34

OBS Studio Version

27.0.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/AUrBGETVVGn7lrbQ

OBS Studio Crash Log URL

No response

Expected Behavior

When the cursor disappears in the captured window/screen, it also disappears in the output.

Current Behavior

The cursor is still visible in the output.

Steps to Reproduce

  1. Open an application where the cursor disappears (for example OpenTTD or Minecraft)
  2. Add a Pipewire capture (either window or screen)
  3. See that cursor still appears in the output

Anything else we should know?

In OpenTTD (cursor in the bottom right):
openttd

In Minecraft (cursor at the top left of the pointer):
minecraft

@kkartaltepe kkartaltepe added the Linux Affects Linux label Jun 13, 2021
@RytoEX
Copy link
Member

RytoEX commented Jun 13, 2021

Just to confirm, did you uncheck "Show Cursor" on the source properties in OBS?

Screenshot from 2021-06-13 19-06-42

@rmnvgr
Copy link
Contributor Author

rmnvgr commented Jun 14, 2021

No, I did not uncheck "Show Cursor". That would do for OpenTTD, which provides its own cursor, but not for Minecraft, which has to display the cursor in menus/inventory.

@GeorgesStavracas
Copy link
Member

I've been trying to track this down for months now. It is almost certainly a Mutter issue. For some reason, it keeps sending cursor data even when the cursor should be invisible. It seems not even https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1417 helped this case...

@RytoEX
Copy link
Member

RytoEX commented Jun 14, 2021

Is Minecraft perhaps switching from a custom cursor to the system cursor for things like the menus and inventory screen? If so, I'm not sure how that would be handled, at least on our end.

Edit: On Windows, Game Capture and Window Capture do capture the in-game cursor and the system (hardware?) cursor just fine as needed. I don't know the Linux specifics though.

@rmnvgr
Copy link
Contributor Author

rmnvgr commented Jun 14, 2021

@GeorgesStavracas Is there a Mutter issue I can subscribe to already? Or do you want me to open one?

Is Minecraft perhaps switching from a custom cursor to the system cursor for things like the menus and inventory screen? If so, I'm not sure how that would be handled, at least on our end.

Minecraft hides the cursor in-game and shows the system cursor in menus and inventory. OpenRCT2 and Julius use custom cursors, and the system cursor doesn't appear in the output.

@GeorgesStavracas
Copy link
Member

PipeWire captures ask the desktop portal / compositor for metadata cursors. Compositors then send the monitor / window contents as the actual data of the stream, and the cursor is sent as metadata (position + size + texture) of each buffer of the stream. Games usually hide the cursor by setting an empty texture, and draw their custom cursors as part of the game itself.

In this case, what's happening is that the compositor keeps sending metadata cursors to OBS Studio, even when the game hides the cursor.

@GeorgesStavracas
Copy link
Member

@GeorgesStavracas Is there a Mutter issue I can subscribe to already? Or do you want me to open one?

I suspect there already is one, but I couldn't find it. It would be fantastic if you could either report it at https://gitlab.gnome.org/GNOME/mutter/-/issues - thanks!

@rmnvgr
Copy link
Contributor Author

rmnvgr commented Jun 14, 2021

@DDE-64-bit

This comment was marked as resolved.

@DanielGaaA
Copy link

Is this really compositor issue? I am on KDE 5.26.4 and I am having same issue with OBS. When screen recording with OBS I can see SW or HW cursor when hidden.
When i was testing screen sharing with firefox(https://mozilla.github.io/webrtc-landing/gum_test.html) I didn't see the red SW cursor

image

@kkartaltepe
Copy link
Collaborator

kkartaltepe commented Mar 1, 2023

When screen recording with OBS I can see SW or HW cursor when hidden.

Chrome(and firefox?) hides cursors even when they are visible on screen. I can only presume they just hide the cursor after it hasnt moved for so many seconds. This is just wrong in a different way.

@rmader
Copy link
Contributor

rmader commented Mar 14, 2023

Opened #8467

rmader added a commit to rmader/obs-studio that referenced this issue Mar 14, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes obsproject#4895
rmader added a commit to rmader/obs-studio that referenced this issue Mar 14, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes obsproject#4895
rmader added a commit to rmader/obs-studio that referenced this issue Mar 14, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes obsproject#4895
rmader added a commit to rmader/obs-studio that referenced this issue Mar 14, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes obsproject#4895
GeorgesStavracas pushed a commit that referenced this issue Mar 14, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes #4895
bfxdev pushed a commit to bfxdev/obs-studio that referenced this issue Mar 16, 2023
If we receive an empty cursor bitmap - one without valid size - we
should hide the cursor. Do so by clearing the texture.

This fixes visible cursors when recording various games with Wayland
compositors.

Closes obsproject#4895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Affects Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants