[hatari-devel] Patch to fix pause bug on Mac |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] Patch to fix pause bug on Mac
- From: Chris Jenkins <cdpjenkins@xxxxxxxxx>
- Date: Mon, 19 Sep 2022 20:59:35 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=TnJDAn57btZ9Ljs6BGi1lyv5t+CyQ/oIqLEqS9G+xTw=; b=nUxyiGuBk4hbUiWNfThRa0/MQ4T9YKm+puwmAj2GWHqs+trsxtc1AGHuMwbpJoe30O ekEjYRa8ZpddKrzKcBzRL13aMxKlLWqwn+6U0/sfJNZqg+y9QnklM9JfoS2hkGilRnsK Pw60kE/udyE/yca5YhXn9Ol7LIdTv2zWhyc3x6hMeRDdjoz63LoWLUDr2KBOvBfaiK9G 1rT33SPzT+SQVaDGNhUbzOw9eMGfCWwc2J+E9h5gGy9lkNshVexzOmE9Oo69yOoDoaNU 07qiBA6TGhVM9mQvA/8B4rb5/+eBQ9Ui6IERSSZ836bfC3TGBumlSHWWRzF6GRDjMFIo U+UQ==
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