Lines Matching refs:shell
51 struct desktop_shell *shell; member
105 struct desktop_shell *shell; member
204 shell_fade_startup(struct desktop_shell *shell);
207 shell_fade(struct desktop_shell *shell, enum fade_type type);
213 get_output_panel_size(struct desktop_shell *shell,
274 struct desktop_shell *shell = shsurf->shell; in shell_grab_start() local
286 if (shell->child.desktop_shell) { in shell_grab_start()
287 weston_desktop_shell_send_grab_cursor(shell->child.desktop_shell, in shell_grab_start()
290 get_default_view(shell->grab_surface), in shell_grab_start()
297 get_panel_size(struct desktop_shell *shell, in get_panel_size() argument
314 get_output_panel_size(struct desktop_shell *shell, in get_output_panel_size() argument
327 wl_list_for_each(view, &shell->panel_layer.view_list.link, layer_link.link) { in get_output_panel_size()
329 get_panel_size(shell, view, width, height); in get_output_panel_size()
338 get_output_work_area(struct desktop_shell *shell, in get_output_work_area() argument
356 get_output_panel_size(shell, output, &panel_width, &panel_height); in get_output_work_area()
357 switch (shell->panel_position) { in get_output_work_area()
397 struct desktop_shell *shell = shsurf->shell; in shell_touch_grab_start() local
411 if (shell->child.desktop_shell) in shell_touch_grab_start()
413 get_default_view(shell->grab_surface)); in shell_touch_grab_start()
466 shell_configuration(struct desktop_shell *shell) in shell_configuration() argument
472 section = weston_config_get_section(wet_get_config(shell->compositor), in shell_configuration()
477 shell->client = s; in shell_configuration()
481 shell->allow_zap = allow_zap; in shell_configuration()
485 shell->binding_modifier = get_modifier(s); in shell_configuration()
490 shell->exposay_modifier = get_modifier(s); in shell_configuration()
494 shell->win_animation_type = get_animation_type(s); in shell_configuration()
497 shell->win_close_animation_type = get_animation_type(s); in shell_configuration()
501 shell->startup_animation_type = get_animation_type(s); in shell_configuration()
503 if (shell->startup_animation_type == ANIMATION_ZOOM) in shell_configuration()
504 shell->startup_animation_type = ANIMATION_NONE; in shell_configuration()
506 shell->focus_animation_type = get_animation_type(s); in shell_configuration()
509 &shell->workspaces.num, in shell_configuration()
674 activate(state->shell, next, state->seat, in focus_state_surface_destroy()
677 if (state->shell->focus_animation_type == ANIMATION_DIM_LAYER) { in focus_state_surface_destroy()
693 focus_state_create(struct desktop_shell *shell, struct weston_seat *seat, in focus_state_create() argument
702 state->shell = shell; in focus_state_create()
718 ensure_focus_state(struct desktop_shell *shell, struct weston_seat *seat) in ensure_focus_state() argument
720 struct workspace *ws = get_current_workspace(shell); in ensure_focus_state()
728 state = focus_state_create(shell, seat, ws); in ensure_focus_state()
749 restore_focus_state(struct desktop_shell *shell, struct workspace *ws) in restore_focus_state() argument
759 wl_list_insert_list(&pending_seat_list, &shell->compositor->seat_list); in restore_focus_state()
760 wl_list_init(&shell->compositor->seat_list); in restore_focus_state()
767 wl_list_insert(&shell->compositor->seat_list, in restore_focus_state()
784 wl_list_insert(&shell->compositor->seat_list, &seat->link); in restore_focus_state()
794 replace_focus_state(struct desktop_shell *shell, struct workspace *ws, in replace_focus_state() argument
809 drop_focus_state(struct desktop_shell *shell, struct workspace *ws, in drop_focus_state() argument
820 animate_focus_change(struct desktop_shell *shell, struct workspace *ws, in animate_focus_change() argument
827 if (from == to || shell->focus_animation_type != ANIMATION_DIM_LAYER) in animate_focus_change()
830 output = get_default_output(shell->compositor); in animate_focus_change()
832 ws->fsurf_front = create_focus_surface(shell->compositor, output); in animate_focus_change()
837 ws->fsurf_back = create_focus_surface(shell->compositor, output); in animate_focus_change()
915 workspace_create(struct desktop_shell *shell) in workspace_create() argument
921 weston_layer_init(&ws->layer, shell->compositor); in workspace_create()
940 get_workspace(struct desktop_shell *shell, unsigned int index) in get_workspace() argument
942 struct workspace **pws = shell->workspaces.array.data; in get_workspace()
943 assert(index < shell->workspaces.num); in get_workspace()
949 get_current_workspace(struct desktop_shell *shell) in get_current_workspace() argument
951 return get_workspace(shell, shell->workspaces.current); in get_current_workspace()
955 activate_workspace(struct desktop_shell *shell, unsigned int index) in activate_workspace() argument
959 ws = get_workspace(shell, index); in activate_workspace()
962 shell->workspaces.current = index; in activate_workspace()
1042 reverse_workspace_change_animation(struct desktop_shell *shell, in reverse_workspace_change_animation() argument
1047 shell->workspaces.current = index; in reverse_workspace_change_animation()
1049 shell->workspaces.anim_to = to; in reverse_workspace_change_animation()
1050 shell->workspaces.anim_from = from; in reverse_workspace_change_animation()
1051 shell->workspaces.anim_dir = -1 * shell->workspaces.anim_dir; in reverse_workspace_change_animation()
1052 shell->workspaces.anim_timestamp = (struct timespec) { 0 }; in reverse_workspace_change_animation()
1057 weston_compositor_schedule_repaint(shell->compositor); in reverse_workspace_change_animation()
1080 finish_workspace_change_animation(struct desktop_shell *shell, in finish_workspace_change_animation() argument
1086 weston_compositor_schedule_repaint(shell->compositor); in finish_workspace_change_animation()
1095 wl_list_remove(&shell->workspaces.animation.link); in finish_workspace_change_animation()
1098 shell->workspaces.anim_to = NULL; in finish_workspace_change_animation()
1100 weston_layer_unset_position(&shell->workspaces.anim_from->layer); in finish_workspace_change_animation()
1108 struct desktop_shell *shell = in animate_workspace_change_frame() local
1111 struct workspace *from = shell->workspaces.anim_from; in animate_workspace_change_frame()
1112 struct workspace *to = shell->workspaces.anim_to; in animate_workspace_change_frame()
1117 finish_workspace_change_animation(shell, from, to); in animate_workspace_change_frame()
1121 if (timespec_is_zero(&shell->workspaces.anim_timestamp)) { in animate_workspace_change_frame()
1122 if (shell->workspaces.anim_current == 0.0) in animate_workspace_change_frame()
1123 shell->workspaces.anim_timestamp = *time; in animate_workspace_change_frame()
1125 timespec_add_msec(&shell->workspaces.anim_timestamp, in animate_workspace_change_frame()
1128 -(asin(1.0 - shell->workspaces.anim_current) * in animate_workspace_change_frame()
1133 t = timespec_sub_to_msec(time, &shell->workspaces.anim_timestamp); in animate_workspace_change_frame()
1143 weston_compositor_schedule_repaint(shell->compositor); in animate_workspace_change_frame()
1145 workspace_translate_out(from, shell->workspaces.anim_dir * y); in animate_workspace_change_frame()
1146 workspace_translate_in(to, shell->workspaces.anim_dir * y); in animate_workspace_change_frame()
1147 shell->workspaces.anim_current = y; in animate_workspace_change_frame()
1149 weston_compositor_schedule_repaint(shell->compositor); in animate_workspace_change_frame()
1152 finish_workspace_change_animation(shell, from, to); in animate_workspace_change_frame()
1156 animate_workspace_change(struct desktop_shell *shell, in animate_workspace_change() argument
1165 if (index > shell->workspaces.current) in animate_workspace_change()
1170 shell->workspaces.current = index; in animate_workspace_change()
1172 shell->workspaces.anim_dir = dir; in animate_workspace_change()
1173 shell->workspaces.anim_from = from; in animate_workspace_change()
1174 shell->workspaces.anim_to = to; in animate_workspace_change()
1175 shell->workspaces.anim_current = 0.0; in animate_workspace_change()
1176 shell->workspaces.anim_timestamp = (struct timespec) { 0 }; in animate_workspace_change()
1178 output = container_of(shell->compositor->output_list.next, in animate_workspace_change()
1181 &shell->workspaces.animation.link); in animate_workspace_change()
1188 restore_focus_state(shell, to); in animate_workspace_change()
1190 weston_compositor_schedule_repaint(shell->compositor); in animate_workspace_change()
1194 update_workspace(struct desktop_shell *shell, unsigned int index, in update_workspace() argument
1197 shell->workspaces.current = index; in update_workspace()
1203 change_workspace(struct desktop_shell *shell, unsigned int index) in change_workspace() argument
1209 if (index == shell->workspaces.current) in change_workspace()
1213 if (!wl_list_empty(&shell->fullscreen_layer.view_list.link)) in change_workspace()
1216 from = get_current_workspace(shell); in change_workspace()
1217 to = get_workspace(shell, index); in change_workspace()
1219 if (shell->workspaces.anim_from == to && in change_workspace()
1220 shell->workspaces.anim_to == from) { in change_workspace()
1221 restore_focus_state(shell, to); in change_workspace()
1222 reverse_workspace_change_animation(shell, index, from, to); in change_workspace()
1226 if (shell->workspaces.anim_to != NULL) in change_workspace()
1227 finish_workspace_change_animation(shell, in change_workspace()
1228 shell->workspaces.anim_from, in change_workspace()
1229 shell->workspaces.anim_to); in change_workspace()
1231 restore_focus_state(shell, to); in change_workspace()
1233 if (shell->focus_animation_type != ANIMATION_NONE) { in change_workspace()
1236 animate_focus_change(shell, from, in change_workspace()
1241 animate_focus_change(shell, to, in change_workspace()
1246 update_workspace(shell, index, from, to); in change_workspace()
1248 animate_workspace_change(shell, index, from, to); in change_workspace()
1289 take_surface_to_workspace_by_seat(struct desktop_shell *shell, in take_surface_to_workspace_by_seat() argument
1304 index == shell->workspaces.current || in take_surface_to_workspace_by_seat()
1308 from = get_current_workspace(shell); in take_surface_to_workspace_by_seat()
1309 to = get_workspace(shell, index); in take_surface_to_workspace_by_seat()
1318 replace_focus_state(shell, to, seat); in take_surface_to_workspace_by_seat()
1319 drop_focus_state(shell, from, surface); in take_surface_to_workspace_by_seat()
1321 if (shell->workspaces.anim_from == to && in take_surface_to_workspace_by_seat()
1322 shell->workspaces.anim_to == from) { in take_surface_to_workspace_by_seat()
1323 reverse_workspace_change_animation(shell, index, from, to); in take_surface_to_workspace_by_seat()
1328 if (shell->workspaces.anim_to != NULL) in take_surface_to_workspace_by_seat()
1329 finish_workspace_change_animation(shell, in take_surface_to_workspace_by_seat()
1330 shell->workspaces.anim_from, in take_surface_to_workspace_by_seat()
1331 shell->workspaces.anim_to); in take_surface_to_workspace_by_seat()
1335 update_workspace(shell, index, from, to); in take_surface_to_workspace_by_seat()
1339 wl_list_insert(&shell->workspaces.anim_sticky_list, in take_surface_to_workspace_by_seat()
1342 animate_workspace_change(shell, index, from, to); in take_surface_to_workspace_by_seat()
1345 state = ensure_focus_state(shell, seat); in take_surface_to_workspace_by_seat()
1485 if (shsurf->shell->panel_position == in constrain_position()
1487 get_output_work_area(shsurf->shell, surface->output, &area); in constrain_position()
1819 activate(shsurf->shell, shsurf->view, seat, in busy_cursor_grab_button()
1823 activate(shsurf->shell, shsurf->view, seat, in busy_cursor_grab_button()
1916 return &shsurf->shell->fullscreen_layer.view_list; in shell_surface_calculate_layer_link()
1922 ws = get_current_workspace(shsurf->shell); in shell_surface_calculate_layer_link()
2002 struct desktop_shell *shell);
2019 weston_view_set_initial_position(shsurf->view, shsurf->shell); in unset_fullscreen()
2042 weston_view_set_initial_position(shsurf->view, shsurf->shell); in unset_maximized()
2066 current_ws = get_current_workspace(shsurf->shell); in set_minimized()
2069 weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link); in set_minimized()
2071 drop_focus_state(shsurf->shell, current_ws, view->surface); in set_minimized()
2082 return shsurf->shell; in shell_surface_get_shell()
2190 weston_layer_entry_insert(&shsurf->shell->fullscreen_layer.view_list, in shell_configure_fullscreen()
2351 loop = wl_display_get_event_loop(shsurf->shell->compositor->wl_display); in fade_out_done()
2376 void *shell) in desktop_surface_added() argument
2402 shsurf->shell = (struct desktop_shell *) shell; in desktop_surface_added()
2412 shsurf, get_default_output(shsurf->shell->compositor)); in desktop_surface_added()
2436 void *shell) in desktop_surface_removed() argument
2464 shsurf->shell->win_close_animation_type == ANIMATION_FADE) { in desktop_surface_removed()
2484 set_maximized_position(struct desktop_shell *shell, in set_maximized_position() argument
2490 get_output_work_area(shell, shsurf->output, &area); in set_maximized_position()
2521 map(struct desktop_shell *shell, struct shell_surface *shsurf, in map() argument
2526 struct weston_compositor *compositor = shell->compositor; in map()
2534 set_maximized_position(shell, shsurf); in map()
2538 weston_view_set_initial_position(shsurf->view, shell); in map()
2551 if (!shell->locked) { in map()
2553 activate(shell, shsurf->view, seat, in map()
2558 switch (shell->win_animation_type) { in map()
2581 struct desktop_shell *shell = data; in desktop_surface_committed() local
2597 map(shell, shsurf, sx, sy); in desktop_surface_committed()
2599 if (shsurf->shell->win_close_animation_type == ANIMATION_FADE) in desktop_surface_committed()
2633 set_maximized_position(shell, shsurf); in desktop_surface_committed()
2671 struct desktop_shell *shell; in get_maximized_size() local
2674 shell = shell_surface_get_shell(shsurf); in get_maximized_size()
2675 get_output_work_area(shell, shsurf->output, &area); in get_maximized_size()
2713 struct weston_seat *seat, uint32_t serial, void *shell) in desktop_surface_move() argument
2745 enum weston_desktop_surface_edge edges, void *shell) in desktop_surface_resize() argument
2772 void *shell) in desktop_surface_set_parent() argument
2793 struct weston_output *output, void *shell) in desktop_surface_fullscreen_requested() argument
2827 bool maximized, void *shell) in desktop_surface_maximized_requested() argument
2837 void *shell) in desktop_surface_minimized_requested() argument
2912 struct desktop_shell *shell = shell_; in desktop_surface_ping_timeout() local
2922 wl_list_for_each(seat, &shell->compositor->seat_list, link) { in desktop_surface_ping_timeout()
2944 struct desktop_shell *shell = shell_; in desktop_surface_pong() local
2950 end_busy_cursor(shell->compositor, desktop_client); in desktop_surface_pong()
3012 find_shell_output_from_weston_output(struct desktop_shell *shell, in find_shell_output_from_weston_output() argument
3017 wl_list_for_each(shell_output, &shell->output_list, link) { in find_shell_output_from_weston_output()
3035 struct desktop_shell *shell = es->committed_private; in background_committed() local
3040 configure_static_view(view, &shell->background_layer, 0, 0); in background_committed()
3060 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_set_background() local
3078 surface->committed_private = shell; in desktop_shell_set_background()
3083 sh_output = find_shell_output_from_weston_output(shell, surface->output); in desktop_shell_set_background()
3115 struct desktop_shell *shell = es->committed_private; in panel_committed() local
3122 get_panel_size(shell, view, &width, &height); in panel_committed()
3123 switch (shell->panel_position) { in panel_committed()
3136 configure_static_view(view, &shell->panel_layer, x, y); in panel_committed()
3157 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_set_panel() local
3175 surface->committed_private = shell; in desktop_shell_set_panel()
3180 sh_output = find_shell_output_from_weston_output(shell, surface->output); in desktop_shell_set_panel()
3209 struct desktop_shell *shell = surface->committed_private; in lock_surface_committed() local
3217 center_on_output(view, get_default_output(shell->compositor)); in lock_surface_committed()
3220 weston_layer_entry_insert(&shell->lock_layer.view_list, in lock_surface_committed()
3225 shell_fade(shell, FADE_IN); in lock_surface_committed()
3232 struct desktop_shell *shell = in handle_lock_surface_destroy() local
3236 shell->lock_surface = NULL; in handle_lock_surface_destroy()
3244 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_set_lock_surface() local
3248 shell->prepare_event_sent = false; in desktop_shell_set_lock_surface()
3250 if (!shell->locked) in desktop_shell_set_lock_surface()
3253 shell->lock_surface = surface; in desktop_shell_set_lock_surface()
3255 shell->lock_surface_listener.notify = handle_lock_surface_destroy; in desktop_shell_set_lock_surface()
3257 &shell->lock_surface_listener); in desktop_shell_set_lock_surface()
3261 surface->committed_private = shell; in desktop_shell_set_lock_surface()
3266 resume_desktop(struct desktop_shell *shell) in resume_desktop() argument
3268 struct workspace *ws = get_current_workspace(shell); in resume_desktop()
3270 weston_layer_unset_position(&shell->lock_layer); in resume_desktop()
3272 if (shell->showing_input_panels) in resume_desktop()
3273 weston_layer_set_position(&shell->input_panel_layer, in resume_desktop()
3275 weston_layer_set_position(&shell->fullscreen_layer, in resume_desktop()
3277 weston_layer_set_position(&shell->panel_layer, in resume_desktop()
3281 restore_focus_state(shell, get_current_workspace(shell)); in resume_desktop()
3283 shell->locked = false; in resume_desktop()
3284 shell_fade(shell, FADE_IN); in resume_desktop()
3285 weston_compositor_damage_all(shell->compositor); in resume_desktop()
3292 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_unlock() local
3294 shell->prepare_event_sent = false; in desktop_shell_unlock()
3296 if (shell->locked) in desktop_shell_unlock()
3297 resume_desktop(shell); in desktop_shell_unlock()
3305 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_set_grab_surface() local
3307 shell->grab_surface = wl_resource_get_user_data(surface_resource); in desktop_shell_set_grab_surface()
3308 weston_view_create(shell->grab_surface); in desktop_shell_set_grab_surface()
3315 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_desktop_ready() local
3317 shell_fade_startup(shell); in desktop_shell_desktop_ready()
3325 struct desktop_shell *shell = wl_resource_get_user_data(resource); in desktop_shell_set_panel_position() local
3337 shell->panel_position = position; in desktop_shell_set_panel_position()
3780 lower_fullscreen_layer(struct desktop_shell *shell, in lower_fullscreen_layer() argument
3786 ws = get_current_workspace(shell); in lower_fullscreen_layer()
3788 &shell->fullscreen_layer.view_list.link, in lower_fullscreen_layer()
3834 activate(struct desktop_shell *shell, struct weston_view *view, in activate() argument
3851 activate(shell, shsurf_child->view, seat, flags); in activate()
3858 lower_fullscreen_layer(shell, shsurf->output); in activate()
3862 state = ensure_focus_state(shell, seat); in activate()
3877 if (shell->focus_animation_type != ANIMATION_NONE) { in activate()
3878 ws = get_current_workspace(shell); in activate()
3879 animate_focus_change(shell, ws, get_default_view(old_es), get_default_view(es)); in activate()
3904 struct desktop_shell *shell, in activate_binding() argument
3921 activate(shell, focus_view, seat, flags); in activate_binding()
3954 unfocus_all_seats(struct desktop_shell *shell) in unfocus_all_seats() argument
3958 wl_list_for_each_safe(seat, next, &shell->compositor->seat_list, link) { in unfocus_all_seats()
3970 lock(struct desktop_shell *shell) in lock() argument
3972 struct workspace *ws = get_current_workspace(shell); in lock()
3974 if (shell->locked) { in lock()
3975 weston_compositor_sleep(shell->compositor); in lock()
3979 shell->locked = true; in lock()
3985 weston_layer_unset_position(&shell->panel_layer); in lock()
3986 weston_layer_unset_position(&shell->fullscreen_layer); in lock()
3987 if (shell->showing_input_panels) in lock()
3988 weston_layer_unset_position(&shell->input_panel_layer); in lock()
3991 weston_layer_set_position(&shell->lock_layer, in lock()
3994 weston_compositor_sleep(shell->compositor); in lock()
3999 unfocus_all_seats(shell); in lock()
4007 unlock(struct desktop_shell *shell) in unlock() argument
4011 if (!shell->locked || shell->lock_surface) { in unlock()
4012 shell_fade(shell, FADE_IN); in unlock()
4017 if (!shell->child.desktop_shell) { in unlock()
4018 resume_desktop(shell); in unlock()
4022 if (shell->prepare_event_sent) in unlock()
4025 shell_resource = shell->child.desktop_shell; in unlock()
4027 shell->prepare_event_sent = true; in unlock()
4034 struct desktop_shell *shell = shell_output->shell; in shell_fade_done_for_output() local
4043 lock(shell); in shell_fade_done_for_output()
4051 shell_fade_create_surface_for_output(struct desktop_shell *shell, struct shell_output *shell_output) in shell_fade_create_surface_for_output() argument
4053 struct weston_compositor *compositor = shell->compositor; in shell_fade_create_surface_for_output()
4080 shell_fade(struct desktop_shell *shell, enum fade_type type) in shell_fade() argument
4098 wl_list_for_each(shell_output, &shell->output_list, link) { in shell_fade()
4102 shell_output->fade.view = shell_fade_create_surface_for_output(shell, shell_output); in shell_fade()
4115 shell->locked = false; in shell_fade()
4132 struct desktop_shell *shell = data; in do_shell_fade_startup() local
4135 if (shell->startup_animation_type == ANIMATION_FADE) { in do_shell_fade_startup()
4136 shell_fade(shell, FADE_IN); in do_shell_fade_startup()
4140 shell->startup_animation_type); in do_shell_fade_startup()
4141 wl_list_for_each(shell_output, &shell->output_list, link) { in do_shell_fade_startup()
4149 shell_fade_startup(struct desktop_shell *shell) in shell_fade_startup() argument
4155 wl_list_for_each(shell_output, &shell->output_list, link) { in shell_fade_startup()
4165 loop = wl_display_get_event_loop(shell->compositor->wl_display); in shell_fade_startup()
4166 wl_event_loop_add_idle(loop, do_shell_fade_startup, shell); in shell_fade_startup()
4173 struct desktop_shell *shell = data; in fade_startup_timeout() local
4175 shell_fade_startup(shell); in fade_startup_timeout()
4180 shell_fade_init(struct desktop_shell *shell) in shell_fade_init() argument
4190 if (shell->startup_animation_type == ANIMATION_NONE) in shell_fade_init()
4193 wl_list_for_each(shell_output, &shell->output_list, link) { in shell_fade_init()
4200 shell_output->fade.view = shell_fade_create_surface_for_output(shell, shell_output); in shell_fade_init()
4207 loop = wl_display_get_event_loop(shell->compositor->wl_display); in shell_fade_init()
4209 wl_event_loop_add_timer(loop, fade_startup_timeout, shell); in shell_fade_init()
4217 struct desktop_shell *shell = in idle_handler() local
4222 wl_list_for_each(seat, &shell->compositor->seat_list, link) in idle_handler()
4225 shell_fade(shell, FADE_OUT); in idle_handler()
4232 struct desktop_shell *shell = in wake_handler() local
4235 unlock(shell); in wake_handler()
4249 api = shsurf->shell->xwayland_surface_api; in transform_handler()
4251 api = weston_xwayland_surface_get_api(shsurf->shell->compositor); in transform_handler()
4252 shsurf->shell->xwayland_surface_api = api; in transform_handler()
4288 struct desktop_shell *shell) in weston_view_set_initial_position() argument
4290 struct weston_compositor *compositor = shell->compositor; in weston_view_set_initial_position()
4330 get_output_work_area(shell, target_output, &area); in weston_view_set_initial_position()
4347 check_desktop_shell_crash_too_early(struct desktop_shell *shell) in check_desktop_shell_crash_too_early() argument
4360 if (now.tv_sec - shell->startup_time.tv_sec < 30) { in check_desktop_shell_crash_too_early()
4362 shell->client); in check_desktop_shell_crash_too_early()
4364 weston_compositor_exit_with_code(shell->compositor, in check_desktop_shell_crash_too_early()
4376 respawn_desktop_shell_process(struct desktop_shell *shell) in respawn_desktop_shell_process() argument
4382 if (timespec_sub_to_msec(&time, &shell->child.deathstamp) > 30000) { in respawn_desktop_shell_process()
4383 shell->child.deathstamp = time; in respawn_desktop_shell_process()
4384 shell->child.deathcount = 0; in respawn_desktop_shell_process()
4387 shell->child.deathcount++; in respawn_desktop_shell_process()
4388 if (shell->child.deathcount > 5) { in respawn_desktop_shell_process()
4389 weston_log("%s disconnected, giving up.\n", shell->client); in respawn_desktop_shell_process()
4393 weston_log("%s disconnected, respawning...\n", shell->client); in respawn_desktop_shell_process()
4394 launch_desktop_shell_process(shell); in respawn_desktop_shell_process()
4400 struct desktop_shell *shell; in desktop_shell_client_destroy() local
4402 shell = container_of(listener, struct desktop_shell, in desktop_shell_client_destroy()
4405 wl_list_remove(&shell->child.client_destroy_listener.link); in desktop_shell_client_destroy()
4406 shell->child.client = NULL; in desktop_shell_client_destroy()
4415 if (!check_desktop_shell_crash_too_early(shell)) in desktop_shell_client_destroy()
4416 respawn_desktop_shell_process(shell); in desktop_shell_client_destroy()
4418 shell_fade_startup(shell); in desktop_shell_client_destroy()
4424 struct desktop_shell *shell = data; in launch_desktop_shell_process() local
4426 shell->child.client = weston_client_start(shell->compositor, in launch_desktop_shell_process()
4427 shell->client); in launch_desktop_shell_process()
4429 if (!shell->child.client) { in launch_desktop_shell_process()
4430 weston_log("not able to start %s\n", shell->client); in launch_desktop_shell_process()
4434 shell->child.client_destroy_listener.notify = in launch_desktop_shell_process()
4436 wl_client_add_destroy_listener(shell->child.client, in launch_desktop_shell_process()
4437 &shell->child.client_destroy_listener); in launch_desktop_shell_process()
4443 struct desktop_shell *shell = wl_resource_get_user_data(resource); in unbind_desktop_shell() local
4445 if (shell->locked) in unbind_desktop_shell()
4446 resume_desktop(shell); in unbind_desktop_shell()
4448 shell->child.desktop_shell = NULL; in unbind_desktop_shell()
4449 shell->prepare_event_sent = false; in unbind_desktop_shell()
4456 struct desktop_shell *shell = data; in bind_desktop_shell() local
4462 if (client == shell->child.client) { in bind_desktop_shell()
4465 shell, unbind_desktop_shell); in bind_desktop_shell()
4466 shell->child.desktop_shell = resource; in bind_desktop_shell()
4475 struct desktop_shell *shell; member
4488 struct workspace *ws = get_current_workspace(switcher->shell); in switcher_next()
4493 …wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list.link, layer_link.link… in switcher_next()
4552 struct workspace *ws = get_current_workspace(switcher->shell); in switcher_destroy()
4563 activate(switcher->shell, switcher->current, in switcher_destroy()
4579 … weston_layer_entry_insert(&switcher->shell->minimized_layer.view_list, &(*minimized)->layer_link); in switcher_destroy()
4607 if ((seat->modifier_state & switcher->shell->binding_modifier) == 0) in switcher_modifier()
4629 struct desktop_shell *shell = data; in switcher_binding() local
4636 switcher->shell = shell; in switcher_binding()
4642 lower_fullscreen_layer(switcher->shell, NULL); in switcher_binding()
4688 struct desktop_shell *shell = data; in force_kill_binding() local
4689 struct weston_compositor *compositor = shell->compositor; in force_kill_binding()
4713 struct desktop_shell *shell = data; in workspace_up_binding() local
4714 unsigned int new_index = shell->workspaces.current; in workspace_up_binding()
4716 if (shell->locked) in workspace_up_binding()
4721 change_workspace(shell, new_index); in workspace_up_binding()
4728 struct desktop_shell *shell = data; in workspace_down_binding() local
4729 unsigned int new_index = shell->workspaces.current; in workspace_down_binding()
4731 if (shell->locked) in workspace_down_binding()
4733 if (new_index < shell->workspaces.num - 1) in workspace_down_binding()
4736 change_workspace(shell, new_index); in workspace_down_binding()
4743 struct desktop_shell *shell = data; in workspace_f_binding() local
4746 if (shell->locked) in workspace_f_binding()
4749 if (new_index >= shell->workspaces.num) in workspace_f_binding()
4750 new_index = shell->workspaces.num - 1; in workspace_f_binding()
4752 change_workspace(shell, new_index); in workspace_f_binding()
4760 struct desktop_shell *shell = data; in workspace_move_surface_up_binding() local
4761 unsigned int new_index = shell->workspaces.current; in workspace_move_surface_up_binding()
4763 if (shell->locked) in workspace_move_surface_up_binding()
4769 take_surface_to_workspace_by_seat(shell, keyboard->seat, new_index); in workspace_move_surface_up_binding()
4777 struct desktop_shell *shell = data; in workspace_move_surface_down_binding() local
4778 unsigned int new_index = shell->workspaces.current; in workspace_move_surface_down_binding()
4780 if (shell->locked) in workspace_move_surface_down_binding()
4783 if (new_index < shell->workspaces.num - 1) in workspace_move_surface_down_binding()
4786 take_surface_to_workspace_by_seat(shell, keyboard->seat, new_index); in workspace_move_surface_down_binding()
4839 shell_for_each_layer(struct desktop_shell *shell, in shell_for_each_layer() argument
4844 func(shell, &shell->fullscreen_layer, data); in shell_for_each_layer()
4845 func(shell, &shell->panel_layer, data); in shell_for_each_layer()
4846 func(shell, &shell->background_layer, data); in shell_for_each_layer()
4847 func(shell, &shell->lock_layer, data); in shell_for_each_layer()
4848 func(shell, &shell->input_panel_layer, data); in shell_for_each_layer()
4850 wl_array_for_each(ws, &shell->workspaces.array) in shell_for_each_layer()
4851 func(shell, &(*ws)->layer, data); in shell_for_each_layer()
4855 shell_output_changed_move_layer(struct desktop_shell *shell, in shell_output_changed_move_layer() argument
4871 struct desktop_shell *shell = output_listener->shell; in handle_output_destroy() local
4873 shell_for_each_layer(shell, shell_output_changed_move_layer, NULL); in handle_output_destroy()
4885 shell_resize_surface_to_output(struct desktop_shell *shell, in shell_resize_surface_to_output() argument
4892 weston_desktop_shell_send_configure(shell->child.desktop_shell, 0, in shell_resize_surface_to_output()
4902 struct desktop_shell *shell = in handle_output_resized() local
4905 struct shell_output *sh_output = find_shell_output_from_weston_output(shell, output); in handle_output_resized()
4907 shell_resize_surface_to_output(shell, sh_output->background_surface, output); in handle_output_resized()
4908 shell_resize_surface_to_output(shell, sh_output->panel_surface, output); in handle_output_resized()
4912 create_shell_output(struct desktop_shell *shell, in create_shell_output() argument
4922 shell_output->shell = shell; in create_shell_output()
4926 wl_list_insert(shell->output_list.prev, &shell_output->link); in create_shell_output()
4928 if (wl_list_length(&shell->output_list) == 1) in create_shell_output()
4929 shell_for_each_layer(shell, in create_shell_output()
4936 struct desktop_shell *shell = in handle_output_create() local
4940 create_shell_output(shell, output); in handle_output_create()
4944 handle_output_move_layer(struct desktop_shell *shell, in handle_output_move_layer() argument
4964 struct desktop_shell *shell; in handle_output_move() local
4966 shell = container_of(listener, struct desktop_shell, in handle_output_move()
4969 shell_for_each_layer(shell, handle_output_move_layer, data); in handle_output_move()
4974 struct desktop_shell *shell) in setup_output_destroy_handler() argument
4978 wl_list_init(&shell->output_list); in setup_output_destroy_handler()
4980 create_shell_output(shell, output); in setup_output_destroy_handler()
4982 shell->output_create_listener.notify = handle_output_create; in setup_output_destroy_handler()
4984 &shell->output_create_listener); in setup_output_destroy_handler()
4986 shell->output_move_listener.notify = handle_output_move; in setup_output_destroy_handler()
4987 wl_signal_add(&ec->output_moved_signal, &shell->output_move_listener); in setup_output_destroy_handler()
4993 struct desktop_shell *shell = in shell_destroy() local
4999 shell->locked = false; in shell_destroy()
5001 if (shell->child.client) { in shell_destroy()
5003 wl_list_remove(&shell->child.client_destroy_listener.link); in shell_destroy()
5004 wl_client_destroy(shell->child.client); in shell_destroy()
5007 wl_list_remove(&shell->destroy_listener.link); in shell_destroy()
5008 wl_list_remove(&shell->idle_listener.link); in shell_destroy()
5009 wl_list_remove(&shell->wake_listener.link); in shell_destroy()
5010 wl_list_remove(&shell->transform_listener.link); in shell_destroy()
5014 input_panel_destroy(shell); in shell_destroy()
5016 wl_list_for_each_safe(shell_output, tmp, &shell->output_list, link) { in shell_destroy()
5022 wl_list_remove(&shell->output_create_listener.link); in shell_destroy()
5023 wl_list_remove(&shell->output_move_listener.link); in shell_destroy()
5024 wl_list_remove(&shell->resized_listener.link); in shell_destroy()
5026 wl_array_for_each(ws, &shell->workspaces.array) in shell_destroy()
5028 wl_array_release(&shell->workspaces.array); in shell_destroy()
5030 free(shell->client); in shell_destroy()
5031 free(shell); in shell_destroy()
5035 shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell) in shell_add_bindings() argument
5040 if (shell->allow_zap) in shell_add_bindings()
5048 shell); in shell_add_bindings()
5051 shell); in shell_add_bindings()
5054 shell); in shell_add_bindings()
5061 if (shell->exposay_modifier) in shell_add_bindings()
5062 weston_compositor_add_modifier_binding(ec, shell->exposay_modifier, in shell_add_bindings()
5063 exposay_binding, shell); in shell_add_bindings()
5065 mod = shell->binding_modifier; in shell_add_bindings()
5088 shell); in shell_add_bindings()
5089 weston_compositor_add_touch_binding(ec, mod, touch_move_binding, shell); in shell_add_bindings()
5091 resize_binding, shell); in shell_add_bindings()
5094 resize_binding, shell); in shell_add_bindings()
5101 shell); in shell_add_bindings()
5107 force_kill_binding, shell); in shell_add_bindings()
5109 workspace_up_binding, shell); in shell_add_bindings()
5111 workspace_down_binding, shell); in shell_add_bindings()
5114 shell); in shell_add_bindings()
5117 shell); in shell_add_bindings()
5120 if (shell->workspaces.num > 1) { in shell_add_bindings()
5121 num_workspace_bindings = shell->workspaces.num; in shell_add_bindings()
5127 shell); in shell_add_bindings()
5146 struct desktop_shell *shell; in wet_shell_init() local
5151 shell = zalloc(sizeof *shell); in wet_shell_init()
5152 if (shell == NULL) in wet_shell_init()
5155 shell->compositor = ec; in wet_shell_init()
5158 &shell->destroy_listener, in wet_shell_init()
5160 free(shell); in wet_shell_init()
5164 shell->idle_listener.notify = idle_handler; in wet_shell_init()
5165 wl_signal_add(&ec->idle_signal, &shell->idle_listener); in wet_shell_init()
5166 shell->wake_listener.notify = wake_handler; in wet_shell_init()
5167 wl_signal_add(&ec->wake_signal, &shell->wake_listener); in wet_shell_init()
5168 shell->transform_listener.notify = transform_handler; in wet_shell_init()
5169 wl_signal_add(&ec->transform_signal, &shell->transform_listener); in wet_shell_init()
5171 weston_layer_init(&shell->fullscreen_layer, ec); in wet_shell_init()
5172 weston_layer_init(&shell->panel_layer, ec); in wet_shell_init()
5173 weston_layer_init(&shell->background_layer, ec); in wet_shell_init()
5174 weston_layer_init(&shell->lock_layer, ec); in wet_shell_init()
5175 weston_layer_init(&shell->input_panel_layer, ec); in wet_shell_init()
5177 weston_layer_set_position(&shell->fullscreen_layer, in wet_shell_init()
5179 weston_layer_set_position(&shell->panel_layer, in wet_shell_init()
5181 weston_layer_set_position(&shell->background_layer, in wet_shell_init()
5184 wl_array_init(&shell->workspaces.array); in wet_shell_init()
5185 wl_list_init(&shell->workspaces.client_list); in wet_shell_init()
5187 if (input_panel_setup(shell) < 0) in wet_shell_init()
5195 shell_configuration(shell); in wet_shell_init()
5197 shell->exposay.state_cur = EXPOSAY_LAYOUT_INACTIVE; in wet_shell_init()
5198 shell->exposay.state_target = EXPOSAY_TARGET_CANCEL; in wet_shell_init()
5200 for (i = 0; i < shell->workspaces.num; i++) { in wet_shell_init()
5201 pws = wl_array_add(&shell->workspaces.array, sizeof *pws); in wet_shell_init()
5205 *pws = workspace_create(shell); in wet_shell_init()
5209 activate_workspace(shell, 0); in wet_shell_init()
5211 weston_layer_init(&shell->minimized_layer, ec); in wet_shell_init()
5213 wl_list_init(&shell->workspaces.anim_sticky_list); in wet_shell_init()
5214 wl_list_init(&shell->workspaces.animation.link); in wet_shell_init()
5215 shell->workspaces.animation.frame = animate_workspace_change_frame; in wet_shell_init()
5217 shell->desktop = weston_desktop_create(ec, &shell_desktop_api, shell); in wet_shell_init()
5218 if (!shell->desktop) in wet_shell_init()
5223 shell, bind_desktop_shell) == NULL) in wet_shell_init()
5226 weston_compositor_get_time(&shell->child.deathstamp); in wet_shell_init()
5228 shell->panel_position = WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP; in wet_shell_init()
5230 setup_output_destroy_handler(ec, shell); in wet_shell_init()
5238 shell->seat_create_listener.notify = handle_seat_created; in wet_shell_init()
5239 wl_signal_add(&ec->seat_created_signal, &shell->seat_create_listener); in wet_shell_init()
5241 shell->resized_listener.notify = handle_output_resized; in wet_shell_init()
5242 wl_signal_add(&ec->output_resized_signal, &shell->resized_listener); in wet_shell_init()
5246 shell_add_bindings(ec, shell); in wet_shell_init()
5248 shell_fade_init(shell); in wet_shell_init()
5250 clock_gettime(CLOCK_MONOTONIC, &shell->startup_time); in wet_shell_init()