From ff7c2cbc7a01662586e0d9aebf455f632898f16a Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 12 Jan 2025 11:27:57 +0300 Subject: [PATCH 1/3] Remove x_get_stage_window (#2224) --- src/WindowManager.vala | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/WindowManager.vala b/src/WindowManager.vala index 8c93583a4..c342dfba3 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -2361,7 +2361,4 @@ namespace Gala { actor.unref (); } } - - [CCode (cname="clutter_x11_get_stage_window")] - public extern X.Window x_get_stage_window (Clutter.Actor stage); } From d5cb0b41f435a62607e18a006e4b9a7fe977da7e Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 12 Jan 2025 11:29:48 +0300 Subject: [PATCH 2/3] Move clutter_actor_reparent to InternalUtils (#2223) --- src/InternalUtils.vala | 11 +++++++++++ src/WindowManager.vala | 24 +++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/InternalUtils.vala b/src/InternalUtils.vala index c8c044369..9387bf289 100644 --- a/src/InternalUtils.vala +++ b/src/InternalUtils.vala @@ -369,5 +369,16 @@ 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 (); + } } } diff --git a/src/WindowManager.vala b/src/WindowManager.vala index c342dfba3..402941cc7 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -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); @@ -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 @@ -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; @@ -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; @@ -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); }); } @@ -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); @@ -2350,15 +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 (); - } } } From 56d8cafe6962114b4973d3e18da34961563ff889 Mon Sep 17 00:00:00 2001 From: Leonhard Date: Sun, 12 Jan 2025 15:16:05 +0100 Subject: [PATCH 3/3] HotCorners: Fix custom action if there's only one (#2220) Co-authored-by: Leo --- src/HotCorners/HotCornerManager.vala | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/HotCorners/HotCornerManager.vala b/src/HotCorners/HotCornerManager.vala index 7712c5d05..f98940b97 100644 --- a/src/HotCorners/HotCornerManager.vala +++ b/src/HotCorners/HotCornerManager.vala @@ -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]; } }