Skip to content

Commit

Permalink
Gestures: Add has_started that takes over responsibility for the orig…
Browse files Browse the repository at this point in the history
…inal function of recognizing
  • Loading branch information
leolost2605 committed Jan 15, 2025
1 parent b0cb89e commit bc0e9ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Gestures/GestureTracker.vala
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public class Gala.GestureTracker : Object {

public bool recognizing { get; private set; }

public bool has_started { get; private set; default = false;}

/**
* Emitted when a new gesture is detected.
* This should only be used to determine whether the gesture should be handled. This shouldn't
Expand Down Expand Up @@ -262,6 +264,7 @@ public class Gala.GestureTracker : Object {
on_begin (percentage);
}

has_started = true;
previous_percentage = percentage;
previous_time = elapsed_time;
}
Expand Down Expand Up @@ -299,6 +302,7 @@ public class Gala.GestureTracker : Object {
}

recognizing = false;
has_started = false;

if (enabled) {
on_end (end_percentage, completions, calculated_duration);
Expand Down
4 changes: 2 additions & 2 deletions src/ShellClients/PanelClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Gala.PanelClone : Object {
}

private void hide () {
if (panel_hidden || default_gesture_tracker.recognizing) {
if (panel_hidden || default_gesture_tracker.has_started) {
return;
}

Expand All @@ -95,7 +95,7 @@ public class Gala.PanelClone : Object {
}

private void show () {
if (!panel_hidden || default_gesture_tracker.recognizing) {
if (!panel_hidden || default_gesture_tracker.has_started) {
return;
}

Expand Down

0 comments on commit bc0e9ec

Please sign in to comment.