wxFileDialog GetDirectory method returns empty string with Multiselect in GTK3 (Issue #25976)

18 views
Skip to first unread message

Scott Hanson

unread,
Nov 17, 2025, 9:38:28 AM (4 days ago) Nov 17
to wx-...@googlegroups.com, Subscribed
computergeek1507 created an issue (wxWidgets/wxWidgets#25976)

Description

the GetDirectory method in wxFileDialog class returns an empty string with wxFD_MULTIPLE in GTK3. This started happening after merging in the Native Dialog pull request.

Patch or snippet allowing to reproduce the problem:

configure wx build with

./configure --enable-cxx11 --with-cxx=17 --enable-std_containers --enable-std_string_conv_in_wxstring --enable-backtrace --enable-exceptions --enable-mediactrl --enable-graphics_ctx --enable-monolithic --disable-sdltest --with-gtk=3 --enable-glcanvasegl --disable-pcx --disable-iff --without-libtiff
		

Use the dialogs sample, patch the two lines

diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp
index e6926a851a..6baf3bd08b 100644
--- a/samples/dialogs/dialogs.cpp
+++ b/samples/dialogs/dialogs.cpp
@@ -1979,6 +1979,9 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
         s.Printf("Filter index: %d", dialog.GetFilterIndex());
         msg += s;
 
+        s.Printf("\nDirectory : %s", dialog.GetDirectory());
+        msg += s;
+
         wxMessageDialog dialog2(this, msg, "Selected files");
         dialog2.ShowModal();
     }

Observed behaviour:

In the dialogs example, Select Dialogs -> File operations -> Open files

image.png (view on web)

Select Two Files.

image.png (view on web)

Message Dialog will contain empty string for GetDirectory in message dialog.

Expected behaviour:

Message Dialog return the last selected directory with GetDirectory method.

Platform and version information

  • wxWidgets version you use: wxWidgets master branch
  • wxWidgets port you use: wxGTK
  • OS and its version: Ubuntu 24.04.2 LTS
    • GTK version: 3.24.41
    • Which GDK backend is used: X11 with WSL2
    • Desktop environment : Gnome on WSL2


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25976@github.com>

VZ

unread,
Nov 20, 2025, 6:51:34 PM (yesterday) Nov 20
to wx-...@googlegroups.com, Subscribed

Closed #25976 as completed via de0c23e.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/25976/issue_event/21084583742@github.com>

Reply all
Reply to author
Forward
0 new messages