Skip to content

Commit ace6eed

Browse files
authored
DesktopIntegration: respect reduce motion setting (#2639)
Fixes #2638
1 parent c3210ff commit ace6eed

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/DesktopIntegration.vala

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,22 @@ public class Gala.DesktopIntegration : GLib.Object {
195195
return;
196196
}
197197

198-
notifying = true;
199-
200-
wm.get_display ().get_sound_player ().play_from_theme ("bell", _("Window has already focus"), null);
198+
unowned var display = wm.get_display ();
201199

202200
#if HAS_MUTTER49
203-
if (window.is_maximized ()) {
201+
if (window.is_maximized () || !Meta.Prefs.get_gnome_animations ()) {
204202
#else
205-
if (window.get_maximized () == BOTH) {
203+
if (window.get_maximized () == BOTH || !Meta.Prefs.get_gnome_animations ()) {
206204
#endif
207-
notifying = false;
205+
// If user has "Flash screen" enabled, make sure to respect it when shake animation is not played
206+
InternalUtils.bell_notify (display);
208207
return;
209208
}
210209

210+
display.get_sound_player ().play_from_theme ("bell", _("Window has already focus"), null);
211+
212+
notifying = true;
213+
211214
var transition = new Clutter.KeyframeTransition ("translation-x") {
212215
repeat_count = 5,
213216
duration = 100,
@@ -217,7 +220,7 @@ public class Gala.DesktopIntegration : GLib.Object {
217220
transition.set_to_value (0);
218221
transition.set_key_frames ( { 0.5, -0.5 } );
219222

220-
var offset = Utils.scale_to_int (15, wm.get_display ().get_monitor_scale (window.get_monitor ()));
223+
var offset = Utils.scale_to_int (15, display.get_monitor_scale (window.get_monitor ()));
221224
transition.set_values ( { -offset, offset });
222225

223226
transition.stopped.connect (() => {
@@ -230,9 +233,9 @@ public class Gala.DesktopIntegration : GLib.Object {
230233
});
231234

232235
#if HAS_MUTTER48
233-
wm.get_display ().get_compositor ().disable_unredirect ();
236+
display.get_compositor ().disable_unredirect ();
234237
#else
235-
wm.get_display ().disable_unredirect ();
238+
display.disable_unredirect ();
236239
#endif
237240

238241
((Meta.WindowActor) window.get_compositor_private ()).add_transition ("notify-already-focused", transition);

0 commit comments

Comments
 (0)