Skip to content

Commit 484f211

Browse files
authored
Merge branch 'main' into leolost/fix-single-custom-action
2 parents fccb9f9 + d5cb0b4 commit 484f211

File tree

6 files changed

+239
-221
lines changed

6 files changed

+239
-221
lines changed

data/gala.metainfo.xml.in

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

2929
<releases>
30-
<release version="8.0.5" date="2024-12-18" urgency="medium">
30+
<release version="8.1.0" date="2025-01-11" urgency="medium">
3131
<description>
3232
<p>Improvements:</p>
3333
<ul>

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.4',
3+
version: '8.1.0',
44
meson_version: '>= 0.59.0',
55
license: 'GPL3',
66
)

src/InternalUtils.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,5 +369,16 @@ namespace Gala {
369369
}
370370
});
371371
}
372+
373+
public static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
374+
if (actor == new_parent) {
375+
return;
376+
}
377+
378+
actor.ref ();
379+
actor.get_parent ().remove_child (actor);
380+
new_parent.add_child (actor);
381+
actor.unref ();
382+
}
372383
}
373384
}

src/ShellClients/PanelWindow.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ public class Gala.PanelWindow : Object {
3636

3737
unowned var display = wm.get_display ();
3838

39+
window_positioner = new WindowPositioner (display, window, WindowPositioner.Position.from_anchor (anchor));
40+
41+
notify["anchor"].connect (() => window_positioner.position = WindowPositioner.Position.from_anchor (anchor));
42+
3943
unowned var workspace_manager = display.get_workspace_manager ();
4044
workspace_manager.workspace_added.connect (update_strut);
4145
workspace_manager.workspace_removed.connect (update_strut);
4246

4347
window.size_changed.connect (update_strut);
4448
window.position_changed.connect (update_strut);
45-
46-
window_positioner = new WindowPositioner (display, window, WindowPositioner.Position.from_anchor (anchor));
47-
48-
notify["anchor"].connect (() => window_positioner.position = WindowPositioner.Position.from_anchor (anchor));
4949
}
5050

5151
#if HAS_MUTTER45

src/WindowManager.vala

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ namespace Gala {
14391439
// Notifications are a special case and have to be always be handled
14401440
// (also regardless of the animation setting)
14411441
if (NotificationStack.is_notification (window)) {
1442-
clutter_actor_reparent (actor, notification_group);
1442+
InternalUtils.clutter_actor_reparent (actor, notification_group);
14431443
notification_stack.show_notification (actor);
14441444

14451445
map_completed (actor);
@@ -1945,7 +1945,7 @@ namespace Gala {
19451945
windows.append (actor);
19461946
parents.append (actor.get_parent ());
19471947

1948-
clutter_actor_reparent (actor, static_windows);
1948+
InternalUtils.clutter_actor_reparent (actor, static_windows);
19491949
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
19501950

19511951
// Don't fade docks and moving/grabbed windows they just stay where they are
@@ -1966,7 +1966,7 @@ namespace Gala {
19661966
windows.append (actor);
19671967
parents.append (actor.get_parent ());
19681968
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
1969-
clutter_actor_reparent (actor, out_group);
1969+
InternalUtils.clutter_actor_reparent (actor, out_group);
19701970

19711971
if (window.fullscreen)
19721972
from_has_fullscreened = true;
@@ -1975,7 +1975,7 @@ namespace Gala {
19751975
windows.append (actor);
19761976
parents.append (actor.get_parent ());
19771977
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
1978-
clutter_actor_reparent (actor, in_group);
1978+
InternalUtils.clutter_actor_reparent (actor, in_group);
19791979

19801980
if (window.fullscreen)
19811981
to_has_fullscreened = true;
@@ -2050,7 +2050,7 @@ namespace Gala {
20502050
switch_workspace_window_created_id = window_created.connect ((window) => {
20512051
if (NotificationStack.is_notification (window)) {
20522052
InternalUtils.wait_for_window_actor_visible (window, (actor) => {
2053-
clutter_actor_reparent (actor, notification_group);
2053+
InternalUtils.clutter_actor_reparent (actor, notification_group);
20542054
notification_stack.show_notification (actor);
20552055
});
20562056
}
@@ -2145,7 +2145,14 @@ namespace Gala {
21452145
unowned Meta.Display display = get_display ();
21462146
unowned var active_workspace = display.get_workspace_manager ().get_active_workspace ();
21472147
unowned var neighbor = active_workspace.get_neighbor (cancel_direction);
2148-
neighbor.activate (display.get_current_time ());
2148+
2149+
if (moving != null) {
2150+
move_window (moving, neighbor, Meta.CURRENT_TIME);
2151+
} else {
2152+
neighbor.activate (display.get_current_time ());
2153+
}
2154+
} else {
2155+
moving = null;
21492156
}
21502157
}
21512158

@@ -2173,13 +2180,13 @@ namespace Gala {
21732180

21742181
unowned Meta.WindowActor? window = actor as Meta.WindowActor;
21752182
if (window == null) {
2176-
clutter_actor_reparent (actor, parents.nth_data (i));
2183+
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
21772184
continue;
21782185
}
21792186

21802187
unowned Meta.Window? meta_window = window.get_meta_window ();
21812188
if (!window.is_destroyed ()) {
2182-
clutter_actor_reparent (actor, parents.nth_data (i));
2189+
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
21832190
}
21842191

21852192
kill_window_effects (window);
@@ -2207,7 +2214,6 @@ namespace Gala {
22072214

22082215
windows = null;
22092216
parents = null;
2210-
moving = null;
22112217

22122218
out_group = null;
22132219
in_group = null;
@@ -2344,18 +2350,5 @@ namespace Gala {
23442350
// Ignore this error
23452351
}
23462352
}
2347-
2348-
private static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
2349-
if (actor == new_parent)
2350-
return;
2351-
2352-
actor.ref ();
2353-
actor.get_parent ().remove_child (actor);
2354-
new_parent.add_child (actor);
2355-
actor.unref ();
2356-
}
23572353
}
2358-
2359-
[CCode (cname="clutter_x11_get_stage_window")]
2360-
public extern X.Window x_get_stage_window (Clutter.Actor stage);
23612354
}

0 commit comments

Comments
 (0)