Skip to content

Commit 72d7c75

Browse files
authored
Merge branch 'main' into leolost/window-positioner
2 parents 7765ecc + b0a5f8a commit 72d7c75

22 files changed

+125
-114
lines changed

data/gala.metainfo.xml.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
<update_contact>contact_at_elementary.io</update_contact>
2828

2929
<releases>
30-
<release version="8.0.2" date="2024-10-15" urgency="medium">
30+
<release version="8.0.2" date="2024-10-24" urgency="medium">
3131
<description>
3232
<p>Improvements:</p>
3333
<ul>
3434
<li>Updated translations</li>
3535
</ul>
3636
</description>
3737
<issues>
38+
<issue url="https://github.com/elementary/gala/issues/1737">Cursor only visible in window screenshots </issue>
3839
<issue url="https://github.com/elementary/gala/issues/1898">wayland: opening windows when overview is opened breaks a lot</issue>
3940
<issue url="https://github.com/elementary/gala/issues/2053">Window renders black</issue>
4041
<issue url="https://github.com/elementary/gala/issues/2067">Terminal and System Settings have generic icon in multitasking view on Wayland</issue>

lib/AnimationsSettings.vala

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* SPDX-License-Identifier: GPL-3.0-or-later
3+
* SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io)
4+
*/
5+
6+
namespace AnimationsSettings {
7+
private GLib.Settings? animations_settings;
8+
private bool enable_animations = true;
9+
10+
/**
11+
* Whether animations should be displayed.
12+
*/
13+
public bool get_enable_animations () {
14+
if (animations_settings == null) {
15+
animations_settings = new GLib.Settings ("io.elementary.desktop.wm.animations");
16+
animations_settings.changed["enable-animations"].connect (() => {
17+
enable_animations = animations_settings.get_boolean ("enable-animations");
18+
});
19+
20+
enable_animations = animations_settings.get_boolean ("enable-animations");
21+
}
22+
23+
return enable_animations;
24+
}
25+
}

lib/DragDropAction.vala

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

230230
// release has happened within bounds of actor
231231
if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) {
232-
actor_clicked (event.get_button ());
232+
actor_clicked (event.get_type () == BUTTON_RELEASE ? event.get_button () : Clutter.Button.PRIMARY);
233233
}
234234

235235
if (clicked) {

lib/WindowManager.vala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ namespace Gala {
123123
*/
124124
public abstract Gala.ActivatableComponent workspace_view { get; protected set; }
125125

126-
/**
127-
* Whether animations should be displayed.
128-
*/
129-
public abstract bool enable_animations { get; protected set; }
130-
131126
/**
132127
* Enters the modal mode, which means that all events are directed to the stage instead
133128
* of the windows. This is the only way to receive keyboard events besides shortcut listeners.

lib/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
gala_lib_sources = files(
22
'ActivatableComponent.vala',
3+
'AnimationsSettings.vala',
34
'App.vala',
45
'AppCache.vala',
56
'AppSystem.vala',

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('gala',
22
'c', 'vala',
3-
version: '8.0.1',
3+
version: '8.0.2',
44
meson_version: '>= 0.59.0',
55
license: 'GPL3',
66
)

plugins/pip/PopupWindow.vala

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

145145
save_easing_state ();
146-
set_easing_duration (wm.enable_animations ? 200 : 0);
146+
set_easing_duration (AnimationsSettings.get_enable_animations () ? 200 : 0);
147147
opacity = 255;
148148
restore_easing_state ();
149149
}
150150

151151
public override void hide () {
152152
opacity = 255;
153153

154-
var duration = wm.enable_animations ? 200 : 0;
154+
var duration = AnimationsSettings.get_enable_animations () ? 200 : 0;
155155
save_easing_state ();
156156
set_easing_duration (duration);
157157
opacity = 0;
@@ -173,7 +173,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
173173
#else
174174
public override bool enter_event (Clutter.CrossingEvent event) {
175175
#endif
176-
var duration = wm.enable_animations ? 300 : 0;
176+
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
177177

178178
close_button.save_easing_state ();
179179
close_button.set_easing_duration (duration);
@@ -193,7 +193,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
193193
#else
194194
public override bool leave_event (Clutter.CrossingEvent event) {
195195
#endif
196-
var duration = wm.enable_animations ? 300 : 0;
196+
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
197197

198198
close_button.save_easing_state ();
199199
close_button.set_easing_duration (duration);
@@ -315,7 +315,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
315315
}
316316

317317
private void on_close_click_clicked () {
318-
var duration = wm.enable_animations ? FADE_OUT_TIMEOUT : 0;
318+
var duration = AnimationsSettings.get_enable_animations () ? FADE_OUT_TIMEOUT : 0;
319319

320320
save_easing_state ();
321321
set_easing_duration (duration);
@@ -449,7 +449,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
449449
var screen_limit_start_y = SCREEN_MARGIN + monitor_y;
450450
var screen_limit_end_y = monitor_height + monitor_y - SCREEN_MARGIN - height;
451451

452-
var duration = wm.enable_animations ? 300 : 0;
452+
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
453453

454454
save_easing_state ();
455455
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
@@ -462,7 +462,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
462462
private bool place_window_off_screen () {
463463
off_screen = false;
464464

465-
var duration = wm.enable_animations ? 300 : 0;
465+
var duration = AnimationsSettings.get_enable_animations () ? 300 : 0;
466466

467467
save_easing_state ();
468468
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);

po/pt_BR.po

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ msgstr ""
88
"Project-Id-Version: beat-box\n"
99
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
1010
"POT-Creation-Date: 2024-10-15 19:33+0000\n"
11-
"PO-Revision-Date: 2024-09-02 00:57+0000\n"
12-
"Last-Translator: José Rafael <jrafaeldesantana@gmail.com>\n"
11+
"PO-Revision-Date: 2024-10-26 22:46+0000\n"
12+
"Last-Translator: Diogo Pessoa <diogopessoabr@gmail.com>\n"
1313
"Language-Team: Portuguese (Brazil) <https://l10n.elementary.io/projects/"
1414
"desktop/gala/pt_BR/>\n"
1515
"Language: pt_BR\n"
@@ -121,16 +121,12 @@ msgid "Updated translations"
121121
msgstr "Traduções atualizadas"
122122

123123
#: data/gala.metainfo.xml.in:49
124-
#, fuzzy
125-
#| msgid "Fix potential crash when taking screenshots"
126124
msgid "Fix a potential crash when moving windows between workspaces"
127-
msgstr "Corrigir possíveis falhas ao capturar telas"
125+
msgstr "Corrige uma potencial falha ao mover janelas entre espaços de trabalho"
128126

129127
#: data/gala.metainfo.xml.in:50
130-
#, fuzzy
131-
#| msgid "Fix notification position after changing DPI"
132128
msgid "Fix notification animation when entering multitasking view"
133-
msgstr "Corrigir a posição das notificações depois de modificar o DPI"
129+
msgstr "Corrige animação de notificação ao entrar na visão multitarefa"
134130

135131
#: data/gala.metainfo.xml.in:65
136132
msgid "Improve keyboard navigation in Multitasking View"

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 && wm.enable_animations) {
64+
if (animate && AnimationsSettings.get_enable_animations ()) {
6565
var transition = new Clutter.PropertyTransition ("opacity");
6666
transition.set_from_value (255);
6767
transition.set_to_value (0);

src/NotificationStack.vala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class Gala.NotificationStack : Object {
4848
update_stack_allocation ();
4949
}
5050

51-
public void show_notification (Meta.WindowActor notification, bool animate)
51+
public void show_notification (Meta.WindowActor notification)
5252
requires (notification != null && !notification.is_destroyed () && !notifications.contains (notification)) {
5353

5454
notification.set_pivot_point (0.5f, 0.5f);
@@ -62,7 +62,7 @@ public class Gala.NotificationStack : Object {
6262
var window_rect = window.get_frame_rect ();
6363
window.stick ();
6464

65-
if (animate) {
65+
if (AnimationsSettings.get_enable_animations ()) {
6666
// Don't flicker at the beginning of the animation
6767
notification.opacity = 0;
6868
notification.rotation_angle_x = 90;
@@ -96,7 +96,7 @@ public class Gala.NotificationStack : Object {
9696
* by shifting all current notifications by height
9797
* and then add it to the notifications list.
9898
*/
99-
update_positions (animate, scale, window_rect.height);
99+
update_positions (scale, window_rect.height);
100100

101101
int notification_x_pos = area.x + area.width - window_rect.width;
102102
if (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL) {
@@ -117,7 +117,7 @@ public class Gala.NotificationStack : Object {
117117
stack_y = area.y;
118118
}
119119

120-
private void update_positions (bool animate, float scale, float add_y = 0.0f) {
120+
private void update_positions (float scale, float add_y = 0.0f) {
121121
var y = stack_y + TOP_OFFSET + add_y + InternalUtils.scale_to_int (ADDITIONAL_MARGIN, scale);
122122
var i = notifications.size;
123123
var delay_step = i > 0 ? 150 / i : 0;
@@ -131,7 +131,7 @@ public class Gala.NotificationStack : Object {
131131
continue;
132132
}
133133

134-
if (animate) {
134+
if (AnimationsSettings.get_enable_animations ()) {
135135
actor.save_easing_state ();
136136
actor.set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
137137
actor.set_easing_duration (200);
@@ -140,7 +140,7 @@ public class Gala.NotificationStack : Object {
140140

141141
move_window (actor, -1, (int)y);
142142

143-
if (animate) {
143+
if (AnimationsSettings.get_enable_animations ()) {
144144
actor.restore_easing_state ();
145145
}
146146

@@ -160,8 +160,8 @@ public class Gala.NotificationStack : Object {
160160
}
161161
}
162162

163-
public void destroy_notification (Meta.WindowActor notification, bool animate) {
164-
if (animate) {
163+
public void destroy_notification (Meta.WindowActor notification) {
164+
if (AnimationsSettings.get_enable_animations ()) {
165165
notification.save_easing_state ();
166166
notification.set_easing_duration (100);
167167
notification.set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
@@ -178,7 +178,7 @@ public class Gala.NotificationStack : Object {
178178
var scale = display.get_monitor_scale (primary);
179179

180180
notifications.remove (notification);
181-
update_positions (animate, scale);
181+
update_positions (scale);
182182
}
183183

184184
/**

0 commit comments

Comments
 (0)