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
16 changes: 0 additions & 16 deletions lib/Gestures/Gesture.vala
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,9 @@ namespace Gala {
}

private class Gesture {
public const float INVALID_COORD = float.MAX;

public Clutter.EventType type;
public GestureDirection direction;
public int fingers;
public Clutter.InputDeviceType performed_on_device_type;

/**
* The x coordinate of the initial contact point for the gesture.
* Doesn't have to be set. In that case it is set to {@link INVALID_COORD}.
* Currently the only backend not setting this is {@link GestureTracker.enable_touchpad}.
*/
public float origin_x = INVALID_COORD;

/**
* The y coordinate of the initial contact point for the gesture.
* Doesn't have to be set. In that case it is set to {@link INVALID_COORD}.
* Currently the only backend not setting this is {@link GestureTracker.enable_touchpad}.
*/
public float origin_y = INVALID_COORD;
}
}
2 changes: 0 additions & 2 deletions lib/Gestures/GestureBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ private interface Gala.GestureBackend : Object {
public signal void on_update (double percentage, uint64 time);
public signal void on_end (double percentage, uint64 time);

public virtual void prepare_gesture_handling () { }

/**
* The gesture should be cancelled. The implementation should stop emitting
* signals and reset any internal state. In particular it should not emit on_end.
Expand Down
17 changes: 0 additions & 17 deletions lib/Gestures/GestureSettings.vala
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ private class Gala.GestureSettings : Object {
: touchpad_settings.get_boolean ("natural-scroll");
}

public Meta.MotionDirection? get_natural_scroll_direction (Gesture gesture) {
bool natural_scroll = is_natural_scroll_enabled (gesture.performed_on_device_type);

switch (gesture.direction) {
case GestureDirection.UP:
return natural_scroll ? Meta.MotionDirection.DOWN : Meta.MotionDirection.UP;
case GestureDirection.DOWN:
return natural_scroll ? Meta.MotionDirection.UP : Meta.MotionDirection.DOWN;
case GestureDirection.LEFT:
return natural_scroll ? Meta.MotionDirection.RIGHT : Meta.MotionDirection.LEFT;
case GestureDirection.RIGHT:
return natural_scroll ? Meta.MotionDirection.LEFT : Meta.MotionDirection.RIGHT;
default:
return null;
}
}

public static string get_string (string setting_id) {
return gala_settings.get_string (setting_id);
}
Expand Down
10 changes: 3 additions & 7 deletions lib/Gestures/ScrollBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ private class Gala.ScrollBackend : Object, GestureBackend {
return Clutter.EVENT_PROPAGATE;
}

float origin_x, origin_y;
event.get_coords (out origin_x, out origin_y);
Gesture gesture = build_gesture (origin_x, origin_y, delta_x, delta_y, orientation, time);
var gesture = build_gesture (delta_x, delta_y, orientation, time);
started = true;
direction = gesture.direction;
on_gesture_detected (gesture, time);
Expand Down Expand Up @@ -147,7 +145,7 @@ private class Gala.ScrollBackend : Object, GestureBackend {
}
}

private static Gesture build_gesture (float origin_x, float origin_y, double delta_x, double delta_y, Clutter.Orientation orientation, uint32 timestamp) {
private static Gesture build_gesture (double delta_x, double delta_y, Clutter.Orientation orientation, uint32 timestamp) {
GestureDirection direction;
if (orientation == Clutter.Orientation.HORIZONTAL) {
direction = delta_x > 0 ? GestureDirection.RIGHT : GestureDirection.LEFT;
Expand All @@ -159,9 +157,7 @@ private class Gala.ScrollBackend : Object, GestureBackend {
type = Clutter.EventType.SCROLL,
direction = direction,
fingers = 2,
performed_on_device_type = Clutter.InputDeviceType.TOUCHPAD_DEVICE,
origin_x = origin_x,
origin_y = origin_y
performed_on_device_type = Clutter.InputDeviceType.TOUCHPAD_DEVICE
};
}

Expand Down