GtkFilechooserWidget: prevent oblivious selection of file

which could happen after confirming the "file overwrite"
dialog and may result in a different file being overwritten
causing data loss.

The oblivious file selection can be done by a mouse
click or keyboard press sent inadvertently just after
confirming the "file overwrite" dialog (and before the
enclosing GtkfilechooserDialog is closed).

Fixed by adding a flag to ignore any button/key press
events sent to the file list. We set this flag just
after the user accepts the "file overwrite" dialog (which
means the enclosing GtkfilechooserDialog is about to
get closed). And we restablish the flag when the dialog
is shown again (in its map() handler).

Fixes data loss issue #2288
10 jobs for BUG_filechooser_async_data_loss_GTK4 in 46 minutes and 28 seconds (queued for 1 second)
Status Job ID Name Coverage
  .Pre
failed #672706
allowed to fail
style-check-diff

00:02:38

 
  Build
passed #672707
fedora-x86_64

00:07:01

passed #674529
win32
msys2-mingw32

00:14:34

passed #672708
release-build

00:07:08

failed #672709
win32
msys2-mingw32

00:04:36

 
  Analysis
passed #672710
static-scan

00:13:34

 
  Docs
passed #672711
reference

00:08:32

 
  Flatpak
manual #672712
flatpak allowed to fail manual
flatpak-manual:demo
manual #672714
flatpak allowed to fail manual
flatpak-manual:icon-browser
manual #672713
flatpak allowed to fail manual
flatpak-manual:widget-factory
 
Name Stage Failure
failed
style-check-diff .Pre
-                                 GtkFileChooserWidget  *impl)
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GtkFileChooserWidget *impl)
{
if (impl->browse_files_interaction_frozen)
{
ERROR: Job failed: exit code 1