Bug #9399

opening a file from the 'Recent Files' menu results in a recursive call to update_recent_files(..)

Added by Kosta A. about 1 month ago. Updated about 1 month ago.

Status:Closed Start date:09/28/2021
Priority:Normal Due date:
Assignee:Kosta A. % Done:

100%

Category:-
Target version:-
Chirp Version:daily Platform:Windows
Model affected:(All models)

Description

The following console spew is being emited by Gtk each time a file is opened from the Recent Files menu.

chirpw:153: Warning: gsignal.c:2964: invalid object type `
  gtk.main()
chirpw:153: Warning: g_value_type_compatible: assertion `G_TYPE_IS_VALUE (src_type)' failed
  gtk.main()

This is a result of a call being made from within a menu action gtk event, removing the menu action. I suspect this results in some sort internal failure of gtk and the consequences are unknown.

Currently, the call to do_open(..) updates the recent_file list by calling record_recent_file(..) which subsequently modifies the recent_file list and calls update_recent_files(..) to regenerate the action menu items by the old_action and creating a new one. The issue is that the old_action is still executing.

The proposed solution is to only update the submenu of Recent Files menu action when it is activated. thus decoupling the act of update the recent_files list and showing the UI.

Associated revisions

Revision 3580:c22789aeac4a
Added by Kosta A. about 1 month ago

  1. Parent 5aa2294d78ea241c6573dcf1929475b072e73685
    Prevent re-entrant calls to 'update_recent_files' when opening a file from the 'Recent Files' menu action. Fixes #9399.

Gtk was failing on this and was sending an error message to the console.

Revision 3584:d75c87605ad9
Added by Dan Smith about 1 month ago

Fix style issues in fix for #9399.

History

Updated by Kosta A. about 1 month ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Patch sent to dev mailing list.

Updated by Kosta A. about 1 month ago

  • Status changed from Resolved to Closed

Applied in changeset c22789aeac4a.

Also available in: Atom PDF