Opened 5 years ago

Closed 5 years ago

#16863 closed defect (fixed)

wxFileDialog - GtkDialog mapped without a transient parent - GTK3

Reported by: swt2c Owned by: Vadim Zeitlin <vadim@…>
Priority: low Milestone:
Component: wxGTK Version: 3.0.2
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

When a wxFileDialog is created with wxFD_MULTIPLE this message is logged:
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

Can be reproduced with samples/dialogs and Dialogs->File operations->Open files

Change History (9)

comment:1 Changed 5 years ago by pcor

  • Status changed from new to confirmed

This is happening because wxFD_MULTIPLE has the same value as wxDIALOG_NO_PARENT.

comment:2 Changed 5 years ago by vadz

  • Priority changed from normal to low

Changing wxFD_MULTIPLE value to 0x200 should fix this, it is the same as wxALIGN_RIGHT, wxICON_HAND and wxMAXIMIZE_BOX but normally neither of these styles should be used with this dialog.

OTOH we could also filter out all wxFD_XXX styles from the style passed to the base class, this would be more future proof -- but at the price of not allowing to use wxDIALOG_NO_PARENT with wxFileDialog. I don't think it would be a huge loss.

comment:3 Changed 5 years ago by swt2c

Not enough bits in the world. :-)

Vadz, for your second solution, if I'm looking at the code correctly, we would have to do the filtering in all the backends implementations (GTK, Windows, etc.), right?

comment:4 follow-up: Changed 5 years ago by vadz

Yes, it would have to be done in all the implementations but OTOH it's normally just a single line change.

OT3H I start doubting myself... Perhaps it is valuable to be able to use wxDIALOG_NO_PARENT with wxFileDialog. I have trouble imagining when exactly would it be useful, but neither is there any obvious proof that the need for it is not going to arise.

Let's try changing wxFD_MULTIPLE to 0x200 and see what does this break for now... Of course, this isn't going to solve the problem in 3.0 branch :-(

comment:5 Changed 5 years ago by Vadim Zeitlin <vadim@…>

  • Owner set to Vadim Zeitlin <vadim@…>
  • Resolution set to fixed
  • Status changed from confirmed to closed

In b7388f36f295a5a14a29e5d6965ff0e742903cfa/git-wxWidgets:

Change wxFD_MULTIPLE value to avoid conflict with wxDIALOG_NO_PARENT.

This avoids GTK+ warnings about creating a dialog without parent when a
wxFileDialog with wxFD_MULTIPLE style is created.

Closes #16863.

comment:6 in reply to: ↑ 4 Changed 5 years ago by pcor

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to vadz:

Of course, this isn't going to solve the problem in 3.0 branch :-(

So don't say it's fixed.

comment:7 follow-up: Changed 5 years ago by swt2c

Is there a reason changing wxFD_MULTIPLE to 0x200 can't be the solution for 3.0 also? Too risky for breaking existing applications?

comment:8 in reply to: ↑ 7 Changed 5 years ago by pcor

Replying to swt2c:

Is there a reason changing wxFD_MULTIPLE to 0x200 can't be the solution for 3.0 also?

It would break binary compatibility.

comment:9 Changed 5 years ago by Paul Cornett <paulcor@…>

  • Resolution set to fixed
  • Status changed from reopened to closed

In eb4aab5639579264c5de62f662e0562d3d4aad80/git-wxWidgets:

Avoid "Gtk-Message: GtkDialog mapped without a transient parent", closes #16863

Note: See TracTickets for help on using tickets.