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

To try and make the distinction between this event and keyboard focus.
dev
Jasper St. Pierre 11 years ago committed by Kristian Høgsberg
parent a0d8a30931
commit b223a72147
  1. 8
      clients/simple-egl.c
  2. 8
      clients/simple-shm.c
  3. 8
      clients/window.c
  4. 4
      desktop-shell/shell.c
  5. 25
      protocol/xdg-shell.xml

@ -301,12 +301,12 @@ handle_surface_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surf
} }
static void 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 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_unset_maximized,
handle_surface_request_set_fullscreen, handle_surface_request_set_fullscreen,
handle_surface_request_unset_fullscreen, handle_surface_request_unset_fullscreen,
handle_surface_focused_set, handle_surface_activated,
handle_surface_focused_unset, handle_surface_deactivated,
handle_surface_delete, handle_surface_delete,
}; };

@ -140,12 +140,12 @@ handle_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surface)
} }
static void static void
handle_focused_set(void *data, struct xdg_surface *xdg_surface) handle_activated(void *data, struct xdg_surface *xdg_surface)
{ {
} }
static void 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_unset_maximized,
handle_request_set_fullscreen, handle_request_set_fullscreen,
handle_request_unset_fullscreen, handle_request_unset_fullscreen,
handle_focused_set, handle_activated,
handle_focused_unset, handle_deactivated,
handle_delete, handle_delete,
}; };

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

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

@ -385,18 +385,25 @@
</description> </description>
</request> </request>
<event name="focused_set"> <event name="activated">
<description summary="surface was focused"> <description summary="surface was activated">
The focused_set event is sent when this surface has been The activated_set event is sent when this surface has been
activated. Window decorations should be updated accordingly. 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> </description>
</event> </event>
<event name="focused_unset"> <event name="deactivated">
<description summary="surface was unfocused"> <description summary="surface was deactivated">
The focused_unset event is sent when this surface has been The deactivate event is sent when this surface has been
deactivated, because another surface has been activated. Window deactivated, which means that the surface lost user attention.
decorations should be updated accordingly. 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> </description>
</event> </event>

Loading…
Cancel
Save