mir: update surface type based on events

This commit is contained in:
Marco Trevisan (Treviño) 2014-11-17 17:22:01 +01:00
parent 7651061920
commit e0e46a4f6b
3 changed files with 16 additions and 4 deletions

View File

@ -61,6 +61,8 @@ GdkWindowImpl *_gdk_mir_window_impl_new (void);
void _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState state);
void _gdk_mir_window_impl_set_surface_type (GdkMirWindowImpl *impl, MirSurfaceType type);
void _gdk_mir_window_impl_set_cursor_state (GdkMirWindowImpl *impl, gdouble x, gdouble y, gboolean cursor_inside, MirMotionButton button_state);
void _gdk_mir_window_impl_get_cursor_state (GdkMirWindowImpl *impl, gdouble *x, gdouble *y, gboolean *cursor_inside, MirMotionButton *button_state);

View File

@ -343,6 +343,7 @@ handle_surface_event (GdkWindow *window, const MirSurfaceEvent *event)
switch (event->attrib)
{
case mir_surface_attrib_type:
_gdk_mir_window_impl_set_surface_type (impl, event->value);
break;
case mir_surface_attrib_state:
_gdk_mir_window_impl_set_surface_state (impl, event->value);

View File

@ -92,6 +92,12 @@ _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState
impl->surface_state = state;
}
void
_gdk_mir_window_impl_set_surface_type (GdkMirWindowImpl *impl, MirSurfaceType type)
{
impl->surface_type = type;
}
void
_gdk_mir_window_impl_set_cursor_state (GdkMirWindowImpl *impl,
gdouble x,
@ -741,7 +747,6 @@ gdk_mir_window_impl_set_type_hint (GdkWindow *window,
{
case GDK_WINDOW_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_DESKTOP:
mir_type = mir_surface_type_normal;
break;
@ -755,7 +760,7 @@ gdk_mir_window_impl_set_type_hint (GdkWindow *window,
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_COMBO:
mir_type = mir_surface_type_popover;
mir_type = mir_surface_type_menu;
break;
case GDK_WINDOW_TYPE_HINT_TOOLTIP:
mir_type = mir_surface_type_tip;
@ -765,6 +770,9 @@ gdk_mir_window_impl_set_type_hint (GdkWindow *window,
case GDK_WINDOW_TYPE_HINT_NOTIFICATION:
mir_type = mir_surface_type_overlay;
break;
case GDK_WINDOW_TYPE_HINT_TOOLBAR:
mir_type = mir_surface_type_satellite;
break;
}
set_surface_type (GDK_MIR_WINDOW_IMPL (window->impl), mir_type);
@ -780,7 +788,6 @@ gdk_mir_window_impl_get_type_hint (GdkWindow *window)
case mir_surface_type_normal:
case mir_surface_type_freestyle:
case mir_surface_type_inputmethod:
case mir_surface_type_satellite:
return GDK_WINDOW_TYPE_HINT_NORMAL;
case mir_surface_type_utility:
return GDK_WINDOW_TYPE_HINT_UTILITY;
@ -788,10 +795,12 @@ gdk_mir_window_impl_get_type_hint (GdkWindow *window)
return GDK_WINDOW_TYPE_HINT_DIALOG;
case mir_surface_type_tip:
return GDK_WINDOW_TYPE_HINT_TOOLTIP;
case mir_surface_type_popover:
case mir_surface_type_menu:
return GDK_WINDOW_TYPE_HINT_MENU;
case mir_surface_type_overlay:
return GDK_WINDOW_TYPE_HINT_NOTIFICATION;
case mir_surface_type_satellite:
return GDK_WINDOW_TYPE_HINT_TOOLBAR;
case mir_surface_types:
break;
}