summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-09-20 20:03:43 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-09-20 20:03:43 +0300
commit9a11f30a7e712c7002aa4fd4cf219166fb4cde9e (patch)
treed878c35ce592508f2685af8b84476d5403acf2a8
parent4ff4e9891f873f6c41181191a8732ec52c82f864 (diff)
downloadmetacity-9a11f30a7e712c7002aa4fd4cf219166fb4cde9e.tar.gz
workspace: fix build with --disable-canberra
-rw-r--r--src/core/workspace.c26
1 files 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: