After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739697 - GTK should warn when reparenting a shown window
GTK should warn when reparenting a shown window
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-11-06 00:01 UTC by Christopher Halse Rogers
Modified: 2018-04-14 23:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Warn when setting transient_for of a realised window. (474 bytes, patch)
2014-11-13 04:16 UTC, Christopher Halse Rogers
reviewed Details | Review
Updated patch; resolves gtk3-demos warnings (27.56 KB, patch)
2015-01-30 06:27 UTC, Christopher Halse Rogers
needs-work Details | Review

Description Christopher Halse Rogers 2014-11-06 00:01:09 UTC
There doesn't seem to be a compelling use-case for an application to want to call gtk_window_set_transient_for on a shown window, and this is likely to look odd.

This warning is similar in spirit to the existing warning on creating a dialog without a parent.
Comment 1 Matthias Clasen 2014-11-09 15:18:28 UTC
have a patch ?
Comment 2 Christopher Halse Rogers 2014-11-13 04:16:02 UTC
Created attachment 290574 [details] [review]
Warn when setting transient_for of a realised window.

Sure, here's a patch.
Comment 3 Matthias Clasen 2014-11-14 14:25:14 UTC
Review of attachment 290574 [details] [review]:

sure
Comment 4 Matthias Clasen 2014-11-14 14:26:05 UTC
Review of attachment 290574 [details] [review]:

sure
Comment 5 Matthias Clasen 2014-11-26 04:47:36 UTC
hmm, trying this patch, the warning triggers basically for every example in gtk-demo, so may not be such a good idea after all.
Comment 6 Matthias Clasen 2014-11-26 04:48:33 UTC
needs a cleanup patch to go along with it, at least.
Comment 7 Christopher Halse Rogers 2015-01-30 06:27:11 UTC
Created attachment 295790 [details] [review]
Updated patch; resolves gtk3-demos warnings

Ok. gtk3-demos warns largely because it parents the already-shown demo window, rather than letting the demo window creator set the right parent (as some of the demos already did).

Then there's a couple of places where menus reparent, which are also fixed.
Comment 8 Matthias Clasen 2015-02-01 16:42:36 UTC
Review of attachment 295790 [details] [review]:

Thanks for the updates. This should be split into separate patches:

1. everything in gtk-demo
2. the menu fix
3. adding the warning itself

The menu fix could do with some explanation in the commit message. It replaces a hide() call by unrealize()

But I still see the warning happening, e.g. from the tooltips code, when opening the file chooser on page1 in gtk3-widget-factory.

To be even more in the spirit of the dialog warning, I think this should be

 if (!gtk_widget_get_mapped (window))
   g_message ("gtk_window_set_transient_for called on a mapped window. This is discouraged.");
Comment 9 Matthias Clasen 2018-02-10 05:11:18 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 10 Matthias Clasen 2018-04-14 23:54:35 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new