diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 538f45f5..b00b2cc5 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -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, }; diff --git a/clients/simple-shm.c b/clients/simple-shm.c index ec130ed0..db2da5df 100644 --- a/clients/simple-shm.c +++ b/clients/simple-shm.c @@ -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, }; diff --git a/clients/window.c b/clients/window.c index 5c324d38..4dd6b36f 100644 --- a/clients/window.c +++ b/clients/window.c @@ -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, }; diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index dcf2520a..78119623 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -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 diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml index 3fb4b0c4..4a1d08ab 100644 --- a/protocol/xdg-shell.xml +++ b/protocol/xdg-shell.xml @@ -385,18 +385,25 @@ - - - The focused_set event is sent when this surface has been - activated. Window decorations should be updated accordingly. + + + 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. - - - The focused_unset event is sent when this surface has been - deactivated, because another surface has been activated. Window - decorations should be updated accordingly. + + + 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.