Skip to content

Commit

Permalink
Always use GUI dialogs to get exit confirmation from the user
Browse files Browse the repository at this point in the history
in K95G when closing from the file menu or window controls.

Fixes davidrg#322
  • Loading branch information
davidrg committed Nov 13, 2024
1 parent ab69590 commit a5fab64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kermit/k95/kui/kui.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,18 @@ Bool Kui::message( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )

case WM_REQUEST_CLOSE_KERMIT:
{
/* Calling hupok() from here will just hang forever if GUI Dialogs
* are disabled as it calls uq_ok which will try to get input from
* the user on VCMD, and if we're sitting here calling hupok() then
* we're not processing other events (like keyboard input) for the
* window. So as a workaround, just force GUI Dialogs on for the
* call to hupok(). */
int gui_dlg = gui_dialog;
gui_dialog = 1;

// close down ckermit
Bool hangupOK = hupok(0);
gui_dialog = gui_dlg;
if( hangupOK ) {
if( terminal )
terminal->show( FALSE );
Expand Down

0 comments on commit a5fab64

Please sign in to comment.