Skip to content

Commit

Permalink
Merge branch 'main' into leolost/remove-default-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 authored Jan 13, 2025
2 parents d600a6f + 56d8caf commit 5a6faf0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
18 changes: 7 additions & 11 deletions src/HotCorners/HotCornerManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,16 @@ public class Gala.HotCornerManager : Object {
private void run_custom_action (string hot_corner_position) {
string command = "";
var line = behavior_settings.get_string ("hotcorner-custom-command");
if (line == "")
if (line == "") {
return;
}

var parts = line.split (";;");
// keep compatibility to old version where only one command was possible
if (parts.length == 1) {
command = line;
} else {
// find specific actions
foreach (unowned var part in parts) {
var details = part.split (":");
if (details[0] == hot_corner_position) {
command = details[1];
}
// find specific actions
foreach (unowned var part in parts) {
var details = part.split (":", 2);
if (details[0] == hot_corner_position) {
command = details[1];
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/InternalUtils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,17 @@ namespace Gala {
});
}

public static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
if (actor == new_parent) {
return;
}

actor.ref ();
actor.get_parent ().remove_child (actor);
new_parent.add_child (actor);
actor.unref ();
}

public static void bell_notify (Meta.Display display) {
#if HAS_MUTTER47
display.get_stage ().context.get_backend ().get_default_seat ().bell_notify ();
Expand Down
27 changes: 7 additions & 20 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ namespace Gala {
// Notifications are a special case and have to be always be handled
// (also regardless of the animation setting)
if (NotificationStack.is_notification (window)) {
clutter_actor_reparent (actor, notification_group);
InternalUtils.clutter_actor_reparent (actor, notification_group);
notification_stack.show_notification (actor);

map_completed (actor);
Expand Down Expand Up @@ -1945,7 +1945,7 @@ namespace Gala {
windows.append (actor);
parents.append (actor.get_parent ());

clutter_actor_reparent (actor, static_windows);
InternalUtils.clutter_actor_reparent (actor, static_windows);
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);

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

if (window.fullscreen)
from_has_fullscreened = true;
Expand All @@ -1975,7 +1975,7 @@ namespace Gala {
windows.append (actor);
parents.append (actor.get_parent ());
actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
clutter_actor_reparent (actor, in_group);
InternalUtils.clutter_actor_reparent (actor, in_group);

if (window.fullscreen)
to_has_fullscreened = true;
Expand Down Expand Up @@ -2050,7 +2050,7 @@ namespace Gala {
switch_workspace_window_created_id = window_created.connect ((window) => {
if (NotificationStack.is_notification (window)) {
InternalUtils.wait_for_window_actor_visible (window, (actor) => {
clutter_actor_reparent (actor, notification_group);
InternalUtils.clutter_actor_reparent (actor, notification_group);
notification_stack.show_notification (actor);
});
}
Expand Down Expand Up @@ -2180,13 +2180,13 @@ namespace Gala {

unowned Meta.WindowActor? window = actor as Meta.WindowActor;
if (window == null) {
clutter_actor_reparent (actor, parents.nth_data (i));
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
continue;
}

unowned Meta.Window? meta_window = window.get_meta_window ();
if (!window.is_destroyed ()) {
clutter_actor_reparent (actor, parents.nth_data (i));
InternalUtils.clutter_actor_reparent (actor, parents.nth_data (i));
}

kill_window_effects (window);
Expand Down Expand Up @@ -2350,18 +2350,5 @@ namespace Gala {
// Ignore this error
}
}

private static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
if (actor == new_parent)
return;

actor.ref ();
actor.get_parent ().remove_child (actor);
new_parent.add_child (actor);
actor.unref ();
}
}

[CCode (cname="clutter_x11_get_stage_window")]
public extern X.Window x_get_stage_window (Clutter.Actor stage);
}

0 comments on commit 5a6faf0

Please sign in to comment.