[hatari-devel] Big bug in the SDL UI |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi
since sometimes, I experienced that toggling "prefetch mode" in system
setting sometimes caused a reset (as expected) and sometime did not
cause a reset, but this happened randomly even if state of Hatari seemed
to be the same.
I spent some going into every functions that compare changes, apply
changes, and so on, until I reached the SDL UI where for some reasons
the dialog "the emulated system must be reset to apply these changes"
was never displayed when you pressed "OK" on the main menu
After adding more and more log for a long time, I see that in the system
dialog the "reset" message will be displayed dependingon where you click
on the string "Prefetch mode, slower", depending on the X position.
A X position around 182 in SDLGui_FindObj will consider an object number
"16" was selected, which doesn't make any sense.
Then in SDLGui_DoDialog the main while will not be executed because
current_object=16 and SDLGui_DoDialog returns 16.
You need to use the winuae build with more cpu options.
Here's the sequence to reproduce it :
- open system dialog
- click on the "c" in "prefetch" and don't move your mouse anymore
-> at this point, SDLGui_FindObj is called for the system dialog object
(len=45), which toggles the prefetch choice.
- press "enter" key to go back to main menu
-> then SDLGui_FindObj is called again immediately for the main dialog
object (len=21) with the same X/Y position as in the system dialog. Why
does it do that ?
So here SDLGui_FindObj will think that the "no reset" text of the main
dialog was clicked, which is not the case, and the dialog "the emulated
system must be reset to apply these changes" will not be displayed ;((
You can check that if you click somewhere else in the cpu setting
dialog, then the reset dialog is correctly displayed.
Should current_object be set to -1 when a dialog is closed, to ensure
the main dialog doesn't call SDLGui_FindObj when the system dialog is
closed ?
Nicolas