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 may become invisible when recording some fullscreen games using WGC #128

Open
Esvandiary opened this issue Feb 15, 2024 · 8 comments

Comments

@Esvandiary
Copy link

Esvandiary commented Feb 15, 2024

There seems to be a software-dependent issue with WGC window capture where the user's cursor may disappear when recording certain fullscreen games.
For clarity: this isn't the cursor appearing or not appearing in the recording, this is the actual system cursor becoming invisible within a fullscreen window while WGC is recording it. The same issue does not appear using other recording methods (e.g. DXGI desktop duplication, BitBlt), and enabling/disabling the WGC option to show the cursor in recordings does not seem to change the behaviour.

We've been getting user reports about this for a while (and mercifully one of our QA team can reproduce it), and the OBS project has had reports about the same on their forums for a few years including examples of both window and screen capture suffering from this issue. However, this obviously isn't an across-the-board problem, and myself and several of my colleagues can't reproduce it at all.

So far we've had reports for Minecraft Java Edition and Geometry Dash, which I believe both use OpenGL. We've also had reports on both NVIDIA and AMD GPUs (although we've only seen AMD via user reports so slight grain of salt).

I've built the WPF ScreenCapture sample and sent it to my colleague, and he was able to reproduce the issue. He's on Windows 11 Home 22H2 (22621.3007) with an NVIDIA GPU, but we also have user reports from other Windows 11 versions on builds 22621 and 22631.
Repro steps:

  • Start Minecraft Java Edition (he was using 1.20.1)
  • Press F11 to fullscreen the game
  • Start the ScreenCapture sample
  • Click Use Picker and select the Minecraft window
  • Click OK
  • Note that the system cursor is now invisible whenever it is over the Minecraft window
  • Click Stop Recording
  • Note that the system cursor is now visible again

I'm not sure if this is a known issue, but it'd be really great to have one of:

  • A way to stop this from happening with no user involvement (and a pony too, please!)
  • A way to stop this from happening with user involvement
  • A way to detect this specific issue is happening (so we can fall back to a different window capture strategy)
    • We can try to get the cursor info to detect it being suppressed/not visible, but this is the normal behaviour in some games so it's a bit awkward

I can ask my colleague for more information or to test other scenarios if it'll help. Thanks!

@robmikh
Copy link
Member

robmikh commented Feb 15, 2024

Hmmm, interesting. It likely has something to do with the software cursor, as that is forced on with WGC. The good news is that in an upcoming release we've finally removed the transition to the software cursor while capturing. But I'll see what I can find for existing builds.

@Esvandiary
Copy link
Author

Thanks very much! I'll read up on software vs hardware cursor differences and see if that can give me any leads on finding anything in common between people who can reproduce the issue.

Even if the issue can't be worked around on existing builds (as I imagine may be quite likely), finding a differentiator would be very beneficial, since it gives us more fine-grained options than the bludgeon of "fullscreen game + hidden cursor = fall back to DXGI/BitBlt."

I'll also try to narrow down whether OpenGL actually is a common factor here or if that's just coincidence based on the games that have been reported.

@robmikh
Copy link
Member

robmikh commented Feb 15, 2024

Of course! And thanks for digging up more information. If you want to force the software cursor without WGC, you can turn on cursor trails. I think there's also a magnifier API to do so, but I can't remember off the top of my head.

Additionally it would be good to know what builds of Windows this behavior is seen on. Seems like I needed to read your original post closer. Oops!

@Esvandiary
Copy link
Author

Esvandiary commented Feb 15, 2024

Yeah, we've definitely seen it on Win11 22621 and 22631; I'll dig through some of the other user reports and see if I can find any other cases (e.g. I imagine a yes/no for Win10 would be useful! Might struggle for that though as we disable WGC by default on 10 since our users mostly aren't fans of the yellow border)

@Esvandiary
Copy link
Author

Esvandiary commented May 6, 2024

Quick update for you @robmikh : we haven't managed to get any definite confirmations for Win10 or other Win11 builds, but we've made the following observations:

  • Interestingly, in all cases the issue appears to only manifest when a single graphics adapter is active in the system
    • caveat: I suspect all the games I've tested personally were only actually willing to go into true exclusive fullscreen mode if a single adapter was active, even if the display in question was connected to the same adapter as the application was using for rendering in multi-adapter scenarios
    • I struggled to test the case where the compositing adapter was also the same, because it seems many games don't respect the Windows graphics "set this application to power saving" setting and just use the dGPU anyway; not sure if there's any hack possible to force compositing to run on a specific adapter to test this
  • In terms of 3D APIs:
    • OpenGL applications are definitely affected while running in exclusive fullscreen
    • DirectX applications don't seem to be affected
    • Vulkan applications are likely not affected (see later for rationale):
      • Dota 2 (with the "Vulkan support" DLC installed, running with the -vulkan launch option) is affected
      • Doom Eternal is unaffected
  • Enabling cursor trails to force the software cursor without recording gives mixed results
    • Minecraft Java Edition (OpenGL) does not exhibit the same behaviour as with WGC; the cursor has no trails, but is visible
      • to me this suggests a WGC-specific issue beyond just use of the software cursor
    • Dota 2 (Vulkan) does exhibit the same behaviour as with WGC; the cursor is invisible while exclusive fullscreen is active
      • so this is likely a separate, wider issue related to the software cursor with some Vulkan apps
    • Doom Eternal (Vulkan) continues to behave normally
  • The WGC-specific behaviour with OpenGL has now been reproduced on NVIDIA, Intel and AMD GPUs, so unlikely to be a vendor driver problem

All of my testing above was tested on a mix of Win11 22631.3447 and 22631.3527

@robmikh
Copy link
Member

robmikh commented May 7, 2024

Thanks for the extra info, this will definitely help!

@Esvandiary
Copy link
Author

One more quick update: we're getting some scattered reports of this issue with League of Legends too, which AFAIK is a D3D game, not OpenGL... so the GL specificity may be coincidence rather than an actual symptom.

@Esvandiary
Copy link
Author

Esvandiary commented Aug 2, 2024

Clarification on the above: it looks like there are two separate situations that can cause this, only one of which I'd say is actually a bug.

  • OpenGL games: as above, this still seems to be a bug
    • It seems like there's some correlation between single adapter and/or single monitor being relevant for the issue happening, but not enough data to say that for sure yet
    • I have Win11 24H2 on a new laptop, and it does not happen with WGC capturing a fullscreen Minecraft window there, where based on our current understanding I would have expected it to. Not sure if that hardware cursor change made it into 24H2, but maybe that's fixed it if so... Will ask colleagues to check with other devices once 24H2 is available for them.
  • Other games (e.g. League of Legends): only happens if the user has turned on "Disable fullscreen optimizations" either for the application in question or globally
    • As I understand it, turning on that option re-enables "real" traditional exclusive fullscreen mode, which means that the DWM/compositor has no opportunity to draw a software cursor and therefore if the hardware cursor is disabled, there will be no cursor unless the game draws its own
    • This isn't a bug as such, just a limitation of WGC with the old-style exclusive fullscreen (which fortunately we can detect)
    • This doesn't seem to be fixed in 24H2 (I tested with Counter-Strike 2 on my laptop), which I'd expect it to have been if the hardware cursor was no longer disabled when using WGC... so maybe it's a different change?

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

No branches or pull requests

2 participants