From bcbc22bc6a9eff6c6f7ce9923c1ae8b9ac60c569 Mon Sep 17 00:00:00 2001 From: lenemter Date: Wed, 29 Jan 2025 00:58:24 +0900 Subject: [PATCH] Compositor: remove more dead code --- compositor/WindowManager.vala | 140 ---------------------------------- 1 file changed, 140 deletions(-) diff --git a/compositor/WindowManager.vala b/compositor/WindowManager.vala index ae92172b..ad9539d8 100644 --- a/compositor/WindowManager.vala +++ b/compositor/WindowManager.vala @@ -21,25 +21,9 @@ using Meta; namespace GreeterCompositor { public class WindowManager : Meta.Plugin { - - /** - * {@inheritDoc} - */ public Clutter.Actor ui_group { get; protected set; } - - /** - * {@inheritDoc} - */ public Clutter.Stage stage { get; protected set; } - - /** - * {@inheritDoc} - */ public Clutter.Actor window_group { get; protected set; } - - /** - * {@inheritDoc} - */ public Clutter.Actor top_window_group { get; protected set; } /** @@ -59,24 +43,8 @@ namespace GreeterCompositor { private GLib.Settings application_settings; private int reader_pid = 0; - //WindowSwitcher? winswitcher = null; - //ActivatableComponent? workspace_view = null; - //ActivatableComponent? window_overview = null; - private Zoom zoom; - //ScreenSaver? screensaver; - - //Gee.LinkedList modal_stack = new Gee.LinkedList (); - - Gee.HashSet minimizing = new Gee.HashSet (); - Gee.HashSet maximizing = new Gee.HashSet (); - Gee.HashSet unmaximizing = new Gee.HashSet (); - Gee.HashSet mapping = new Gee.HashSet (); - Gee.HashSet destroying = new Gee.HashSet (); - Gee.HashSet unminimizing = new Gee.HashSet (); - GLib.HashTable ws_assoc = new GLib.HashTable (direct_hash, direct_equal); - construct { info = Meta.PluginInfo () {name = "GreeterCompositor", version = Constants.VERSION, author = "elementary LLC.", license = "GPLv3", description = "The greeter compositor"}; @@ -340,54 +308,6 @@ namespace GreeterCompositor { show_window_menu (window, menu, rect.x, rect.y); } - /* - * effects - */ - - void handle_fullscreen_window (Meta.Window window, Meta.SizeChange which_change) { - // Only handle windows which are located on the primary monitor - if (!window.is_on_primary_monitor ()) - return; - - // Due to how this is implemented, by relying on the functionality - // offered by the dynamic workspace handler, let's just bail out - // if that's not available. - if (!Prefs.get_dynamic_workspaces ()) - return; - - unowned Meta.Display display = get_display (); - var time = display.get_current_time (); - unowned Meta.Workspace win_ws = window.get_workspace (); - unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); - - if (which_change == Meta.SizeChange.FULLSCREEN) { - // Do nothing if the current workspace would be empty - if (Utils.get_n_windows (win_ws) <= 1) - return; - - var old_ws_index = win_ws.index (); - var new_ws_index = old_ws_index + 1; - //InternalUtils.insert_workspace_with_window (new_ws_index, window); - - var new_ws_obj = manager.get_workspace_by_index (new_ws_index); - window.change_workspace (new_ws_obj); - new_ws_obj.activate_with_focus (window, time); - - ws_assoc.insert (window, old_ws_index); - } else if (ws_assoc.contains (window)) { - var old_ws_index = ws_assoc.get (window); - var new_ws_index = win_ws.index (); - - if (new_ws_index != old_ws_index && old_ws_index < manager.get_n_workspaces ()) { - var old_ws_obj = manager.get_workspace_by_index (old_ws_index); - window.change_workspace (old_ws_obj); - old_ws_obj.activate_with_focus (window, time); - } - - ws_assoc.remove (window); - } - } - #if HAS_MUTTER45 public override void size_change (Meta.WindowActor actor, Meta.SizeChange which_change, Mtk.Rectangle old_frame_rect, Mtk.Rectangle old_buffer_rect) { #else @@ -396,25 +316,7 @@ namespace GreeterCompositor { unowned Meta.Window window = actor.get_meta_window (); if (window.get_tile_match () != null) { size_change_completed (actor); - return; } - - ulong signal_id = 0U; - signal_id = window.size_changed.connect (() => { - window.disconnect (signal_id); - - switch (which_change) { - case Meta.SizeChange.MAXIMIZE: - case Meta.SizeChange.UNMAXIMIZE: - break; - case Meta.SizeChange.FULLSCREEN: - case Meta.SizeChange.UNFULLSCREEN: - handle_fullscreen_window (actor.get_meta_window (), which_change); - break; - } - - size_change_completed (actor); - }); } public override void minimize (WindowActor actor) { @@ -423,61 +325,19 @@ namespace GreeterCompositor { public override void unminimize (WindowActor actor) { actor.show (); unminimize_completed (actor); - return; } public override void map (WindowActor actor) { actor.show (); map_completed (actor); - return; } public override void destroy (WindowActor actor) { destroy_completed (actor); Utils.request_clean_icon_cache (get_all_xids ()); - - return; - } - - // Cancel attached animation of an actor and reset it - bool end_animation (ref Gee.HashSet list, WindowActor actor) { - if (!list.contains (actor)) - return false; - - if (actor.is_destroyed ()) { - list.remove (actor); - return false; - } - - actor.remove_all_transitions (); - actor.opacity = 255U; - actor.set_scale (1.0f, 1.0f); - actor.rotation_angle_x = 0.0f; - actor.set_pivot_point (0.0f, 0.0f); - - list.remove (actor); - return true; } public override void kill_window_effects (WindowActor actor) { - if (end_animation (ref mapping, actor)) { - map_completed (actor); - } - - if (end_animation (ref unminimizing, actor)) { - unminimize_completed (actor); - } - - if (end_animation (ref minimizing, actor)) { - minimize_completed (actor); - } - - if (end_animation (ref destroying, actor)) { - destroy_completed (actor); - } - - end_animation (ref unmaximizing, actor); - end_animation (ref maximizing, actor); } public override void switch_workspace (int from, int to, MotionDirection direction) {