4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.81k stars 848 forks source link

Input fields grey out - not allowing selection or editing #1646

Closed convictedweirdo closed 4 years ago

convictedweirdo commented 4 years ago

There is an intermittent bug, where renaming or entering data in input fields seems to randomly break, not allowing the current entry to be selected, deleted or edited. When it happens, all input fields are affected. example: it breaks with renaming sprites, and then I cannot rename scenes, layers, etc.

It works sometimes, but other times seems to break for no reason, and then will start again randomly.

I can consistently get it to break importing images to sprites from outside the project folder and importing them in. When it does happen, alt tabbing out of the program and back in resolves the issue for a short time.

I am using windows 10 and GDevelop beta 90

4ian commented 4 years ago

Might be related to the Electron upgrade in beta 90. @Bouh, @NilayMajorwar can you reproduce this on Windows?

Bouh commented 4 years ago

I can't reproduce, i've fill the inputs lot of time and stress the input by clicking everywhere, or long press. but nothing for now. but i can use special character in external layout, event and scene, not on functions/behavior. this see not be normal. image I will try others editions in eventsheet.

Bouh commented 4 years ago

I got the bug! I posted the comment of github just above and when I came back in GD I deleted the scene. Recreate a scene. Rename the scene. And now I'm stuck in input, i can't write. The input is in edit mode, but there is no focus, I can't click on it to put it back. If I move the cursor out of GD and back then the focus is back in the input. @4ian

4ian commented 4 years ago

but i can use special character in external layout, event and scene, not on functions/behavior. this see not be normal.

This is normal. This is because names of scenes, external events, external layouts are string (they can be anything (could even be empty in theory!)) - anything is valid. But the extension names, as well as the object names, function names and behavior names are identifiers. In other words, they should be able to be used in an expression - so no space or "weird characters" that could be understood as a separator, like operators (/, \, :, +, -, *, <, >...).

In practice to be 100% sure for now we only allow a-Z and 0-9 and underscore for identifiers. But in the future we could allow unicode characters, as long as it's not a space or a separator/operator.

This is to be sure that they can be used in expressions.

4ian commented 4 years ago

I posted the comment of github just above and when I came back in GD I deleted the scene. Recreate a scene. Rename the scene. And now I'm stuck in input, i can't write.

Very weird! Would you be able to try a few more times to see in which case this bug arise and in which case it's not happening? I wonder if it's related to the fact that we're showing "confirm" dialogs sometimes.

Bouh commented 4 years ago

It's seem only when i rename a new scene after delete one just before. https://streamable.com/anyjgd

nilaymaj commented 4 years ago

Just reproduced this on the Windows build. Yes, I think it's probably related to the confirm dialogs. With everything working normally, click on Exit GDevelop, cancel the confirmation dialog and the text boxes stop working. I'll check if this happens on Linux and on the development version.

nilaymaj commented 4 years ago

I think I found the issue. Looks like the browser API's alert and confirm calls block the Electron thread ever since around Electron v4.2.0. There are some Electron issue open for this - here's one of them.

4ian commented 4 years ago

Good finding, I also just found this issue before seeing your message :) This is indeed the culprit. Seems like the Electron apis (Dialog.showMessageBoxSync) are working well. Let's do a fix by:

I'll then release a new version after this because this is quite an important issue.

4ian commented 4 years ago

@NilayMajorwar Do you want to give a try at the steps I've explained? Otherwise I'll do it myself.

nilaymaj commented 4 years ago

Yup, I'm working on it.