Skip to content

Commit 9f719af

Browse files
committed
Replace Clutter.Seat.bell_notify with Meta.SoundPlayer
1 parent 56d8caf commit 9f719af

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

src/InternalUtils.vala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,5 +380,13 @@ namespace Gala {
380380
new_parent.add_child (actor);
381381
actor.unref ();
382382
}
383+
384+
public static void bell_notify (Meta.Display display) {
385+
#if HAS_MUTTER47
386+
display.get_stage ().context.get_backend ().get_default_seat ().bell_notify ();
387+
#else
388+
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
389+
#endif
390+
}
383391
}
384392
}

src/Widgets/WindowCloneContainer.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ namespace Gala {
340340

341341
if (closest == null) {
342342
if (current_window != null) {
343-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
343+
InternalUtils.bell_notify (display);
344344
current_window.active = true;
345345
}
346346
return;

src/Widgets/WindowSwitcher/WindowSwitcher.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public class Gala.WindowSwitcher : CanvasActor {
377377

378378
private void open_switcher () {
379379
if (container.get_n_children () == 0) {
380-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
380+
InternalUtils.bell_notify (wm.get_display ());
381381
return;
382382
}
383383

@@ -473,7 +473,7 @@ public class Gala.WindowSwitcher : CanvasActor {
473473
Clutter.Actor actor;
474474

475475
if (container.get_n_children () == 1 && current_icon != null) {
476-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
476+
InternalUtils.bell_notify (wm.get_display ());
477477
return;
478478
}
479479

src/WindowManager.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ namespace Gala {
477477
if (active_workspace_index != index) {
478478
manager.get_workspace_by_index (index).activate (event.get_time ());
479479
} else {
480-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
480+
InternalUtils.bell_notify (display);
481481
}
482482
}
483483

@@ -787,13 +787,13 @@ namespace Gala {
787787

788788
// don't allow empty workspaces to be created by moving, if we have dynamic workspaces
789789
if (Meta.Prefs.get_dynamic_workspaces () && Utils.get_n_windows (active) == 1 && workspace.index () == manager.n_workspaces - 1) {
790-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
790+
InternalUtils.bell_notify (display);
791791
return;
792792
}
793793

794794
// don't allow moving into non-existing workspaces
795795
if (active == workspace) {
796-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
796+
InternalUtils.bell_notify (display);
797797
return;
798798
}
799799

src/Zoom.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public class Gala.Zoom : Object {
141141
// Nothing to do if zooming out of our bounds is requested
142142
if ((current_zoom <= MIN_ZOOM && delta < 0) || (current_zoom >= MAX_ZOOM && delta >= 0)) {
143143
if (play_sound) {
144-
Clutter.get_default_backend ().get_default_seat ().bell_notify ();
144+
InternalUtils.bell_notify (wm.get_display ());
145145
}
146146
return;
147147
}

0 commit comments

Comments
 (0)