Skip to content
Commits on Source (6)
......@@ -2362,7 +2362,9 @@ map(struct desktop_shell *shell, struct shell_surface *shsurf)
if (!shell->locked) {
wl_list_for_each(seat, &compositor->seat_list, link)
activate(shell, shsurf->view, seat,
WESTON_ACTIVATE_FLAG_CONFIGURE);
WESTON_ACTIVATE_FLAG_CONFIGURE |
(shsurf->state.fullscreen ?
WESTON_ACTIVATE_FLAG_FULLSCREEN : 0));
}
if (!shsurf->state.fullscreen && !shsurf->state.maximized) {
......@@ -2454,7 +2456,13 @@ desktop_surface_committed(struct weston_desktop_surface *desktop_surface,
weston_view_update_transform(shsurf->view);
if (shsurf->state.fullscreen) {
shell_configure_fullscreen(shsurf);
struct weston_seat *seat;
wl_list_for_each(seat, &surface->compositor->seat_list,link) {
activate(shell, shsurf->view, seat,
WESTON_ACTIVATE_FLAG_CONFIGURE |
WESTON_ACTIVATE_FLAG_FULLSCREEN);
}
} else if (shsurf->state.maximized) {
set_maximized_position(shell, shsurf);
surface->output = shsurf->output;
......@@ -3692,7 +3700,8 @@ lower_fullscreen_layer(struct desktop_shell *shell,
/* We can have a non-fullscreen popup for a fullscreen surface
* in the fullscreen layer. */
if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface)) {
if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface) &&
shsurf->fullscreen.black_view) {
/* Hide the black view */
weston_layer_entry_remove(&shsurf->fullscreen.black_view->view->layer_link);
wl_list_init(&shsurf->fullscreen.black_view->view->layer_link.link);
......
......@@ -1772,8 +1772,9 @@ struct weston_surface_state {
};
struct weston_surface_activation_data {
struct weston_surface *surface;
struct weston_view *view;
struct weston_seat *seat;
uint32_t flags;
};
struct weston_pointer_constraint {
......@@ -1967,6 +1968,7 @@ enum weston_activate_flag {
WESTON_ACTIVATE_FLAG_NONE = 0,
WESTON_ACTIVATE_FLAG_CONFIGURE = 1 << 0,
WESTON_ACTIVATE_FLAG_CLICKED = 1 << 1,
WESTON_ACTIVATE_FLAG_FULLSCREEN = 1 << 2,
};
void
......
......@@ -2342,6 +2342,7 @@ weston_view_activate_input(struct weston_view *view,
uint32_t flags)
{
struct weston_compositor *compositor = seat->compositor;
struct weston_surface_activation_data activation_data;
if (flags & WESTON_ACTIVATE_FLAG_CLICKED) {
view->click_to_activate_serial =
......@@ -2349,6 +2350,15 @@ weston_view_activate_input(struct weston_view *view,
}
weston_seat_set_keyboard_focus(seat, view->surface);
inc_activate_serial(compositor);
activation_data = (struct weston_surface_activation_data) {
.view = view,
.seat = seat,
.flags = flags
};
wl_signal_emit(&compositor->activate_signal, &activation_data);
}
WL_EXPORT void
......@@ -4609,22 +4619,12 @@ WL_EXPORT void
weston_seat_set_keyboard_focus(struct weston_seat *seat,
struct weston_surface *surface)
{
struct weston_compositor *compositor = seat->compositor;
struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
struct weston_surface_activation_data activation_data;
if (keyboard && keyboard->focus != surface) {
weston_keyboard_set_focus(keyboard, surface);
wl_data_device_set_keyboard_focus(seat);
}
inc_activate_serial(compositor);
activation_data = (struct weston_surface_activation_data) {
.surface = surface,
.seat = seat,
};
wl_signal_emit(&compositor->activate_signal, &activation_data);
}
static void
......@@ -4824,7 +4824,7 @@ pointer_constraint_surface_activate(struct wl_listener *listener, void *data)
{
struct weston_surface_activation_data *activation = data;
struct weston_pointer *pointer;
struct weston_surface *focus = activation->surface;
struct weston_surface *focus = activation->view->surface;
struct weston_pointer_constraint *constraint =
container_of(listener, struct weston_pointer_constraint,
surface_activate_listener);
......@@ -4838,8 +4838,17 @@ pointer_constraint_surface_activate(struct wl_listener *listener, void *data)
get_pointer_constraint_for_pointer(focus, pointer) == constraint;
if (is_constraint_surface &&
!is_pointer_constraint_enabled(constraint))
maybe_enable_pointer_constraint(constraint);
!is_pointer_constraint_enabled(constraint)) {
if (activation->flags & WESTON_ACTIVATE_FLAG_FULLSCREEN) {
weston_view_update_transform(activation->view);
weston_pointer_set_focus(pointer, activation->view);
enable_pointer_constraint(constraint, activation->view);
maybe_warp_confined_pointer(constraint);
}
else {
maybe_enable_pointer_constraint(constraint);
}
}
else if (!is_constraint_surface &&
is_pointer_constraint_enabled(constraint))
disable_pointer_constraint(constraint);
......
......@@ -984,7 +984,7 @@ static void
weston_wm_window_activate(struct wl_listener *listener, void *data)
{
struct weston_surface_activation_data *activation_data = data;
struct weston_surface *surface = activation_data->surface;
struct weston_surface *surface = activation_data->view->surface;
struct weston_wm_window *window = NULL;
struct weston_wm *wm =
container_of(listener, struct weston_wm, activate_listener);
......