wayland: Send xdg_surface_focused_set / xdg_surface_focused_unset

This commit is contained in:
Jasper St. Pierre 2013-11-12 15:52:03 -05:00
parent 7186841db0
commit 72a900787f
3 changed files with 20 additions and 0 deletions

View File

@ -498,6 +498,8 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
serial = wl_display_next_serial (display);
wl_keyboard_send_leave (resource, serial, keyboard->focus->resource);
wl_list_remove (&keyboard->focus_listener.link);
meta_wayland_surface_focused_unset (keyboard->focus);
}
resource = find_resource_for_surface (&keyboard->resource_list, surface);
@ -534,6 +536,8 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
}
wl_resource_add_destroy_listener (resource, &keyboard->focus_listener);
keyboard->focus_serial = serial;
meta_wayland_surface_focused_set (keyboard->focus);
}
keyboard->focus_resource = resource;

View File

@ -1016,3 +1016,16 @@ meta_wayland_surface_configure_notify (MetaWaylandSurface *surface,
0, 0 /* XXX: support this */);
}
void
meta_wayland_surface_focused_set (MetaWaylandSurface *surface)
{
if (surface->xdg_surface)
xdg_surface_send_focused_set (surface->xdg_surface->resource);
}
void
meta_wayland_surface_focused_unset (MetaWaylandSurface *surface)
{
if (surface->xdg_surface)
xdg_surface_send_focused_unset (surface->xdg_surface->resource);
}

View File

@ -111,4 +111,7 @@ void meta_wayland_surface_configure_notify (MetaWaylandSurface *s
int height,
int edges);
void meta_wayland_surface_focused_set (MetaWaylandSurface *surface);
void meta_wayland_surface_focused_unset (MetaWaylandSurface *surface);
#endif