ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.66k stars 416 forks source link

On MacOS Catalina 10.15.7, if user moves mouse while application loads, input fails to register until the window is refocused. #3976

Open harshavb opened 3 years ago

harshavb commented 3 years ago

Our program uses OnHover to detect when a user hovers over a container in a screen that is pushed to a screenstack on startup. However, if I run the program on Mac, and move my cursor before the window loads in, the application fails to detect any input. (OnMouseHover never gets run, even if I hover over the container). However, if I click on another application, then click back on my application, it will detect input properly. In addition, the container uses an overriden ReceivePositionalInputAt. The issue still occurs when useSdl is set to true. The program works fine on Windows 10.0.18363.

bdach commented 3 years ago

I'm not sure I'm understanding what the problem is from this description. Can you upload a video? It would probably be easiest for everyone.

harshavb commented 3 years ago

Here are some videos. On Windows, it works fine when the mouse is moved on startup. https://www.youtube.com/watch?v=ZveHHvlwab4

On Mac, it breaks when you move your mouse on startup unless you refocus and don't move your mouse while refocusing. https://www.youtube.com/watch?v=Fh6tL37zErk

swoolcock commented 3 years ago

Sounds like a regression of https://github.com/ppy/osuTK/pull/57 to me. Which version of macOS?

harshavb commented 3 years ago

macOS Catalina 10.15.7

bdach commented 3 years ago

Does this happen reliably every time? Asking as I've actually had a similar thing happen on linux happen a few times, but assumed it was just due to idiosyncrasies of my unorthodox setup (i3wm on ubuntu), and as I recall it wasn't consistent.

harshavb commented 3 years ago

Yes, and we just have a normal 16 inch macbook pro 2019 I will say we don't have another mac to test it on, but all the code can be found here https://github.com/harshavb/piously

swoolcock commented 3 years ago

macOS Catalina 10.15.7

Sorry, I missed the version in the issue title. I’ll take a look, though I’m very surprised since we haven’t seen this issue in almost a year.

peppy commented 3 years ago

This has always happened to me, for what it's worth. Around 50% of the time I open the game or test window. The game window does not think it is active (runs at lower frame rate and does not accept input).

swoolcock commented 3 years ago

This has always happened to me, for what it's worth. Around 50% of the time I open the game or test window. The game window does not think it is active (runs at lower frame rate and does not accept input).

How always is always? The described issue was fixed almost 3 years ago for Mojave (https://github.com/opentk/opentk/pull/732) then again for Catalina (https://github.com/ppy/osuTK/pull/57), then again for both (https://github.com/ppy/osuTK/pull/63). I haven't seen this issue since.

peppy commented 3 years ago

Around 50% of the time i need to tab away and tab back to the window. Happens every day, I've just become so accustomed to it that I forget. I'll switch to SDL for a while and see if I can still reproduce.

peppy commented 3 years ago

Ah, I forgot that I can't use SDL because it crashes on startup >_<.

ben9583 commented 3 years ago

I tried SDL to fix it earlier today but it had the same problem. Also the game resolution was completely out of whack (window went off the screen) and the bounding boxes were completely misplaced.