From 0f640e219cbf5cc0ca8ff5b3fb51437ace6f5cb0 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 25 Nov 2013 18:01:31 +0000 Subject: [PATCH] shell: Add missing cases to switch statements for surface types This fixes a load of GCC warnings when compiling with -Wswitch-enum -Wswitch-default, and makes it clearer that those cases have been thought about explicitly when writing the code, rather than just being forgotten. --- src/shell.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/shell.c b/src/shell.c index f1d0686c..7d71e940 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2259,6 +2259,7 @@ reset_surface_type(struct shell_surface *surface) case SHELL_SURFACE_TRANSIENT: case SHELL_SURFACE_POPUP: case SHELL_SURFACE_XWAYLAND: + default: break; } @@ -2306,6 +2307,8 @@ set_surface_type(struct shell_surface *shsurf) shsurf->transient.y); break; + case SHELL_SURFACE_POPUP: + case SHELL_SURFACE_NONE: default: break; } @@ -3833,6 +3836,12 @@ activate(struct desktop_shell *shell, struct weston_surface *es, shell_stack_fullscreen(get_shell_surface(main_surface)); shell_configure_fullscreen(get_shell_surface(main_surface)); return; + case SHELL_SURFACE_TOPLEVEL: + case SHELL_SURFACE_TRANSIENT: + case SHELL_SURFACE_MAXIMIZED: + case SHELL_SURFACE_POPUP: + case SHELL_SURFACE_XWAYLAND: + case SHELL_SURFACE_NONE: default: restore_all_output_modes(shell->compositor); ws = get_current_workspace(shell); @@ -4301,6 +4310,8 @@ map(struct desktop_shell *shell, struct shell_surface *shsurf, shsurf->view->geometry.x + sx, shsurf->view->geometry.y + sy); break; + case SHELL_SURFACE_TRANSIENT: + case SHELL_SURFACE_XWAYLAND: default: ; } @@ -4321,6 +4332,8 @@ map(struct desktop_shell *shell, struct shell_surface *shsurf, case SHELL_SURFACE_NONE: break; case SHELL_SURFACE_XWAYLAND: + case SHELL_SURFACE_TOPLEVEL: + case SHELL_SURFACE_MAXIMIZED: default: ws = get_current_workspace(shell); wl_list_remove(&shsurf->view->layer_link); @@ -4351,6 +4364,8 @@ map(struct desktop_shell *shell, struct shell_surface *shsurf, activate(shell, shsurf->surface, seat); } break; + case SHELL_SURFACE_POPUP: + case SHELL_SURFACE_NONE: default: break; } @@ -4404,7 +4419,10 @@ configure(struct desktop_shell *shell, struct weston_surface *surface, get_output_panel_height(shell,shsurf->output) - surf_y; break; case SHELL_SURFACE_TOPLEVEL: - break; + case SHELL_SURFACE_TRANSIENT: + case SHELL_SURFACE_POPUP: + case SHELL_SURFACE_XWAYLAND: + case SHELL_SURFACE_NONE: default: break; } @@ -4884,6 +4902,10 @@ switcher_next(struct switcher *switcher) weston_view_geometry_dirty(view); weston_surface_damage(view->surface); break; + case SHELL_SURFACE_TRANSIENT: + case SHELL_SURFACE_POPUP: + case SHELL_SURFACE_XWAYLAND: + case SHELL_SURFACE_NONE: default: break; }