Skip to content

Commit c6071ae

Browse files
authored
Merge branch 'main' into lenemter/bg-blur-2
2 parents bc56b2a + e57b083 commit c6071ae

22 files changed

+304
-328
lines changed

data/gala.gschema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
<key type="b" name="enable-animations">
206206
<default>true</default>
207207
<summary>Enable Animations</summary>
208-
<description>Whether animations should be displayed. Note: This is a global key, it changes the behaviour of the window manager, the panel etc.</description>
208+
<description>DEPRECATED: This key is deprecated and ignored.</description>
209209
</key>
210210
</schema>
211211

lib/AnimationsSettings.vala

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/Utils.vala

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,14 @@ namespace Gala {
325325
return null;
326326
}
327327

328-
var container = new Clutter.Actor ();
329-
container.set_size (inner_rect.width, inner_rect.height);
330-
container.content = content;
328+
var container = new Clutter.Actor () {
329+
content = content,
330+
offscreen_redirect = Clutter.OffscreenRedirect.ALWAYS,
331+
x = inner_rect.x,
332+
y = inner_rect.y,
333+
width = inner_rect.width,
334+
height = inner_rect.height
335+
};
331336

332337
return container;
333338
}
@@ -451,5 +456,12 @@ namespace Gala {
451456
regions.remove (window);
452457
X.Fixes.destroy_region (xdisplay, region);
453458
}
459+
460+
/**
461+
* Utility that returns the given duration or 0 if animations are disabled.
462+
*/
463+
public static uint get_animation_duration (uint duration) {
464+
return Meta.Prefs.get_gnome_animations () ? duration : 0;
465+
}
454466
}
455467
}

lib/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
gala_lib_sources = files(
22
'ActivatableComponent.vala',
3-
'AnimationsSettings.vala',
43
'App.vala',
54
'AppCache.vala',
65
'AppSystem.vala',

plugins/pip/PopupWindow.vala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
137137
opacity = 0;
138138

139139
save_easing_state ();
140-
set_easing_duration (AnimationsSettings.get_animation_duration (200));
140+
set_easing_duration (Utils.get_animation_duration (200));
141141
opacity = 255;
142142
restore_easing_state ();
143143
}
144144

145145
public override void hide () {
146146
opacity = 255;
147147

148-
var duration = AnimationsSettings.get_animation_duration (200);
148+
var duration = Utils.get_animation_duration (200);
149149
save_easing_state ();
150150
set_easing_duration (duration);
151151
opacity = 0;
@@ -167,7 +167,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
167167
#else
168168
public override bool enter_event (Clutter.CrossingEvent event) {
169169
#endif
170-
var duration = AnimationsSettings.get_animation_duration (300);
170+
var duration = Utils.get_animation_duration (300);
171171

172172
close_button.save_easing_state ();
173173
close_button.set_easing_duration (duration);
@@ -187,7 +187,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
187187
#else
188188
public override bool leave_event (Clutter.CrossingEvent event) {
189189
#endif
190-
var duration = AnimationsSettings.get_animation_duration (300);
190+
var duration = Utils.get_animation_duration (300);
191191

192192
close_button.save_easing_state ();
193193
close_button.set_easing_duration (duration);
@@ -309,7 +309,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
309309
}
310310

311311
private void on_close_click_clicked () {
312-
var duration = AnimationsSettings.get_animation_duration (FADE_OUT_TIMEOUT);
312+
var duration = Utils.get_animation_duration (FADE_OUT_TIMEOUT);
313313

314314
save_easing_state ();
315315
set_easing_duration (duration);
@@ -433,7 +433,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
433433
var screen_limit_start_y = workarea_rect.y + SCREEN_MARGIN;
434434
var screen_limit_end_y = workarea_rect.y + workarea_rect.height - SCREEN_MARGIN - height;
435435

436-
var duration = AnimationsSettings.get_animation_duration (300);
436+
var duration = Utils.get_animation_duration (300);
437437

438438
save_easing_state ();
439439
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
@@ -446,7 +446,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
446446
private bool place_window_off_screen () {
447447
off_screen = false;
448448

449-
var duration = AnimationsSettings.get_animation_duration (300);
449+
var duration = Utils.get_animation_duration (300);
450450

451451
save_easing_state ();
452452
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);

po/en_GB.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-03-02 14:11+0000\n"
11-
"PO-Revision-Date: 2025-02-16 03:16+0000\n"
11+
"PO-Revision-Date: 2025-03-08 12:45+0000\n"
1212
"Last-Translator: David Hewitt <[email protected]>\n"
1313
"Language-Team: English (United Kingdom) <https://l10n.elementary.io/projects/"
1414
"desktop/gala/en_GB/>\n"
@@ -17,7 +17,7 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.9.2\n"
20+
"X-Generator: Weblate 5.10.2\n"
2121
"X-Launchpad-Export-Date: 2017-03-14 07:02+0000\n"
2222

2323
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -293,7 +293,7 @@ msgstr "Screenshot from %s"
293293
#. / TRANSLATORS: 'Files' is the name of file manager used by elementary OS
294294
#: src/WindowManager.vala:2373
295295
msgid "Show in Files"
296-
msgstr ""
296+
msgstr "Show in Files"
297297

298298
#: src/WindowManager.vala:2380
299299
msgid "Screenshot is saved to clipboard"

po/pl.po

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ msgstr ""
88
"Project-Id-Version: gala\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2025-03-02 14:11+0000\n"
11-
"PO-Revision-Date: 2024-12-21 09:16+0000\n"
11+
"PO-Revision-Date: 2025-03-08 12:45+0000\n"
1212
"Last-Translator: Marcin Serwin <[email protected]>\n"
13-
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/"
14-
">\n"
13+
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/>"
14+
"\n"
1515
"Language: pl\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
2020
"|| n%100>=20) ? 1 : 2;\n"
21-
"X-Generator: Weblate 5.8.4\n"
21+
"X-Generator: Weblate 5.10.2\n"
2222
"X-Launchpad-Export-Date: 2017-04-20 06:29+0000\n"
2323

2424
#: daemon/DBus.vala:82 daemon-gtk3/BackgroundMenu.vala:11
@@ -301,15 +301,15 @@ msgstr "Zrzut ekranu z %s"
301301
#. / TRANSLATORS: 'Files' is the name of file manager used by elementary OS
302302
#: src/WindowManager.vala:2373
303303
msgid "Show in Files"
304-
msgstr ""
304+
msgstr "Pokaż w Plikach"
305305

306306
#: src/WindowManager.vala:2380
307307
msgid "Screenshot is saved to clipboard"
308-
msgstr ""
308+
msgstr "Zrzut ekranu zapisany do schowka"
309309

310310
#: src/WindowManager.vala:2380
311311
msgid "Screenshot saved to screenshots folder"
312-
msgstr ""
312+
msgstr "Zrzut ekranu zapisany do folderu ze zrzutami ekranu"
313313

314314
#~ msgid ""
315315
#~ "Set the keyboard layout correctly at startup so that the indicator "

src/Background/BackgroundManager.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
6161
return;
6262
}
6363

64-
if (animate && AnimationsSettings.get_enable_animations ()) {
64+
if (animate && Meta.Prefs.get_gnome_animations ()) {
6565
var transition = new Clutter.PropertyTransition ("opacity");
6666
transition.set_from_value (255);
6767
transition.set_to_value (0);

src/Gestures/Gesture.vala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace Gala {
4141
SWITCH_WINDOWS,
4242
MULTITASKING_VIEW,
4343
DOCK,
44+
ZOOM,
4445
N_ACTIONS
4546
}
4647

src/Gestures/GestureController.vala

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public class Gala.GestureController : Object {
4747
public double overshoot_lower_clamp { get; construct set; default = 0d; }
4848
public double overshoot_upper_clamp { get; construct set; default = 1d; }
4949

50+
/**
51+
* When disabled gesture progress will stay where the gesture ended and not snap to full integers values.
52+
* This will also cause the controller to emit smooth progress information even if animations are disabled.
53+
*/
54+
public bool snap { get; construct set; default = true; }
55+
5056
private double _progress = 0;
5157
public double progress {
5258
get { return _progress; }
@@ -129,13 +135,13 @@ public class Gala.GestureController : Object {
129135
|| backend == scroll_backend && GestureSettings.get_action (gesture) == NONE);
130136

131137
if (recognizing) {
132-
if (gesture.direction == UP || gesture.direction == RIGHT) {
138+
if (gesture.direction == UP || gesture.direction == RIGHT || gesture.direction == OUT) {
133139
direction_multiplier = 1;
134140
} else {
135141
direction_multiplier = -1;
136142
}
137143

138-
if (!AnimationsSettings.get_enable_animations ()) {
144+
if (snap && !Meta.Prefs.get_gnome_animations ()) {
139145
prepare ();
140146
finish (0, progress + direction_multiplier);
141147
recognizing = false;
@@ -188,17 +194,21 @@ public class Gala.GestureController : Object {
188194
return;
189195
}
190196

197+
recognizing = false;
198+
191199
progress += calculate_applied_delta (percentage, previous_delta);
192200

193201
var to = progress;
194202

195-
if (velocity.abs () > SUCCESS_VELOCITY_THRESHOLD) {
196-
to += (velocity > 0 ? direction_multiplier : -direction_multiplier) * 0.5;
197-
}
203+
if (snap) {
204+
if (velocity.abs () > SUCCESS_VELOCITY_THRESHOLD) {
205+
to += (velocity > 0 ? direction_multiplier : -direction_multiplier) * 0.5;
206+
}
198207

199-
recognizing = false;
208+
to = Math.round (to);
209+
}
200210

201-
finish (velocity, Math.round (to));
211+
finish (velocity, to);
202212

203213
previous_percentage = 0;
204214
previous_time = 0;
@@ -221,7 +231,7 @@ public class Gala.GestureController : Object {
221231
return;
222232
}
223233

224-
if (!AnimationsSettings.get_enable_animations ()) {
234+
if (!Meta.Prefs.get_gnome_animations ()) {
225235
progress = clamped_to;
226236
target.propagate (END, action, calculate_bounded_progress ());
227237
return;

0 commit comments

Comments
 (0)