Skip to content

Commit a8b2a06

Browse files
committed
Add with_gesture for now
1 parent 6c10485 commit a8b2a06

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/Gestures/GestureTracker.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ public class Gala.GestureTracker : Object {
196196
}
197197

198198
/**
199-
* Connects a callback that will only be called if != 0 completions were made.
199+
* Connects a callback that will be called as soon as the gesture finishes.
200200
* If with_gesture is false it will be called immediately, otherwise once {@link on_end} is emitted.
201201
*/
202-
public void add_success_callback (bool with_gesture, owned OnEnd callback) {
202+
public void add_end_callback (bool with_gesture, owned OnEnd callback) {
203203
if (!with_gesture) {
204204
callback (1, 1, min_animation_duration);
205205
} else {

src/ShellClients/PanelWindow.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ public class Gala.PanelWindow : ShellWindow {
113113
}
114114

115115
private void hide () {
116-
add_state (CUSTOM_HIDDEN, default_gesture_tracker);
116+
add_state (CUSTOM_HIDDEN, default_gesture_tracker, false);
117117
}
118118

119119
private void show () {
120120
if (window.display.get_monitor_in_fullscreen (window.get_monitor ())) {
121121
return;
122122
}
123123

124-
remove_state (CUSTOM_HIDDEN, default_gesture_tracker);
124+
remove_state (CUSTOM_HIDDEN, default_gesture_tracker, false);
125125
}
126126

127127
private void make_exclusive () {

src/ShellClients/ShellClientsManager.vala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,23 @@ public class Gala.ShellClientsManager : Object {
190190
window.unmanaging.connect_after ((_window) => positioned_windows.remove (_window));
191191
}
192192

193-
public void add_state (ShellWindow.State state, GestureTracker gesture_tracker) {
193+
public void add_state (ShellWindow.State state, GestureTracker gesture_tracker, bool with_gesture) {
194194
foreach (var window in positioned_windows.get_values ()) {
195-
window.add_state (state, gesture_tracker);
195+
window.add_state (state, gesture_tracker, with_gesture);
196196
}
197197

198198
foreach (var window in panel_windows.get_values ()) {
199-
window.add_state (state, gesture_tracker);
199+
window.add_state (state, gesture_tracker, with_gesture);
200200
}
201201
}
202202

203-
public void remove_state (ShellWindow.State state, GestureTracker gesture_tracker) {
203+
public void remove_state (ShellWindow.State state, GestureTracker gesture_tracker, bool with_gesture) {
204204
foreach (var window in positioned_windows.get_values ()) {
205-
window.remove_state (state, gesture_tracker);
205+
window.remove_state (state, gesture_tracker, with_gesture);
206206
}
207207

208208
foreach (var window in panel_windows.get_values ()) {
209-
window.remove_state (state, gesture_tracker);
209+
window.remove_state (state, gesture_tracker, with_gesture);
210210
}
211211
}
212212

src/ShellClients/ShellWindow.vala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public class Gala.ShellWindow : PositionedWindow {
2828
actor = (Meta.WindowActor) window.get_compositor_private ();
2929
}
3030

31-
public void add_state (State state, GestureTracker gesture_tracker) {
32-
animate (current_state | state, gesture_tracker);
31+
public void add_state (State state, GestureTracker gesture_tracker, bool with_gesture) {
32+
animate (current_state | state, gesture_tracker, with_gesture);
3333
}
3434

35-
public void remove_state (State state, GestureTracker gesture_tracker) {
36-
animate (current_state & ~state, gesture_tracker);
35+
public void remove_state (State state, GestureTracker gesture_tracker, bool with_gesture) {
36+
animate (current_state & ~state, gesture_tracker, with_gesture);
3737
}
3838

39-
private void animate (State new_state, GestureTracker gesture_tracker) {
39+
private void animate (State new_state, GestureTracker gesture_tracker, bool with_gesture) {
4040
if (new_state == current_state || gesture_ongoing) {
4141
return;
4242
}
@@ -51,9 +51,9 @@ public class Gala.ShellWindow : PositionedWindow {
5151

5252
new GesturePropertyTransition (
5353
actor, gesture_tracker, get_animation_property (), null, calculate_value ((new_state & HIDING_STATES) != 0)
54-
).start (true, () => InternalUtils.update_transients_visible (window, (current_state & HIDING_STATES) == 0));
54+
).start (with_gesture, () => InternalUtils.update_transients_visible (window, (current_state & HIDING_STATES) == 0));
5555

56-
gesture_tracker.add_success_callback (false, (percentage, completions) => {
56+
gesture_tracker.add_end_callback (with_gesture, (percentage, completions) => {
5757
if (completions != 0) {
5858
current_state = new_state;
5959
}

src/Widgets/MultitaskingView.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,9 @@ namespace Gala {
671671
}
672672

673673
if (opening) {
674-
ShellClientsManager.get_instance ().add_state (MULTITASKING_VIEW, multitasking_gesture_tracker);
674+
ShellClientsManager.get_instance ().add_state (MULTITASKING_VIEW, multitasking_gesture_tracker, with_gesture);
675675
} else {
676-
ShellClientsManager.get_instance ().remove_state (MULTITASKING_VIEW, multitasking_gesture_tracker);
676+
ShellClientsManager.get_instance ().remove_state (MULTITASKING_VIEW, multitasking_gesture_tracker, with_gesture);
677677
}
678678

679679
GestureTracker.OnEnd on_animation_end = (percentage, completions) => {

0 commit comments

Comments
 (0)