YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

Native Extension Dialog Boxes (Both Modal and Async) Cause Keyboard/Mouse to be Unresponsive for Consecutive Presses #5652

Open time-killer-games opened 6 months ago

time-killer-games commented 6 months ago

Description

If you create an native extension which creates dialog boxes in GameMaker, and you use a keyboard or mouse event to create the dialog box, and close the dialog box, attempting to create it again with the same keyboard key or mouse button combination twice in a row, it will ignore the second attempt as if no keyboard or mouse event was fired, only working every other time you attempt the keyboard or mouse press.

I have included the source code to the extension on all platforms under the extensions folder of the project, the file is named libdlgmod.zip with everything you need to know or see inside it. The demo project demonstrates the issue with async dialogs, for modal/synchronous you will need to do a "find/replace all" in the GM project removing all matches in the code for "_async" and replace it with an empty string "". Then delete the 'Async Dialog' event. Once that is done you can test the bug with synchronous dialogs. The 'Async Dialog' event is only there to echo the result of each dialog's return value sent to the data structure. Deleting it will remove the echoing, so synchronous dialogs won't echo, but that's not important for this.

Please note, I have tested and verified this bug on Windows and macOS. It does not appear to happen in Ubuntu, though that could be because I am running zenity from the shell to create dialogs instead of making raw GTK+ calls.

My 'Contact Us Package' / sample project: DialogModule.zip

Expected Change

Keyboard and mouse events which fire every time they are supposed to when creating dialog boxes with extensions.

Steps To Reproduce

  1. Start GameMaker
  2. Import and run reproducible.
  3. Press 'Enter/Return' with the game window in focus, to attempt creating a dialog box, multiple times.
  4. See the issue.

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.2.0 (Monthly)

Which platform(s) are you seeing the problem on?

Windows, macOS

Contact Us Package Attached?

Sample Project Added?

time-killer-games commented 5 months ago

I wanted to put a note here, that async dialogs via extensions do not have this problem when creating the dialog in its own thread for multi-threading. Though my reproducible doesn't use multi-threading, not even for the async dialogs, because I couldn't figure out how to make it so that only one dialog could be created at once, blocking consecutive calls until the current dialog is closed. So to be technical, in my case, both my sync and "async" functions don't multi-thread and are in reality just all sync and not async. Sync dialogs are the real and only problem. The title of this ticket is a bit confusing.