GTK4 FileChooser in save mode sometimes disables accept button or tries to enter directory instead of closing the dialog

I’m porting a library to GTK4 from GTK3, and I’m noticing rather strange behavior in the FileChooser dialog when saving files. I’ve tried it on Ubuntu 21.04 with GTK 4.0.3 (from the Ubuntu package repository).

There are actually two different strange behaviors that I’m observing:

  1. After entering a directory (by double-clicking on a directory in the list), the save button is disabled, even if the text box contains a valid file name.
  2. Sometimes if a directory is currently selected, clicking the save button will enter the selected directory instead of closing the dialog. This doesn’t happen all the time though.

It appears as if the save dialog sometimes tries to follow open dialog behaviors.

A minimal example is here: gtk4-test/test.cpp at main · btzy/gtk4-test · GitHub

A video recording of the problem: gtk4-test/Screencast from 29-06-2021 00:32:20.webm at main · btzy/gtk4-test · GitHub

As far as I can tell, I’m using the API correctly (ignoring memory leaks, error handling, and the possibility of getting the “cancel” response). Am I missing anything there?

Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.