Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/Gestures/ActorTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
* If a new child (or target via {@link add_target}) is added, its progress will be synced.
*/
public class Gala.ActorTarget : Clutter.Actor, GestureTarget {
public Clutter.Actor? actor {
get {
return this;
}
}

public bool animating { get { return ongoing_animations > 0; } }

private double[] current_progress;
Expand Down
6 changes: 0 additions & 6 deletions lib/Gestures/GestureTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,5 @@ public interface Gala.GestureTarget : Object {
END
}

/**
* The actor manipulated by the gesture. The associated frame clock
* will be used for animation timelines.
*/
public abstract Clutter.Actor? actor { get; }

public virtual void propagate (UpdateType update_type, GestureAction action, double progress) { }
}
27 changes: 17 additions & 10 deletions lib/Gestures/PropertyTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@

public class Gala.PropertyTarget : Object, GestureTarget {
public GestureAction action { get; construct; }

//we don't want to hold a strong reference to the actor because we might've been added to it which would form a reference cycle
private weak Clutter.Actor? _actor;
public Clutter.Actor? actor { get { return _actor; } }

// Don't take a reference since we are most of the time owned by the target
public weak Object? target { get; private set; }
public string property { get; construct; }

public Clutter.Interval interval { get; construct; }

public PropertyTarget (GestureAction action, Clutter.Actor actor, string property, Type value_type, Value from_value, Value to_value) {
public PropertyTarget (GestureAction action, Object target, string property, Type value_type, Value from_value, Value to_value) {
Object (action: action, property: property, interval: new Clutter.Interval.with_values (value_type, from_value, to_value));

_actor = actor;
_actor.destroy.connect (() => _actor = null);
this.target = target;
this.target.weak_ref (on_target_disposed);
}

~PropertyTarget () {
if (target != null) {
target.weak_unref (on_target_disposed);
}
}

private void on_target_disposed () {
target = null;
}

public override void propagate (UpdateType update_type, GestureAction action, double progress) {
if (update_type != UPDATE || action != this.action) {
if (target == null || update_type != UPDATE || action != this.action) {
return;
}

actor.set_property (property, interval.compute (progress));
target.set_property (property, interval.compute (progress));
}
}
6 changes: 6 additions & 0 deletions lib/Gestures/RootTarget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
*/

public interface Gala.RootTarget : Object, GestureTarget {
/**
* The actor manipulated by the gesture. The associated frame clock
* will be used for animation timelines.
*/
public abstract Clutter.Actor? actor { get; }

public void add_gesture_controller (GestureController controller) requires (controller.target == null) {
controller.attached (this);
weak_ref (controller.detached);
Expand Down
1 change: 1 addition & 0 deletions src/ShellClients/PanelWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class Gala.PanelWindow : ShellWindow, RootTarget {
private static HashTable<Meta.Window, Meta.Strut?> window_struts = new HashTable<Meta.Window, Meta.Strut?> (null, null);

public Clutter.Actor? actor { get { return (Clutter.Actor) window.get_compositor_private (); } }
public WindowManager wm { get; construct; }
public Pantheon.Desktop.Anchor anchor { get; construct set; }

Expand Down
2 changes: 0 additions & 2 deletions src/ShellClients/ShellClientsManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class Gala.ShellClientsManager : Object, GestureTarget {
return instance;
}

public Clutter.Actor? actor { get { return wm.stage; } }

public WindowManager wm { get; construct; }

private NotificationsClient notifications_client;
Expand Down
1 change: 0 additions & 1 deletion src/ShellClients/ShellWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

public class Gala.ShellWindow : PositionedWindow, GestureTarget {
public Clutter.Actor? actor { get { return window_actor; } }
public bool restore_previous_x11_region { private get; set; default = false; }

private Meta.WindowActor window_actor;
Expand Down
1 change: 1 addition & 0 deletions src/Widgets/MultitaskingView/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Gala.MultitaskingView : ActorTarget, RootTarget, ActivatableCompone
private GestureController workspaces_gesture_controller;
private GestureController multitasking_gesture_controller;

public Clutter.Actor? actor { get { return this; } }
public WindowManagerGala wm { get; construct; }

private Meta.Display display;
Expand Down
1 change: 1 addition & 0 deletions src/Widgets/MultitaskingView/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
*/
public signal void request_reposition ();

public Clutter.Actor? actor { get { return this; } }
public WindowManager wm { get; construct; }
public Meta.Window window { get; construct; }

Expand Down
1 change: 1 addition & 0 deletions src/Widgets/WindowOverview.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Gala.WindowOverview : ActorTarget, RootTarget, ActivatableComponent
private const int TOP_GAP = 30;
private const int BOTTOM_GAP = 100;

public Clutter.Actor? actor { get { return this; } }
public WindowManager wm { get; construct; }

private GestureController gesture_controller; // Currently not used for actual touchpad gestures but only as controller
Expand Down