ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.4k stars 795 forks source link

Show cursor at edges even when there is a custom cursor #17101

Open Croworbit opened 1 month ago

Croworbit commented 1 month ago

Describe the feature Provide a clear and concise description of your feature request. Why would this feature be useful? Does the feature involve the desktop build, the web build, or both?

when playing a game on the Ruffle desktop app, the edges of the screen where there is no content are black bars a lot of games have a custom cursor where the OS cursor is hidden and and one on the game is shown instead. unfortunately, since the cursor is hidden on the screen of the game and shown when moved outside, you can get an annoying problem where you can briefly lose track of the cursor as it gets hidden off to the sides of the content (where it is technically still in bounds of the game but not on the menus). (look at top left during the vid)

https://github.com/user-attachments/assets/95b6c57f-9286-4ea1-ba55-d90b994ec6cc

you can test this on a great variety of games with custom cursor, but here's a small list to test outpost haven electric box2 (you need to enable it on the main menu) knight tron (knighttron)

to be clear, some games you need to turn them on or can have them off, but I do like the custom ones.

this is only really a problem when using show all with letterboxing on. and it is just annoying enough to barely be worth complaining about, but after some time it gets to be a pet peeve. I'm pretty sure this also used to happen in some way with flash player, as I remember being annoyed by some version of this even before ruffle existed, but I can't realy recall how to get that to happen there anymore, especially now that I almost exclusively use ruffle. (its just that good, thanks) (yes, I know the letterbox thing is a new Ruffle thing, but it happened in some way I just can't remember on flash, I know it)

my only guess to fix this is to either have the cursor know when its behind the letterboxing bars and move it forward when that is the case, or just to render another cursor on top of the bars when the cursor is under.

it is just a minor thing, but you know how annoyances can be. so I'll just leave this as an enhancement request rather than a bug.

n0samu commented 1 month ago

Note that the problem also occurs on web when letterboxing is enabled (you can see it easily on the demo page). From Ruffle's perspective, I think we'd need to detect when the cursor is within a letterboxed area of the screen, and when it is, always show the system cursor regardless of what the movie told us to do.

Croworbit commented 1 month ago

its also more noticable as an issue when you pause the game using Ruffle's Suspend feature when you do this, the cursor is not updated on the game. if you use the button to pause, the ccursor is completely off the game and so no cursor is shown, if you use the keyboard shortcut to pause, the cursor is frozen on the game, etc it only appears again if you move to the top menu bar

https://github.com/user-attachments/assets/a32f2add-2892-41bf-b33a-9ee4f359f210

(when the pause is triggered, look to the top where the menu bar is) hope this helps