[wxWidgets 3.3] wxPreferencesEditor only displayed once under GTK (Issue #26467)

17 views
Skip to first unread message

hatelamers

unread,
May 15, 2026, 3:39:37 PM (3 days ago) May 15
to wx-...@googlegroups.com, Subscribed
hatelamers created an issue (wxWidgets/wxWidgets#26467)

Description

Bug description:

In wxWidgets 3.3 under GTK it is only possible to show the built-in prefernce dialog once: after it is created only the first call to wxPreferencesEditor::Show() would display the dialog, any subsequent calls do nothing. This is a regression comparing to wxWidgets 3.2 brach where wxPreferencesEditor::Show() works as expected.

Expected behaviour:

When implemented like in src/samples/preferences/preferences.cpp the following method

void MyApp::ShowPreferencesEditor(wxWindow* parent)
{
    if ( !m_prefEditor )
    {
        m_prefEditor.reset(new wxPreferencesEditor);
        m_prefEditor->AddPage(new PrefsPageGeneral());
        m_prefEditor->AddPage(new PrefsPageTopics());
    }

    m_prefEditor->Show(parent);
}

should display preferences dialog on all platforms every time it is called.

Observed behaviour:

Under GTK only first call to void MyApp::ShowPreferencesEditor(wxWindow* parent) actually displays the dialog.

To Reproduce:

  1. Compile samples shipped with wxWidgets on Linux (or other platform using GTK)
  2. Execute preferences built in 1
  3. Open preferences dialog and close it (via Close or X button)
  4. Try to open it again - it fails

Details (probable cause):

Debugging leads via wxModelessPreferencesEditorImpl::Show() (generic/preferencesg.cpp:175) to the most probable cause of the bug in wxTopLevelWindowGTK::Raise() (gtk/toplevel.cpp:1306):

    if (!m_isShown)
        return;

Since the preference dialog (hence its top-level window) is hidden at that time, the line with gtk_window_present() doesn't get executed and dialog remains hidden.

Platform and version information

  • wxWidgets version you use: 3.3.2
  • wxWidgets port you use: wxGTK
  • OS and its version: Ubuntu 22.04, Ubuntu 24.04, FreeBSD 14.3-RELEASE
    • GTK version: 3.24.x
    • Which GDK backend is used: both
    • Desktop environment : Gnome


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26467@github.com>

hatelamers

unread,
May 15, 2026, 4:02:12 PM (3 days ago) May 15
to wx-...@googlegroups.com, Subscribed
hatelamers left a comment (wxWidgets/wxWidgets#26467)

Possible (but ugly) workaround:

void MyApp::ShowPreferencesEditor(wxWindow* parent)
{
#if defined (__WXGTK__) && wxCHECK_VERSION(3,3,0)
    m_prefEditor.reset(nullptr);
#endif
    if ( !m_prefEditor )
    {
        m_prefEditor.reset(new wxPreferencesEditor);
        m_prefEditor->AddPage(new PrefsPageGeneral());
        m_prefEditor->AddPage(new PrefsPageTopics());
    }

    m_prefEditor->Show(parent);
}


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26467/4463056859@github.com>

hatelamers

unread,
May 16, 2026, 11:52:32 AM (3 days ago) May 16
to wx-...@googlegroups.com, Subscribed
hatelamers left a comment (wxWidgets/wxWidgets#26467)

I was about to file a PR but @paulcor was faster, kudos for that


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26467/4467327270@github.com>

paulcor

unread,
May 17, 2026, 1:30:49 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed

Closed #26467 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Reply all
Reply to author
Forward
0 new messages