xdg-shell: Rename focused_set / focused_unset to activated / deactivated

To try and make the distinction between this event and keyboard focus.
This commit is contained in:
Jasper St. Pierre 2014-02-08 18:11:53 -05:00 committed by Kristian Høgsberg
parent a0d8a30931
commit b223a72147
5 changed files with 30 additions and 23 deletions

View file

@ -301,12 +301,12 @@ handle_surface_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surf
}
static void
handle_surface_focused_set(void *data, struct xdg_surface *xdg_surface)
handle_surface_activated(void *data, struct xdg_surface *xdg_surface)
{
}
static void
handle_surface_focused_unset(void *data, struct xdg_surface *xdg_surface)
handle_surface_deactivated(void *data, struct xdg_surface *xdg_surface)
{
}
@ -322,8 +322,8 @@ static const struct xdg_surface_listener xdg_surface_listener = {
handle_surface_request_unset_maximized,
handle_surface_request_set_fullscreen,
handle_surface_request_unset_fullscreen,
handle_surface_focused_set,
handle_surface_focused_unset,
handle_surface_activated,
handle_surface_deactivated,
handle_surface_delete,
};

View file

@ -140,12 +140,12 @@ handle_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surface)
}
static void
handle_focused_set(void *data, struct xdg_surface *xdg_surface)
handle_activated(void *data, struct xdg_surface *xdg_surface)
{
}
static void
handle_focused_unset(void *data, struct xdg_surface *xdg_surface)
handle_deactivated(void *data, struct xdg_surface *xdg_surface)
{
}
@ -161,8 +161,8 @@ static const struct xdg_surface_listener xdg_surface_listener = {
handle_request_unset_maximized,
handle_request_set_fullscreen,
handle_request_unset_fullscreen,
handle_focused_set,
handle_focused_unset,
handle_activated,
handle_deactivated,
handle_delete,
};

View file

@ -3867,14 +3867,14 @@ handle_surface_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surf
}
static void
handle_surface_focused_set(void *data, struct xdg_surface *xdg_surface)
handle_surface_activated(void *data, struct xdg_surface *xdg_surface)
{
struct window *window = data;
window->focused = 1;
}
static void
handle_surface_focused_unset(void *data, struct xdg_surface *xdg_surface)
handle_surface_deactivated(void *data, struct xdg_surface *xdg_surface)
{
struct window *window = data;
window->focused = 0;
@ -3893,8 +3893,8 @@ static const struct xdg_surface_listener xdg_surface_listener = {
handle_surface_request_unset_maximized,
handle_surface_request_set_fullscreen,
handle_surface_request_unset_fullscreen,
handle_surface_focused_set,
handle_surface_focused_unset,
handle_surface_activated,
handle_surface_deactivated,
handle_surface_delete,
};

View file

@ -1934,7 +1934,7 @@ shell_surface_lose_keyboard_focus(struct shell_surface *shsurf)
{
if (--shsurf->focus_count == 0)
if (shell_surface_is_xdg_surface(shsurf))
xdg_surface_send_focused_unset(shsurf->resource);
xdg_surface_send_deactivated(shsurf->resource);
}
static void
@ -1942,7 +1942,7 @@ shell_surface_gain_keyboard_focus(struct shell_surface *shsurf)
{
if (shsurf->focus_count++ == 0)
if (shell_surface_is_xdg_surface(shsurf))
xdg_surface_send_focused_set(shsurf->resource);
xdg_surface_send_activated(shsurf->resource);
}
static void

View file

@ -385,18 +385,25 @@
</description>
</request>
<event name="focused_set">
<description summary="surface was focused">
The focused_set event is sent when this surface has been
activated. Window decorations should be updated accordingly.
<event name="activated">
<description summary="surface was activated">
The activated_set event is sent when this surface has been
activated, which means that the surface has user attention.
Window decorations should be updated accordingly. You should
not use this event for anything but the style of decorations
you display, use wl_keyboard.enter and wl_keyboard.leave for
determining keyboard focus.
</description>
</event>
<event name="focused_unset">
<description summary="surface was unfocused">
The focused_unset event is sent when this surface has been
deactivated, because another surface has been activated. Window
decorations should be updated accordingly.
<event name="deactivated">
<description summary="surface was deactivated">
The deactivate event is sent when this surface has been
deactivated, which means that the surface lost user attention.
Window decorations should be updated accordingly. You should
not use this event for anything but the style of decorations
you display, use wl_keyboard.enter and wl_keyboard.leave for
determining keyboard focus.
</description>
</event>