window: Don't unmanage transient_for when attached

For some reason, when a modal dialog was made an attaching
transient-for, if the window wasn't "constructing", it would be
unmanaged and rely on some side effect to be recreated. This side
effect is not triggered for Wayland clients, thus if one happen to set
a surface as "modal" via gtk_surface.set_modal before
xdg_toplevel.set_parent, it'd be unmanaged and never show up.

Instead, simply just set the tranciency anyway for Wayland clients.
This makes GTK+ clients that set_modal() before set_transient_for()
work.

https://bugzilla.gnome.org/show_bug.cgi?id=770324
This commit is contained in:
Jonas Ådahl 2016-08-24 12:53:25 +08:00
parent 8942e98e1d
commit 658d97d00e

View File

@ -7415,6 +7415,7 @@ meta_window_set_transient_for (MetaWindow *window,
/* may now be a dialog */ /* may now be a dialog */
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
{
meta_window_x11_recalc_window_type (window); meta_window_x11_recalc_window_type (window);
if (!window->constructing) if (!window->constructing)
@ -7429,11 +7430,13 @@ meta_window_set_transient_for (MetaWindow *window,
{ {
guint32 timestamp; guint32 timestamp;
timestamp = meta_display_get_current_time_roundtrip (window->display); timestamp =
meta_display_get_current_time_roundtrip (window->display);
meta_window_unmanage (window, timestamp); meta_window_unmanage (window, timestamp);
return; return;
} }
} }
}
/* We know this won't create a reference cycle because we check for loops */ /* We know this won't create a reference cycle because we check for loops */
g_clear_object (&window->transient_for); g_clear_object (&window->transient_for);