Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:49:29+00:00 2026-05-25T20:49:29+00:00

My program opens a wxFrame-based window and multiple modeless and parentless wxDialog-based windows. It

  • 0

My program opens a wxFrame-based window and multiple modeless and parentless wxDialog-based windows. It all works beautifully, except that the wxDialog-based windows insist on always being on top of the wxFrame-based one.

I know about wxDIALOG_NO_PARENT, and I’m using it. The dialogs stay open when I close the wxFrame, so they definitely don’t have the wxFrame window as a parent.

(If it matters, I’m using C++, wxWidgets 2.8.something, and running it on Ubuntu Linux. My program isn’t ready to compile on any other platform, so I haven’t tested it on others yet.)

I want all the windows to operate entirely independently, so the user can use the wxFrame window as well as the wxDialog ones. Can anyone point me in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:49:29+00:00Added an answer on May 25, 2026 at 8:49 pm

    It seems that this behavior comes from a difference in how Gnome handles windows with different “type hints”…it puts them into their own z-index groupings:

    https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkWindowTypeHint

    The dialog is created with GDK_WINDOW_TYPE_HINT_DIALOG while your other window is most likely created with GDK_WINDOW_TYPE_HINT_NORMAL. The point where this decision is made is in gtk/toplevel.cpp and it’s being cued by the fact that the “extra” style flags contain wxTOPLEVEL_EX_DIALOG:

    toplevel.cpp#L594

    Those are the only two calls to gtk_window_set_type_hint in the wxWidgets GTK codebase, except for in the splash screen code. So changing the “extra” style bits after the fact isn’t going to help. (The “correct” solution would be to patch wxWidgets so that adjusting wxTOPLEVEL_EX_DIALOG in the extra styles would do the proper adjustment to the window type hint.)

    You can’t use the wxDialog class without running through its constructor, which calls the non-virtual method wxDialog::Create, which sets the extra style to wxTOPLEVEL_EX_DIALOG and then goes directly to top level window creation:

    dialog.cpp#L54

    So I guess you have the option of trying this, which works if you haven’t shown the dialog window yet:

    #ifdef __WXGTK__
    gtk_window_set_type_hint(
        GTK_WINDOW(iShouldBeUsingQtDialog->GetHandle()),
        GDK_WINDOW_TYPE_HINT_NORMAL);
    #endif
    

    …and if you have shown the dialog already, you need to use this for it to work:

    #ifdef __WXGTK__
    gdk_window_set_type_hint(
        iShouldBeUsingQtDialog->GetHandle()->window,
        GDK_WINDOW_TYPE_HINT_NORMAL);
    #endif
    

    Both cases will require you to add an include file into your source:

    #ifdef __WXGTK__
    #include "gtk/gtkwindow.h"
    #endif
    

    …and you’ll have to update your build to find the GTK includes. On the command line for G++ I tried this and it worked:

    pkg-config --cflags --libs gtk+-2.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a program that opens an application, sleeps the thread for 500ms then
I have a python program that opens several urls in seperate tabs in a
I have a Java program that opens a file using the RandomAccessFile class. I'd
I have a simple Tray icon program that opens a site using System.Diagnostics.Process.Start(URL) And
I have a program that when it starts, opens a winform (it is the
I have a program that opens a large binary file, appends a small amount
I have a python program which opens a new windows to display some 'about'
I have a Java program that opens a socket connection to a server that
I have created a program that opens image files. How can I make my
I'm trying to make test-program that opens a website by pushing a button. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.