Skip to content

Commit

Permalink
mir: use modal window hint
Browse files Browse the repository at this point in the history
  • Loading branch information
William Hua committed Jan 12, 2017
1 parent b355c80 commit 670ae58
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions gdk/mir/gdkmirwindowimpl.c
Expand Up @@ -88,6 +88,7 @@ struct _GdkMirWindowImpl
/* Desired surface attributes */
GdkWindowTypeHint type_hint;
MirSurfaceState surface_state;
gboolean modal;

/* Current button state for checking which buttons are being pressed / released */
gdouble x;
Expand Down Expand Up @@ -296,6 +297,7 @@ create_window_type_spec (GdkDisplay *display,
gint y,
gint width,
gint height,
gboolean modal,
GdkWindowTypeHint type,
const MirRectangle *rect,
MirEdgeAttachment edge,
Expand Down Expand Up @@ -349,6 +351,17 @@ create_window_type_spec (GdkDisplay *display,
switch (type)
{
case GDK_WINDOW_TYPE_HINT_DIALOG:
if (modal)
return mir_connection_create_spec_for_modal_dialog (connection,
width,
height,
format,
parent_surface);
else
return mir_connection_create_spec_for_dialog (connection,
width,
height,
format);
case GDK_WINDOW_TYPE_HINT_DOCK:
return mir_connection_create_spec_for_dialog (connection,
width,
Expand Down Expand Up @@ -421,6 +434,7 @@ create_spec (GdkWindow *window, GdkMirWindowImpl *impl)
impl->transient_for,
impl->transient_x, impl->transient_y,
window->width, window->height,
impl->modal,
impl->type_hint,
impl->has_rect ? &impl->rect : NULL,
impl->has_rect ? impl->edge : mir_edge_attachment_any,
Expand Down Expand Up @@ -1061,8 +1075,15 @@ void
gdk_mir_window_impl_set_modal_hint (GdkWindow *window,
gboolean modal)
{
//g_printerr ("gdk_mir_window_impl_set_modal_hint window=%p\n", window);
/* Mir doesn't support modal windows */
GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);

if (modal != impl->modal)
{
impl->modal = modal;

if (impl->surface && !impl->pending_spec_update)
update_surface_spec (window);
}
}

static void
Expand Down

0 comments on commit 670ae58

Please sign in to comment.