Skip to content

Commit b8d4e41

Browse files
authored
Merge branch 'main' into tintou/mutter-47
2 parents 0b3bc45 + 20a0573 commit b8d4e41

File tree

242 files changed

+4550
-4479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+4550
-4479
lines changed

data/gala.metainfo.xml.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@
2727
<update_contact>contact_at_elementary.io</update_contact>
2828

2929
<releases>
30+
<release version="8.0.2" date="2024-10-24" urgency="medium">
31+
<description>
32+
<p>Improvements:</p>
33+
<ul>
34+
<li>Updated translations</li>
35+
</ul>
36+
</description>
37+
<issues>
38+
<issue url="https://github.com/elementary/gala/issues/1737">Cursor only visible in window screenshots </issue>
39+
<issue url="https://github.com/elementary/gala/issues/1898">wayland: opening windows when overview is opened breaks a lot</issue>
40+
<issue url="https://github.com/elementary/gala/issues/2053">Window renders black</issue>
41+
<issue url="https://github.com/elementary/gala/issues/2067">Terminal and System Settings have generic icon in multitasking view on Wayland</issue>
42+
<issue url="https://github.com/elementary/gala/issues/2083">Autohide is too sensitive</issue>
43+
<issue url="https://github.com/elementary/dock/issues/78">Touch support - getting the dock to display when hidden</issue>
44+
</issues>
45+
</release>
46+
3047
<release version="8.0.1" date="2024-09-17" urgency="medium">
3148
<description>
3249
<p>Improvements:</p>

lib/AnimationsSettings.vala

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
26+
/**
27+
* Utility that returns the given duration or 0 if animations are disabled.
28+
*/
29+
public uint get_animation_duration (uint duration) {
30+
return get_enable_animations () ? duration : 0;
31+
}
32+
}

lib/DragDropAction.vala

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -216,40 +216,6 @@ namespace Gala {
216216

217217
return Clutter.EVENT_STOP;
218218

219-
case EventType.BUTTON_RELEASE:
220-
case EventType.TOUCH_END:
221-
if (!is_valid_touch_event (event)) {
222-
return Clutter.EVENT_PROPAGATE;
223-
}
224-
225-
if (!dragging) {
226-
float x, y, ex, ey;
227-
event.get_coords (out ex, out ey);
228-
actor.get_transformed_position (out x, out y);
229-
230-
// release has happened within bounds of actor
231-
if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) {
232-
actor_clicked (event.get_button ());
233-
}
234-
235-
if (clicked) {
236-
ungrab_actor ();
237-
clicked = false;
238-
}
239-
240-
return Clutter.EVENT_STOP;
241-
} else if (dragging) {
242-
if (hovered != null) {
243-
finish ();
244-
hovered = null;
245-
} else {
246-
cancel ();
247-
}
248-
249-
return Clutter.EVENT_STOP;
250-
}
251-
break;
252-
253219
default:
254220
break;
255221
}
@@ -298,7 +264,42 @@ namespace Gala {
298264
if (event.get_key_symbol () == Key.Escape) {
299265
cancel ();
300266
}
301-
break;
267+
268+
return Clutter.EVENT_STOP;
269+
270+
case EventType.BUTTON_RELEASE:
271+
case EventType.TOUCH_END:
272+
if (!is_valid_touch_event (event)) {
273+
return Clutter.EVENT_PROPAGATE;
274+
}
275+
276+
if (dragging) {
277+
if (hovered != null) {
278+
finish ();
279+
hovered = null;
280+
} else {
281+
cancel ();
282+
}
283+
284+
return Clutter.EVENT_STOP;
285+
}
286+
287+
float x, y, ex, ey;
288+
event.get_coords (out ex, out ey);
289+
actor.get_transformed_position (out x, out y);
290+
291+
// release has happened within bounds of actor
292+
if (clicked && x < ex && x + actor.width > ex && y < ey && y + actor.height > ey) {
293+
actor_clicked (event.get_type () == BUTTON_RELEASE ? event.get_button () : Clutter.Button.PRIMARY);
294+
}
295+
296+
if (clicked) {
297+
ungrab_actor ();
298+
clicked = false;
299+
}
300+
301+
return Clutter.EVENT_STOP;
302+
302303
case EventType.MOTION:
303304
case EventType.TOUCH_UPDATE:
304305
if (!is_valid_touch_event (event)) {
@@ -338,6 +339,7 @@ namespace Gala {
338339
}
339340
}
340341
return Clutter.EVENT_STOP;
342+
341343
} else if (dragging) {
342344
handle.x -= last_x - x;
343345
handle.y -= last_y - y;
@@ -468,11 +470,11 @@ namespace Gala {
468470
var type = event.get_type ();
469471

470472
return (
473+
Meta.Util.is_wayland_compositor () ||
471474
type != Clutter.EventType.TOUCH_BEGIN &&
472475
type != Clutter.EventType.TOUCH_CANCEL &&
473476
type != Clutter.EventType.TOUCH_END &&
474-
type != Clutter.EventType.TOUCH_UPDATE ||
475-
Meta.Util.is_wayland_compositor ()
477+
type != Clutter.EventType.TOUCH_UPDATE
476478
);
477479
}
478480
}

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/Main.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
9292
var rect = Graphene.Rect.alloc ();
9393
rect.init (point_x, point_y, width, height);
9494

95-
var popup_window = new PopupWindow (wm, active);
95+
var popup_window = new PopupWindow (wm.get_display (), active);
9696
popup_window.set_container_clip (rect);
9797
popup_window.show.connect (on_popup_window_show);
9898
popup_window.hide.connect (on_popup_window_hide);
@@ -114,7 +114,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
114114
private void select_window_at (int x, int y) {
115115
var selected = get_window_actor_at (x, y);
116116
if (selected != null) {
117-
var popup_window = new PopupWindow (wm, selected);
117+
var popup_window = new PopupWindow (wm.get_display (), selected);
118118
popup_window.show.connect (on_popup_window_show);
119119
popup_window.hide.connect (on_popup_window_hide);
120120
add_window (popup_window);

plugins/pip/PopupWindow.vala

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
1616

1717
public signal void closed ();
1818

19-
public Gala.WindowManager wm { get; construct; }
19+
public Meta.Display display { get; construct; }
2020
public Meta.WindowActor window_actor { get; construct; }
2121

2222
private Clutter.Clone clone; // clone itself
@@ -52,12 +52,11 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
5252
|| window_type == Meta.WindowType.MODAL_DIALOG;
5353
}
5454

55-
public PopupWindow (Gala.WindowManager wm, Meta.WindowActor window_actor) {
56-
Object (wm: wm, window_actor: window_actor);
55+
public PopupWindow (Meta.Display display, Meta.WindowActor window_actor) {
56+
Object (display: display, window_actor: window_actor);
5757
}
5858

5959
construct {
60-
unowned var display = wm.get_display ();
6160
var scale = display.get_monitor_scale (display.get_current_monitor ());
6261

6362
button_size = Gala.Utils.scale_to_int (36, scale);
@@ -133,7 +132,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
133132
window.unmanaged.connect (on_close_click_clicked);
134133
window.notify["appears-focused"].connect (update_window_focus);
135134

136-
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
135+
unowned var workspace_manager = display.get_workspace_manager ();
137136
workspace_manager.active_workspace_changed.connect (update_window_focus);
138137
}
139138

@@ -143,15 +142,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
143142
opacity = 0;
144143

145144
save_easing_state ();
146-
set_easing_duration (wm.enable_animations ? 200 : 0);
145+
set_easing_duration (AnimationsSettings.get_animation_duration (200));
147146
opacity = 255;
148147
restore_easing_state ();
149148
}
150149

151150
public override void hide () {
152151
opacity = 255;
153152

154-
var duration = wm.enable_animations ? 200 : 0;
153+
var duration = AnimationsSettings.get_animation_duration (200);
155154
save_easing_state ();
156155
set_easing_duration (duration);
157156
opacity = 0;
@@ -173,7 +172,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
173172
#else
174173
public override bool enter_event (Clutter.CrossingEvent event) {
175174
#endif
176-
var duration = wm.enable_animations ? 300 : 0;
175+
var duration = AnimationsSettings.get_animation_duration (300);
177176

178177
close_button.save_easing_state ();
179178
close_button.set_easing_duration (duration);
@@ -193,7 +192,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
193192
#else
194193
public override bool leave_event (Clutter.CrossingEvent event) {
195194
#endif
196-
var duration = wm.enable_animations ? 300 : 0;
195+
var duration = AnimationsSettings.get_animation_duration (300);
197196

198197
close_button.save_easing_state ();
199198
close_button.set_easing_duration (duration);
@@ -215,15 +214,15 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
215214
}
216215

217216
private Clutter.Actor on_move_begin () {
218-
wm.get_display ().set_cursor (Meta.Cursor.DND_IN_DRAG);
217+
display.set_cursor (Meta.Cursor.DND_IN_DRAG);
219218

220219
return this;
221220
}
222221

223222
private void on_move_end () {
224223
reactive = true;
225224
update_screen_position ();
226-
wm.get_display ().set_cursor (Meta.Cursor.DEFAULT);
225+
display.set_cursor (Meta.Cursor.DEFAULT);
227226
}
228227

229228
#if HAS_MUTTER45
@@ -245,7 +244,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
245244
grab = resize_button.get_stage ().grab (resize_button);
246245
resize_button.event.connect (on_resize_event);
247246

248-
wm.get_display ().set_cursor (Meta.Cursor.SE_RESIZE);
247+
display.set_cursor (Meta.Cursor.SE_RESIZE);
249248

250249
return Clutter.EVENT_PROPAGATE;
251250
}
@@ -306,7 +305,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
306305

307306
update_screen_position ();
308307

309-
wm.get_display ().set_cursor (Meta.Cursor.DEFAULT);
308+
display.set_cursor (Meta.Cursor.DEFAULT);
310309
}
311310

312311
private void on_allocation_changed () {
@@ -315,7 +314,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
315314
}
316315

317316
private void on_close_click_clicked () {
318-
var duration = wm.enable_animations ? FADE_OUT_TIMEOUT : 0;
317+
var duration = AnimationsSettings.get_animation_duration (FADE_OUT_TIMEOUT);
319318

320319
save_easing_state ();
321320
set_easing_duration (duration);
@@ -329,14 +328,14 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
329328
}
330329

331330
private void update_window_focus () {
332-
unowned Meta.Window focus_window = wm.get_display ().get_focus_window ();
331+
unowned Meta.Window focus_window = display.get_focus_window ();
333332
if ((focus_window != null && !get_window_is_normal (focus_window))
334333
|| (previous_focus != null && !get_window_is_normal (previous_focus))) {
335334
previous_focus = focus_window;
336335
return;
337336
}
338337

339-
unowned var workspace_manager = wm.get_display ().get_workspace_manager ();
338+
unowned var workspace_manager = display.get_workspace_manager ();
340339
unowned var active_workspace = workspace_manager.get_active_workspace ();
341340
unowned var window = window_actor.get_meta_window ();
342341

@@ -449,7 +448,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
449448
var screen_limit_start_y = SCREEN_MARGIN + monitor_y;
450449
var screen_limit_end_y = monitor_height + monitor_y - SCREEN_MARGIN - height;
451450

452-
var duration = wm.enable_animations ? 300 : 0;
451+
var duration = AnimationsSettings.get_animation_duration (300);
453452

454453
save_easing_state ();
455454
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
@@ -462,7 +461,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
462461
private bool place_window_off_screen () {
463462
off_screen = false;
464463

465-
var duration = wm.enable_animations ? 300 : 0;
464+
var duration = AnimationsSettings.get_animation_duration (300);
466465

467466
save_easing_state ();
468467
set_easing_mode (Clutter.AnimationMode.EASE_OUT_BACK);
@@ -520,7 +519,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
520519
}
521520

522521
private bool coord_is_in_other_monitor (float coord, Clutter.Orientation axis) {
523-
var display = wm.get_display ();
524522
int n_monitors = display.get_n_monitors ();
525523

526524
if (n_monitors == 1) {
@@ -553,7 +551,6 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
553551
#else
554552
private void get_current_monitor_rect (out Meta.Rectangle rect) {
555553
#endif
556-
var display = wm.get_display ();
557554
rect = display.get_monitor_geometry (display.get_current_monitor ());
558555
}
559556

0 commit comments

Comments
 (0)