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

Mouse button input events not picked up consistently on macOS. Mono version #55156

Closed
LordBrkica opened this issue Nov 20, 2021 · 10 comments · Fixed by #56700
Closed

Mouse button input events not picked up consistently on macOS. Mono version #55156

LordBrkica opened this issue Nov 20, 2021 · 10 comments · Fixed by #56700

Comments

@LordBrkica
Copy link

LordBrkica commented Nov 20, 2021

Related to: #54458 (comment)

I am encountering this issue on mac OS Monterey 12.0.1. Godot version is 3.4 stable mono.
Device is mac mini i3 2018, with UHD 630 GPU.

Bug occurs sporadically, 1 out of 10 times when I start the game the bug will occur.
When it occurs, its immediately obvious as my game starting UI elements (buttons) are also affected.

The Bug I would describe most simply as follows:

  • one normal left mouse click seems to be ignored/missed, one needs to double click and this is then registered as one normal click

GLES2/3 options are affected equally, and its not specific to one control type (e.g. Button) but seems to affect all controls equally.

Bug seems to go away after some time (window switching and window minimizing/ maximizing maybe helps).

If I understood correctly, this bug should have been solved in 3.4 but for me its still there. Could it be that only Mono version is still affected ?

P.S EDIT:
I just noticed one curiosity which might help someone.

I have a sort of scenario editor at game beginning, an ItemList where one can select one scenarioName string.

When starting the game where there is NO bug, the first item in the list is automatically selected/focused.
When starting the game where the bug IS present, the first item in the list is NOT selected/focused.

@Calinou
Copy link
Member

Calinou commented Nov 20, 2021

Could it be that only Mono version is still affected ?

No, as the input handling code is exactly the same between non-Mono and Mono versions.

@bruvzg bruvzg self-assigned this Nov 22, 2021
@bruvzg
Copy link
Member

bruvzg commented Nov 23, 2021

when I start the game

Starting project from the editor, from terminal or starting the exported app?

Related to: #54458 (comment)

When the bug happens, are window title text and close, minimize and full-screen buttons normal (bright text and colored buttons) or gray?

@sirgwain
Copy link

I start mine from the terminal, always. It happens both in the editor and in my launched game. 3.4 Mono, macOS Monterey 12.0.1.

It's very sporadic.

@LordBrkica
Copy link
Author

LordBrkica commented Nov 26, 2021

Starting project from the editor, from terminal or starting the exported app?

I just made some tests (around 30 starts) and I only got the bug when started via Terminal/ VisualStudioCode F5.
Here is my launch.json:

    "version": "0.2.0",
    "configurations": [
        {
            "name": "DebugTerminal",
            "type": "godot-mono",
            "request": "launch",
            "mode": "executable",
            "executable": "/Applications/Godot_mono.app/Contents/MacOS/Godot", 
            "executableArguments": [
                "--path",
                "${workspaceRoot}"
            ]
        },

But it could be just small test sample.

When the bug happens, are window title text and close, minimize and full-screen buttons normal (bright text and colored buttons) or gray?

Yes, I just noticed that when the bug appears these buttons are gray.

@samdze
Copy link
Contributor

samdze commented Dec 11, 2021

Don't know if related, but when I try to click to focus the Godot editor window on macOS (MacBook Pro M1 Max, Monterey 12.0.1) there's a delay of at least 1 or 2 seconds before it actually gets focused, very annoying.

It seems to be dependant on how complex the scene in the window I'm focusing is, with a simple running game I get less delay, but still noticeable if I try to drag the window at the same time.
I'm starting Godot normally, not from the terminal.

When I alt+tab to set the focused window (instead of clicking) I get less delay, but it's still there.

@Calinou
Copy link
Member

Calinou commented Dec 11, 2021

Don't know if related, but when I try to click to focus the Godot editor window on macOS (MacBook Pro M1 Max, Monterey 12.0.1) there's a delay of at least 1 or 2 seconds before it actually gets focused, very annoying.

  • Can you reproduce this if you enable Update Continuously in the Editor Settings?
  • Can you reproduce this if you set Unfocused Low Processor Mode Sleep Usec to 6900 in the Editor settings (while Update Continuously is disabled)?

@samdze
Copy link
Contributor

samdze commented Dec 11, 2021

Can you reproduce this if you enable Update Continuously in the Editor Settings?
Can you reproduce this if you set Unfocused Low Processor Mode Sleep Usec to 6900 in the Editor settings (while Update Continuously is disabled)?

Ok, either way the issue doesn't appear anymore, or it's quite mitigated.

@sirgwain
Copy link

Well that's interesting. I always launch godot from a terminal (godot-mono -e .) in order to see output logs. If I launch it from spotlight and open my project from there, I couldn't reproduce the issue when I tried closing and re-opening godot 5 times.

@sirgwain
Copy link

Oh I'm sorry, I was responding to the original issue, not this alt-tab issue. I'll delete my comments.

@LordBrkica
Copy link
Author

LordBrkica commented Dec 12, 2021

* Can you reproduce this if you enable **Update Continuously** in the Editor Settings?

* Can you reproduce this if you set **Unfocused Low Processor Mode Sleep Usec** to `6900` in the Editor settings (while **Update Continuously** is disabled) ?

I also tried these 2 tips and they don't prevent the problem.

The bug I can spot upon starting my game by looking at the window icons:
image

If these 3 icons are greyed out (like in the screenshoot) it means left click mouse input will fail to be detected.

Interestingly, I could NOT get this bug to appear when starting the game directly from Godot editor.
Also, starting the game from godot editor and THEN starting it from terminal/VSC F5 seems to mitigate the problem.

So the bug appears most often when you dont start the game from editor at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants