[hatari-devel] Patch to fix pause bug on Mac

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

Here is a patch to fix an annoying bug in the Mac GUI where performing
certain actions when paused will cause emulation to be unpaused once the
action is complete.

*Steps to reproduce:*
- Pause emulation
- Perform one of the following:
  - Open preferences
  - Create a blank floppy
- Close the resulting dialog box

*Expected results:*
- Emulation is still paused

*Actual results:*
- Emulation is unpaused

The problem is that emulation is paused before running a modal dialog and
unpaused afterwards., regardless of whether emulation was already paused.
The patch implements the same pattern that is already implemented in the
SDL GUI: Only unpause if emulation was not paused in the beginning.

I confess I'm not entirely comfortable with writing exactly the same code
that is found in the SDL GUI here. I'd really like to create an abstraction
at a lower level within Hatari that can take care of this case where we
want to pause, do something, unpause if not already paused. But I don't
know how to do something like that cleanly in C.

All feedback on this patch very much appreciated.

Cheers,
Chris



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/