Skip to content

Commit 5a6faf0

Browse files
authored
Merge branch 'main' into leolost/remove-default-backend
2 parents d600a6f + 56d8caf commit 5a6faf0

File tree

3 files changed

+25
-31
lines changed

3 files changed

+25
-31
lines changed

src/HotCorners/HotCornerManager.vala

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,16 @@ public class Gala.HotCornerManager : Object {
9292
private void run_custom_action (string hot_corner_position) {
9393
string command = "";
9494
var line = behavior_settings.get_string ("hotcorner-custom-command");
95-
if (line == "")
95+
if (line == "") {
9696
return;
97+
}
9798

9899
var parts = line.split (";;");
99-
// keep compatibility to old version where only one command was possible
100-
if (parts.length == 1) {
101-
command = line;
102-
} else {
103-
// find specific actions
104-
foreach (unowned var part in parts) {
105-
var details = part.split (":");
106-
if (details[0] == hot_corner_position) {
107-
command = details[1];
108-
}
100+
// find specific actions
101+
foreach (unowned var part in parts) {
102+
var details = part.split (":", 2);
103+
if (details[0] == hot_corner_position) {
104+
command = details[1];
109105
}
110106
}
111107

src/InternalUtils.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,17 @@ namespace Gala {
370370
});
371371
}
372372

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+
}
383+
373384
public static void bell_notify (Meta.Display display) {
374385
#if HAS_MUTTER47
375386
display.get_stage ().context.get_backend ().get_default_seat ().bell_notify ();

src/WindowManager.vala

Lines changed: 7 additions & 20 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
}
@@ -2180,13 +2180,13 @@ namespace Gala {
21802180

21812181
unowned Meta.WindowActor? window = actor as Meta.WindowActor;
21822182
if (window == null) {
2183-
clutter_actor_reparent (actor, parents.nth_data (i));
2183+
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
21842184
continue;
21852185
}
21862186

21872187
unowned Meta.Window? meta_window = window.get_meta_window ();
21882188
if (!window.is_destroyed ()) {
2189-
clutter_actor_reparent (actor, parents.nth_data (i));
2189+
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
21902190
}
21912191

21922192
kill_window_effects (window);
@@ -2350,18 +2350,5 @@ namespace Gala {
23502350
// Ignore this error
23512351
}
23522352
}
2353-
2354-
private static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
2355-
if (actor == new_parent)
2356-
return;
2357-
2358-
actor.ref ();
2359-
actor.get_parent ().remove_child (actor);
2360-
new_parent.add_child (actor);
2361-
actor.unref ();
2362-
}
23632353
}
2364-
2365-
[CCode (cname="clutter_x11_get_stage_window")]
2366-
public extern X.Window x_get_stage_window (Clutter.Actor stage);
23672354
}

0 commit comments

Comments
 (0)