@@ -50,23 +50,23 @@ void Cursor::process_resize(const uint32_t time) const {
50
50
int32_t new_top = seat.server .grab_geobox .y ;
51
51
int32_t new_bottom = seat.server .grab_geobox .y + seat.server .grab_geobox .height ;
52
52
53
- if (seat.server .resize_edges & WLR_EDGE_TOP) {
53
+ if (( seat.server .resize_edges & WLR_EDGE_TOP) != 0 ) {
54
54
new_top = static_cast <int32_t >(std::round (border_y));
55
55
if (new_top >= new_bottom) {
56
56
new_top = new_bottom - 1 ;
57
57
}
58
- } else if (seat.server .resize_edges & WLR_EDGE_BOTTOM) {
58
+ } else if (( seat.server .resize_edges & WLR_EDGE_BOTTOM) != 0 ) {
59
59
new_bottom = static_cast <int32_t >(std::round (border_y));
60
60
if (new_bottom <= new_top) {
61
61
new_bottom = new_top + 1 ;
62
62
}
63
63
}
64
- if (seat.server .resize_edges & WLR_EDGE_LEFT) {
64
+ if (( seat.server .resize_edges & WLR_EDGE_LEFT) != 0 ) {
65
65
new_left = static_cast <int32_t >(std::round (border_x));
66
66
if (new_left >= new_right) {
67
67
new_left = new_right - 1 ;
68
68
}
69
- } else if (seat.server .resize_edges & WLR_EDGE_RIGHT) {
69
+ } else if (( seat.server .resize_edges & WLR_EDGE_RIGHT) != 0 ) {
70
70
new_right = static_cast <int32_t >(std::round (border_x));
71
71
if (new_right <= new_left) {
72
72
new_right = new_left + 1 ;
@@ -106,8 +106,10 @@ void Cursor::process_move(const uint32_t time) {
106
106
/* This event is forwarded by the cursor when a pointer emits an axis event,
107
107
* for example when you move the scroll wheel. */
108
108
static void cursor_axis_notify (wl_listener* listener, void * data) {
109
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.axis(listener=%p, data=%p)" , (void *) listener, data);
110
+
109
111
if (data == nullptr ) {
110
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.cursor_axis " );
112
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.axis " );
111
113
return ;
112
114
}
113
115
@@ -123,7 +125,7 @@ static void cursor_axis_notify(wl_listener* listener, void* data) {
123
125
* event. Frame events are sent after regular pointer events to group
124
126
* multiple events together. For instance, two axis events may happen at the
125
127
* same time, in which case a frame event won't be sent in between. */
126
- static void cursor_frame_notify (wl_listener* listener, void *) {
128
+ static void cursor_frame_notify (wl_listener* listener, [[maybe_unused]] void * data ) {
127
129
Cursor& cursor = magpie_container_of (listener, cursor, frame);
128
130
129
131
/* Notify the client with pointer focus of the frame event. */
@@ -145,7 +147,8 @@ static void cursor_motion_absolute_notify(wl_listener* listener, void* data) {
145
147
Cursor& cursor = magpie_container_of (listener, cursor, motion_absolute);
146
148
const auto * event = static_cast <wlr_pointer_motion_absolute_event*>(data);
147
149
148
- double lx, ly;
150
+ double lx;
151
+ double ly;
149
152
wlr_cursor_absolute_to_layout_coords (&cursor.wlr , &event->pointer ->base , event->x , event->y , &lx, &ly);
150
153
151
154
double dx = lx - cursor.wlr .x ;
@@ -165,6 +168,8 @@ static void cursor_motion_absolute_notify(wl_listener* listener, void* data) {
165
168
166
169
/* This event is forwarded by the cursor when a pointer emits a button event. */
167
170
static void cursor_button_notify (wl_listener* listener, void * data) {
171
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.button(listener=%p, data=%p)" , (void *) listener, data);
172
+
168
173
if (data == nullptr ) {
169
174
wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.button" );
170
175
return ;
@@ -177,7 +182,8 @@ static void cursor_button_notify(wl_listener* listener, void* data) {
177
182
178
183
/* Notify the client with pointer focus that a button press has occurred */
179
184
wlr_seat_pointer_notify_button (server.seat ->wlr , event->time_msec , event->button , event->state );
180
- double sx, sy;
185
+ double sx;
186
+ double sy;
181
187
182
188
wlr_surface* surface = nullptr ;
183
189
auto magpie_surface = server.surface_at (cursor.wlr .x , cursor.wlr .y , &surface, &sx, &sy).lock ();
@@ -189,7 +195,7 @@ static void cursor_button_notify(wl_listener* listener, void* data) {
189
195
}
190
196
} else if (magpie_surface != nullptr && magpie_surface->is_view ()) {
191
197
/* Focus that client if the button was _pressed_ */
192
- server.focus_view (std::dynamic_pointer_cast<View>(magpie_surface), surface );
198
+ server.focus_view (std::dynamic_pointer_cast<View>(magpie_surface));
193
199
} else {
194
200
server.focus_view (nullptr );
195
201
}
@@ -222,8 +228,10 @@ static void cursor_motion_notify(wl_listener* listener, void* data) {
222
228
}
223
229
224
230
static void gesture_pinch_begin_notify (wl_listener* listener, void * data) {
231
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_pinch_begin(listener=%p, data=%p)" , (void *) listener, data);
232
+
225
233
if (data == nullptr ) {
226
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.pinch_begin " );
234
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_pinch_begin " );
227
235
return ;
228
236
}
229
237
@@ -235,7 +243,7 @@ static void gesture_pinch_begin_notify(wl_listener* listener, void* data) {
235
243
236
244
static void gesture_pinch_update_notify (wl_listener* listener, void * data) {
237
245
if (data == nullptr ) {
238
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.pinch_update " );
246
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_pinch_update " );
239
247
return ;
240
248
}
241
249
@@ -247,8 +255,10 @@ static void gesture_pinch_update_notify(wl_listener* listener, void* data) {
247
255
}
248
256
249
257
static void gesture_pinch_end_notify (wl_listener* listener, void * data) {
258
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_pinch_end(listener=%p, data=%p)" , (void *) listener, data);
259
+
250
260
if (data == nullptr ) {
251
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.pinch_end " );
261
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_pinch_end " );
252
262
return ;
253
263
}
254
264
@@ -259,8 +269,10 @@ static void gesture_pinch_end_notify(wl_listener* listener, void* data) {
259
269
}
260
270
261
271
static void gesture_swipe_begin_notify (wl_listener* listener, void * data) {
272
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_swipe_begin(listener=%p, data=%p)" , (void *) listener, data);
273
+
262
274
if (data == nullptr ) {
263
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.swipe_begin " );
275
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_swipe_begin " );
264
276
return ;
265
277
}
266
278
@@ -272,7 +284,7 @@ static void gesture_swipe_begin_notify(wl_listener* listener, void* data) {
272
284
273
285
static void gesture_swipe_update_notify (wl_listener* listener, void * data) {
274
286
if (data == nullptr ) {
275
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.swipe_update " );
287
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_swipe_update " );
276
288
return ;
277
289
}
278
290
@@ -283,8 +295,10 @@ static void gesture_swipe_update_notify(wl_listener* listener, void* data) {
283
295
}
284
296
285
297
static void gesture_swipe_end_notify (wl_listener* listener, void * data) {
298
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_swipe_end(listener=%p, data=%p)" , (void *) listener, data);
299
+
286
300
if (data == nullptr ) {
287
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.swipe_end " );
301
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_swipe_end " );
288
302
return ;
289
303
}
290
304
@@ -295,8 +309,10 @@ static void gesture_swipe_end_notify(wl_listener* listener, void* data) {
295
309
}
296
310
297
311
static void gesture_hold_begin_notify (wl_listener* listener, void * data) {
312
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_hold_begin(listener=%p, data=%p)" , (void *) listener, data);
313
+
298
314
if (data == nullptr ) {
299
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.hold_begin " );
315
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_hold_begin " );
300
316
return ;
301
317
}
302
318
@@ -307,8 +323,10 @@ static void gesture_hold_begin_notify(wl_listener* listener, void* data) {
307
323
}
308
324
309
325
static void gesture_hold_end_notify (wl_listener* listener, void * data) {
326
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.gesture_hold_end(listener=%p, data=%p)" , (void *) listener, data);
327
+
310
328
if (data == nullptr ) {
311
- wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.hold_end " );
329
+ wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.gesture_hold_end " );
312
330
return ;
313
331
}
314
332
@@ -319,6 +337,8 @@ static void gesture_hold_end_notify(wl_listener* listener, void* data) {
319
337
}
320
338
321
339
static void request_set_shape_notify (wl_listener* listener, void * data) {
340
+ wlr_log (WLR_DEBUG, " wlr_cursor.events.set_shape(listener=%p, data=%p)" , (void *) listener, data);
341
+
322
342
if (data == nullptr ) {
323
343
wlr_log (WLR_ERROR, " No data passed to wlr_cursor.events.set_shape" );
324
344
return ;
@@ -412,7 +432,8 @@ void Cursor::process_motion(const uint32_t time) {
412
432
}
413
433
414
434
/* Otherwise, find the view under the pointer and send the event along. */
415
- double sx, sy;
435
+ double sx;
436
+ double sy;
416
437
wlr_surface* surface = nullptr ;
417
438
auto magpie_surface = seat.server .surface_at (wlr.x , wlr.y , &surface, &sx, &sy).lock ();
418
439
if (magpie_surface == nullptr ) {
@@ -464,7 +485,7 @@ void Cursor::warp_to_constraint(const PointerConstraint& constraint) const {
464
485
return ;
465
486
}
466
487
467
- if (constraint.wlr .current .committed & WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT) {
488
+ if (( constraint.wlr .current .committed & WLR_POINTER_CONSTRAINT_V1_STATE_CURSOR_HINT) != 0 ) {
468
489
const double x = constraint.wlr .current .cursor_hint .x ;
469
490
const double y = constraint.wlr .current .cursor_hint .y ;
470
491
0 commit comments