Steps to reproduce: 1) Start Writer, using the gtk4 VCL plugin on Linux 2) press Ctrl+Shift+S to open the save dialog Actual result: The file dialog opens. However, extra controls like the "Save with password" or "Encrypt with GPG key" checkboxes seen with the gtk3, gen or qt6 VCL plugins are not there, making that functionality unavailable. Expected result: Above-mentioned checkboxes (and more) should be present, allowing e.g. to save a file protected by a password. Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: a4a2cfa1bf746a4c1d379757c99d35ef5ac42cd3 CPU threads: 32; OS: Linux 6.10; UI render: default; VCL: gtk4 Locale: en-GB (en_GB.UTF-8); UI: en-US Calc: CL threaded
Code for these is in vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx in SalGtkFilePicker::SalGtkFilePicker I think. There are various GTK_CHECK_VERSION conditionals in there, but I think it should generally work so hopefully something minor like requiring these to be explicitly shown where maybe that was implicit in earlier versions of gtk
(In reply to Caolán McNamara from comment #1) > Code for these is in vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx in > SalGtkFilePicker::SalGtkFilePicker I think. There are various > GTK_CHECK_VERSION conditionals in there, but I think it should generally > work so hopefully something minor like requiring these to be explicitly > shown where maybe that was implicit in earlier versions of gtk This line there looks relevant: #if !GTK_CHECK_VERSION(4, 0, 0) gtk_file_chooser_set_extra_widget( GTK_FILE_CHOOSER( m_pDialog ), m_pVBox ); #endif Items are added to m_pVBox for GTK 4 as well, but I don't see where m_pVBox is added to the file chooser. `gtk_file_chooser_set_extra_widget` seems gone for GTK 4, the doc for GtkFileChooser [1] mentions this instead: > You can add extra widgets to a file chooser to provide options that are not > present in the default design, by using gtk_file_chooser_add_choice(). Each > choice has an identifier and a user visible label; additionally, each choice > can have multiple options. If a choice has no option, it will be rendered as a > check button with the given label; if a choice has options, it will be rendered > as a combo box. The doc also mentions that GtkFileChooser is deprecated in GTK 4.10 and GtkFileDialog [2] should be used instead. For that one, I don't see any mention of being able to add custom widgets in the doc. [1] https://docs.gtk.org/gtk4/iface.FileChooser.html [2] https://docs.gtk.org/gtk4/class.FileDialog.html
Ah, forgot all that, maybe gtk_file_chooser_add_choice could be made to work (or a replacement dialog of our own that uses GtkFileChooserWidget). All those are deprecated too of course. Life is very difficult for an existing application with gtk4.
(In reply to Caolán McNamara from comment #3) > Ah, forgot all that, maybe gtk_file_chooser_add_choice could be made to work > (or a replacement dialog of our own that uses GtkFileChooserWidget). All > those are deprecated too of course. Life is very difficult for an existing > application with gtk4. Thanks. I think gtk_file_chooser_add_choice wouldn't be flexible enough for our needs, but using GtkFileChooserWidget indeed works. Change series doing that pending in Gerrit now: https://gerrit.libreoffice.org/c/core/+/182610
(In reply to Michael Weghorn from comment #4) > Change series doing that pending in Gerrit now: > https://gerrit.libreoffice.org/c/core/+/182610 With that in place, there's still the problem that e.g. the "Version" combobox in the "File" -> "Open" dialog doesn't contain any values, which IIUC is due to the lack of the "selection-changed" signal that's used in gtk3: From SalGtkFilePicker::execute: #if !GTK_CHECK_VERSION(4, 0, 0) mnHID_SelectionChange = g_signal_connect(m_pFileChooser, "selection-changed", G_CALLBACK( selection_changed_cb ), static_cast<gpointer>(this) ); #else // no replacement in 4-0 that I can see :-( mnHID_SelectionChange = 0; #endif Related: https://discourse.gnome.org/t/gtk4-filechooser-selection-changed-signal-alternative/12180
(In reply to Michael Weghorn from comment #4) > I think gtk_file_chooser_add_choice wouldn't be flexible enough for > our needs, but using GtkFileChooserWidget indeed works. > Change series doing that pending in Gerrit now: > https://gerrit.libreoffice.org/c/core/+/182610 Thinking about it again, it's not even necessary to have a custom GtkDialog with a GtkFileChooserWidget, but it's sufficient to add the widget with the custom controls to the content area of the existing GtkFileChooserDialog (that can be retrieved using `gtk_dialog_get_content_area`), which the updated change series does now.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/521bcdc4535555a45934a6e224a96aa87bbef659 tdf#162995 gtk4: Show extra controls in file dialog It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/678a00dc1eb3ae12ef2d83f6ae12fd6cdf000626 tdf#162995 gtk: Initially hide custom file dialog controls It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Michael Weghorn from comment #5) > With that in place, there's still the problem that e.g. the "Version" > combobox in the "File" -> "Open" dialog doesn't contain any values, which > IIUC is due to the lack of the "selection-changed" signal that's used in > gtk3: > [...] https://gerrit.libreoffice.org/c/core/+/182640 is a potential solution for this, but relies on GTK implementation details due to lack of corresponding API.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/122de03c9693089b2b7b9f26a6faf33d9ecce417 tdf#162995 gtk4: Handle file dialog selection changes It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/76bd6bf83309c50177fc230231755b8aaffb1e77 tdf#162995 gtk4: Add combobox in file dialog after its label It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.