From 9a11f30a7e712c7002aa4fd4cf219166fb4cde9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Sun, 20 Sep 2015 20:03:43 +0300 Subject: workspace: fix build with --disable-canberra --- src/core/workspace.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/core/workspace.c b/src/core/workspace.c index c97b6e1d..88619ea2 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -313,7 +313,6 @@ static void workspace_switch_sound(MetaWorkspace *from, MetaWorkspaceLayout layout; int i, nw, x, y, fi, ti; - const char *e; nw = meta_screen_get_n_workspaces(from->screen); fi = meta_workspace_index(from); @@ -343,25 +342,30 @@ static void workspace_switch_sound(MetaWorkspace *from, spatial "Woosh!" effects will easily be able to encode horizontal movement but not such much vertical movement. */ - if (x < layout.current_col) - e = "desktop-switch-left"; - else if (x > layout.current_col) - e = "desktop-switch-right"; - else if (y < layout.current_row) - e = "desktop-switch-up"; - else if (y > layout.current_row) - e = "desktop-switch-down"; - else { + if (x == layout.current_col && y == layout.current_row) { meta_bug("Uh, origin and destination workspace at same logic position!\n"); goto finish; } #ifdef HAVE_CANBERRA - ca_context_play(ca_gtk_context_get(), 1, + { + const char *e; + + if (x < layout.current_col) + e = "desktop-switch-left"; + else if (x > layout.current_col) + e = "desktop-switch-right"; + else if (y < layout.current_row) + e = "desktop-switch-up"; + else if (y > layout.current_row) + e = "desktop-switch-down"; + + ca_context_play(ca_gtk_context_get(), 1, CA_PROP_EVENT_ID, e, CA_PROP_EVENT_DESCRIPTION, "Desktop switched", CA_PROP_CANBERRA_CACHE_CONTROL, "permanent", NULL); + } #endif finish: -- cgit v1.2.1