Opened 8 years ago

Closed 8 years ago

#1695 closed bug (fixed (in master))

Cocoa port hangs when user quits during prompt

Reported by: Derakon Owned by: myshkin
Milestone: 3.4.1 Keywords: mac


On the OSX Cocoa port, if you quit (Cmd+Q) while in a store, viewing inventory, etc. then the game will hang. It appears to be stuck in a busyloop going through check_events over and over again without being able to exit.

Inverting (or removing) the inkey_flag check in quit_calmly() will prevent the hang at the cost of allowing the user to quit while in the middle of a prompt. This is inconsistent with behavior of other ports (including the Carbon port), but it's unclear if it's harmful otherwise.

Change History (5)

comment:1 Changed 8 years ago by fizzix

question 1: inkey_flag doesn't seem to be set properly on cocoa. But the code that sets it is cross-platform code in util.c and cmd0.c. Why is this behavior working differently?

question 2: Why is quitting in the middle of the prompt bad?

Hack-tastic solution. Ignore the inkey_flag check. Spam /escape (10 iterations in a for loop should be enough) before saving and quitting.

comment:2 Changed 8 years ago by myshkin

  • Owner set to myshkin
  • Status changed from new to assigned

comment:3 Changed 8 years ago by myshkin

As far as I can tell, the Cocoa port sets inkey_flag the same way that, say, the GCU port does. Walking around the map? inkey_flag is true. Press 'i' to bring up inventory? inkey_flag is false.

Are there weird interactions between savefiles and quitting in the middle of a prompt?

comment:4 Changed 8 years ago by myshkin

  • Keywords mac added
  • Status changed from assigned to confirmed

I've opted to make Cmd-Q be a no-op when inkey_flag is false, to match the behavior of the Windows port.

Fixed in commit b39db26 of master.

comment:5 Changed 8 years ago by fizzix

  • Resolution set to fixed (in master)
  • Status changed from confirmed to closed
Note: See TracTickets for help on using tickets.