File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ public class Gala.HotCorner : Object {
3434 public const string POSITION_BOTTOM_RIGHT = " hotcorner-bottomright" ;
3535 private const int BARRIER_SIZE = 30 ;
3636
37+ /**
38+ * In order to avoid accidental triggers, don't trigger the hot corner until
39+ * this threshold is reached.
40+ */
41+ private const int TRIGGER_PRESSURE_THRESHOLD = 50 ;
42+
3743 /**
3844 * When the mouse pointer pressures the barrier without activating the hot corner,
3945 * release it when this threshold is reached.
@@ -135,14 +141,17 @@ public class Gala.HotCorner : Object {
135141 barrier. pressure_x + = event. dx;
136142 barrier. pressure_y + = event. dy;
137143
138- if (! triggered && vertical_barrier. is_hit && horizontal_barrier. is_hit) {
139- trigger_hot_corner ();
140- }
141-
142144 var pressure = (barrier == vertical_barrier) ?
143145 barrier. pressure_x. abs () :
144146 barrier. pressure_y. abs ();
145147
148+ if (! triggered && vertical_barrier. is_hit && horizontal_barrier. is_hit) {
149+ if (pressure. abs () > TRIGGER_PRESSURE_THRESHOLD ) {
150+ trigger_hot_corner ();
151+ pressure = 0 ;
152+ }
153+ }
154+
146155 if (! triggered && pressure. abs () > RELEASE_PRESSURE_THRESHOLD ) {
147156 barrier. release (event);
148157 }
You can’t perform that action at this time.
0 commit comments