xdg-shell: Turn "activated" into a state

This drops two events, and makes new window decorations race-free with
an attach in-flight.
This commit is contained in:
Jasper St. Pierre
2014-05-06 08:44:29 -04:00
committed by Kristian Høgsberg
parent de6809912e
commit 973d7879e3
5 changed files with 15 additions and 66 deletions
+6 -4
View File
@@ -2009,16 +2009,14 @@ static void
shell_surface_lose_keyboard_focus(struct shell_surface *shsurf)
{
if (--shsurf->focus_count == 0)
if (shell_surface_is_xdg_surface(shsurf))
xdg_surface_send_deactivated(shsurf->resource);
shell_surface_state_changed(shsurf);
}
static void
shell_surface_gain_keyboard_focus(struct shell_surface *shsurf)
{
if (shsurf->focus_count++ == 0)
if (shell_surface_is_xdg_surface(shsurf))
xdg_surface_send_activated(shsurf->resource);
shell_surface_state_changed(shsurf);
}
static void
@@ -3557,6 +3555,10 @@ xdg_send_configure(struct weston_surface *surface,
s = wl_array_add(&states, sizeof *s);
*s = XDG_SURFACE_STATE_RESIZING;
}
if (shsurf->focus_count > 0) {
s = wl_array_add(&states, sizeof *s);
*s = XDG_SURFACE_STATE_ACTIVATED;
}
serial = wl_display_next_serial(shsurf->surface->compositor->wl_display);
xdg_surface_send_configure(shsurf->resource, width, height, &states, serial);