wayland: Ensure modal hint gets set on map

We need to be mapped to have a gtk_surface and thus be able to do
requests on it so we need to save the modal hint and apply it when we
get mapped so that code that sets the hint before showing a window
doesn't get ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=753138
This commit is contained in:
Rui Matos 2015-08-01 17:03:49 +02:00
parent 36263076b2
commit bd3b496586

View File

@ -159,6 +159,7 @@ static void gdk_wayland_window_configure (GdkWindow *window,
int scale);
static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window);
static void maybe_set_gtk_surface_modal (GdkWindow *window);
static void gdk_window_request_transient_parent_commit (GdkWindow *window);
@ -1026,6 +1027,7 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
xdg_surface_set_app_id (impl->xdg_surface, app_id);
maybe_set_gtk_surface_dbus_properties (window);
maybe_set_gtk_surface_modal (window);
}
static void
@ -1699,8 +1701,7 @@ gdk_wayland_window_init_gtk_surface (GdkWindow *window)
}
static void
gdk_wayland_window_set_modal_hint (GdkWindow *window,
gboolean modal)
maybe_set_gtk_surface_modal (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
@ -1708,10 +1709,19 @@ gdk_wayland_window_set_modal_hint (GdkWindow *window,
if (impl->gtk_surface == NULL)
return;
if (modal)
if (window->modal_hint)
gtk_surface_set_modal (impl->gtk_surface);
else
gtk_surface_unset_modal (impl->gtk_surface);
}
static void
gdk_wayland_window_set_modal_hint (GdkWindow *window,
gboolean modal)
{
window->modal_hint = modal;
maybe_set_gtk_surface_modal (window);
}
static void