summaryrefslogtreecommitdiff
path: root/src/gestures-drag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gestures-drag.c')
-rw-r--r--src/gestures-drag.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gestures-drag.c b/src/gestures-drag.c
index b894bda..253bc9d 100644
--- a/src/gestures-drag.c
+++ b/src/gestures-drag.c
@@ -82,3 +82,44 @@ int gru_drag(struct grail *ge,
82 return 1; 82 return 1;
83} 83}
84 84
85int gru_windrag(struct grail *ge,
86 const struct touch_frame *frame)
87{
88 struct gesture_recognizer *gru = ge->gru;
89 struct combo_model *state = &gru->windrag;
90 struct move_model *move = &gru->move;
91 int mask = state->active ? (move->active & fm_mask) : fm_mask;
92 if (!move->multi && !move->single) {
93 if (state->active && out_of_bounds(state, move)) {
94 gru_end(ge, state->gid, move,
95 state->prop, state->nprop);
96 state->active = 0;
97 }
98 return 0;
99 }
100 if (!(move->tickle & mask))
101 return 0;
102 if (!state->active) {
103 if (move->ntouch == 4) {
104 state->gid = gin_gid_begin(ge, GRAIL_TYPE_MDRAG,
105 PRIO_META, frame);
106 state->mintouch = 1;
107 state->maxtouch = 4;
108 state->active = 1;
109 } else if (move->ntouch == 3) {
110 state->gid = gin_gid_begin(ge, GRAIL_TYPE_EDRAG,
111 PRIO_ENV, frame);
112 state->mintouch = 1;
113 state->maxtouch = 3;
114 state->active = 1;
115 } else {
116 return 0;
117 }
118 }
119 if (!move->single && !(move->active & fm_mask))
120 return 0;
121 set_props(state, move);
122 gru_event(ge, state->gid, move, state->prop, state->nprop);
123 return 1;
124}
125