diff options
author | William Hua <william.hua@canonical.com> | 2017-01-12 17:16:27 -0500 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2017-01-12 17:24:19 -0500 |
commit | 670ae58cc9c69cb295822e8e41abd9497171404e (patch) | |
tree | f4ac0740df145e15032da7efc85456dc1c579efd | |
parent | b355c80977acedf5e77695e8b0cbbe19986cbd6b (diff) | |
download | gtk+-670ae58cc9c69cb295822e8e41abd9497171404e.tar.gz |
mir: use modal window hint
-rw-r--r-- | gdk/mir/gdkmirwindowimpl.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 1939e7fb6d..386a964635 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -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; @@ -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, @@ -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, @@ -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, @@ -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 |