Opened 8 months ago

Closed 8 months ago

Last modified 7 months ago

#15880 closed defect (fixed)

Prevent the utility `helpview` from being closed by its subdialog.

Reported by: jbbbms Owned by:
Priority: normal Milestone:
Component: GUI-all Version: 3.0.0
Keywords: wxHtmlHelpFrame, SetShouldPreventAppExit, wxHtmlHelpFrame Cc:
Blocked By: Blocking:
Patch: yes

Description

If we open any dialog from a wxHtmlHelpFrame, for example, click the rightmost button on the toolbar to display the font selection dialog, then, no matter how we dismiss the dialog, the HTML help frame (the wxHtmlHelpFrame object) will go with it, and the application ends there unexpectedly.

The attached file fixed the buggy behavior.

By the way, why wxHtmlHelpFrame's m_shouldPreventAppExit is not default to true? Because the same problem emerges (in both wxGTK and wxMSW) when trying to use wxHtmlHelpController to create a standalone viewer of wxWidgets HTML Help (.htb/.zip) file.

Thanks. Have a nice day.

Attachments (1)

a.diff download (401 bytes) - added by jbbbms 8 months ago.
fix helpview

Download all attachments as: .zip

Change History (8)

Changed 8 months ago by jbbbms

fix helpview

comment:1 Changed 8 months ago by vadz

  • Status changed from new to confirmed

Yes, this behaviour is clearly wrong if there are no other top level windows in the applications... I'll add a check for this which should fix the problem described but I'll also still apply your fix as well because my fix doesn't take care of any dialogs not created with the correct parent pointer.

comment:2 Changed 8 months ago by VZ

(In [75630]) Avoid automatically closing parent frame if a child dialog was closed.

This counterintuitive behaviour could happen when a dialog of a frame
returning false from its ShouldPreventAppExit() was closed: if there were no
other TLWs in the application, then the parent frame could be closed as well,
even if this clearly shouldn't happen.

See #15880.

comment:3 Changed 8 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75631]) Ensure that the help viewer keeps running as long as its main frame is opened.

Do prevent the app from exiting when the help frame is shown in the special
case of the help viewer application where the default behaviour of exiting the
application when only the help window remains open is inappropriate and
results in unexpected program exit if we open and then close any dialog, e.g.
from the help frame toolbar.

Even though the previous commit actually already fixed the problem in the
current code, still apply this fix as well, just in case we can (or could, in
the future) should any dialogs with NULL parent in this program.

Closes #15880.

comment:4 Changed 8 months ago by VZ

(In [75633]) Avoid automatically closing parent frame if a child dialog was closed.

This counterintuitive behaviour could happen when a dialog of a frame
returning false from its ShouldPreventAppExit() was closed: if there were no
other TLWs in the application, then the parent frame could be closed as well,
even if this clearly shouldn't happen.

See #15880.

comment:5 Changed 8 months ago by VZ

(In [75634]) Ensure that the help viewer keeps running as long as its main frame is opened.

Do prevent the app from exiting when the help frame is shown in the special
case of the help viewer application where the default behaviour of exiting the
application when only the help window remains open is inappropriate and
results in unexpected program exit if we open and then close any dialog, e.g.
from the help frame toolbar.

Even though the previous commit actually already fixed the problem in the
current code, still apply this fix as well, just in case we can (or could, in
the future) should any dialogs with NULL parent in this program.

Closes #15880.

comment:6 Changed 7 months ago by VZ

(In [75656]) Fix exit on last TLW logic after the change of r75633.

The changes in this revision meant to prevent the closure of transient dialogs
from quitting the application (see #15880) prevented any application using AUI,
including the aui sample, from exiting as the AUI utility frames deleted
during the main frame destruction were returning false from their
IsLastBeforeExit() now.

Fix this by relaxing the check and ignoring the parent if it is already being
deleted anyhow -- in this case there is no danger of closing it accidentally.

Closes #15894.

comment:7 Changed 7 months ago by VZ

(In [75832]) Fix exit on last TLW logic after the change of r75630.

The changes in this revision meant to prevent the closure of transient dialogs
from quitting the application (see #15880) prevented any application using AUI,
including the aui sample, from exiting as the AUI utility frames deleted
during the main frame destruction were returning false from their
IsLastBeforeExit() now.

Fix this by relaxing the check and ignoring the parent if it is already being
deleted anyhow -- in this case there is no danger of closing it accidentally.

Closes #15894.

Note: See TracTickets for help on using tickets.