Skip to content

Commit 8321358

Browse files
authored
Introduce GestureAction.CUSTOM (#2518)
Replaces our DOCK and CLOSE_WINDOW gesture actions with CUSTOM. This allows us to use this action in plugins (e.g. for hiding PiP). This change shouldn't affect anything since users of DOCK and CLOSE_WINDOW are self-contained and don't have complicated target hierarchy.
1 parent 7c309d4 commit 8321358

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

lib/Gestures/Gesture.vala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ namespace Gala {
3939
SWITCH_WORKSPACE,
4040
SWITCH_WINDOWS,
4141
MULTITASKING_VIEW,
42-
DOCK,
4342
ZOOM,
44-
CLOSE_WINDOW,
43+
CUSTOM,
4544
N_ACTIONS
4645
}
4746

src/ShellClients/PanelWindow.vala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77

88
public class Gala.PanelWindow : ShellWindow, RootTarget {
9-
private const int ANIMATION_DURATION = 250;
10-
119
private static HashTable<Meta.Window, Meta.Strut?> window_struts = new HashTable<Meta.Window, Meta.Strut?> (null, null);
1210

1311
public WindowManager wm { get; construct; }
@@ -53,7 +51,7 @@ public class Gala.PanelWindow : ShellWindow, RootTarget {
5351
notify["width"].connect (update_strut);
5452
notify["height"].connect (update_strut);
5553

56-
gesture_controller = new GestureController (DOCK, wm);
54+
gesture_controller = new GestureController (CUSTOM, wm);
5755
add_gesture_controller (gesture_controller);
5856

5957
hide_tracker = new HideTracker (wm.get_display (), this);

src/ShellClients/ShellWindow.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class Gala.ShellWindow : PositionedWindow, GestureTarget {
3737

3838
private void update_target () {
3939
property_target = new PropertyTarget (
40-
DOCK, window_actor,
40+
CUSTOM, window_actor,
4141
get_animation_property (),
4242
get_property_type (),
4343
calculate_value (false),
@@ -54,7 +54,7 @@ public class Gala.ShellWindow : PositionedWindow, GestureTarget {
5454
}
5555

5656
private void update_property () {
57-
property_target.propagate (UPDATE, DOCK, get_hidden_progress ());
57+
property_target.propagate (UPDATE, CUSTOM, get_hidden_progress ());
5858
}
5959

6060
public override void propagate (UpdateType update_type, GestureAction action, double progress) {
@@ -84,7 +84,7 @@ public class Gala.ShellWindow : PositionedWindow, GestureTarget {
8484
multitasking_view_progress = progress;
8585
break;
8686

87-
case DOCK:
87+
case CUSTOM:
8888
custom_progress = progress;
8989
break;
9090

src/Widgets/MultitaskingView/WindowClone.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
9595
construct {
9696
reactive = true;
9797

98-
gesture_controller = new GestureController (CLOSE_WINDOW, wm);
98+
gesture_controller = new GestureController (CUSTOM, wm);
9999
gesture_controller.enable_scroll (this, VERTICAL);
100100
add_gesture_controller (gesture_controller);
101101

@@ -272,7 +272,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
272272
}
273273

274274
public override void update_progress (Gala.GestureAction action, double progress) {
275-
if (action != CLOSE_WINDOW || slot == null || !Meta.Prefs.get_gnome_animations ()) {
275+
if (action != CUSTOM || slot == null || !Meta.Prefs.get_gnome_animations ()) {
276276
return;
277277
}
278278

@@ -295,7 +295,7 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
295295
public override void end_progress (GestureAction action) {
296296
update_hover_widgets (false);
297297

298-
if (action == CLOSE_WINDOW && get_current_commit (CLOSE_WINDOW) > 0.5 && Meta.Prefs.get_gnome_animations ()) {
298+
if (action == CUSTOM && get_current_commit (CUSTOM) > 0.5 && Meta.Prefs.get_gnome_animations ()) {
299299
close_window (Meta.CURRENT_TIME);
300300
}
301301
}

0 commit comments

Comments
 (0)