int duration;
struct wl_resource *binding;
struct weston_process process;
+ struct wl_event_source *timer;
} screensaver;
struct {
parse_config_file(config_file, cs, ARRAY_LENGTH(cs), shell);
shell->screensaver.path = path;
- shell->screensaver.duration = duration;
+ shell->screensaver.duration = duration * 1000;
shell->binding_modifier = get_modifier(modifier);
shell->win_animation_type = get_animation_type(win_animation);
shell->workspaces.num = num_workspaces > 0 ? num_workspaces : 1;
};
static void
+shell_fade(struct desktop_shell *shell, enum fade_type type);
+
+static int
+screensaver_timeout(void *data)
+{
+ struct desktop_shell *shell = data;
+
+ shell_fade(shell, FADE_OUT);
+
+ return 1;
+}
+
+static void
handle_screensaver_sigchld(struct weston_process *proc, int status)
{
struct desktop_shell *shell =
restore_focus_state(shell, get_current_workspace(shell));
shell->locked = false;
- shell->compositor->idle_time = shell->compositor->option_idle_time;
weston_compositor_wake(shell->compositor);
weston_compositor_damage_all(shell->compositor);
}
wl_list_insert(shell->lock_layer.surface_list.prev,
&surface->layer_link);
weston_surface_update_transform(surface);
- shell->compositor->idle_time = shell->screensaver.duration;
+ wl_event_source_timer_update(shell->screensaver.timer,
+ shell->screensaver.duration);
shell_fade(shell, FADE_IN);
- weston_compositor_wake(shell->compositor);
shell->compositor->state = WESTON_COMPOSITOR_IDLE;
}
}
loop = wl_display_get_event_loop(ec->wl_display);
wl_event_loop_add_idle(loop, launch_desktop_shell_process, shell);
+ shell->screensaver.timer =
+ wl_event_loop_add_timer(loop, screensaver_timeout, shell);
+
wl_list_for_each(seat, &ec->seat_list, link)
create_pointer_focus_listener(seat);