Skip to content

Commit 03cef50

Browse files
committed
Add log traces to almost all event listeners
1 parent 0d737ae commit 03cef50

File tree

12 files changed

+158
-12
lines changed

12 files changed

+158
-12
lines changed

src/foreign_toplevel.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "wlr-wrap-end.hpp"
1010

1111
static void foreign_toplevel_handle_request_maximize_notify(wl_listener* listener, void* data) {
12+
wlr_log(WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.request_maximize(listener=%p, data=%p)", (void*) listener, data);
13+
1214
if (data == nullptr) {
1315
wlr_log(WLR_ERROR, "No data passed to wlr_foreign_toplevel_handle_v1.events.request_maximize");
1416
return;
@@ -22,6 +24,9 @@ static void foreign_toplevel_handle_request_maximize_notify(wl_listener* listene
2224
}
2325

2426
static void foreign_toplevel_handle_request_fullscreen_notify(wl_listener* listener, void* data) {
27+
wlr_log(
28+
WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.request_fullscreen(listener=%p, data=%p)", (void*) listener, data);
29+
2530
if (data == nullptr) {
2631
wlr_log(WLR_ERROR, "No data passed to wlr_foreign_toplevel_handle_v1.events.request_fullscreen");
2732
return;
@@ -35,6 +40,8 @@ static void foreign_toplevel_handle_request_fullscreen_notify(wl_listener* liste
3540
}
3641

3742
static void foreign_toplevel_handle_request_minimize_notify(wl_listener* listener, void* data) {
43+
wlr_log(WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.request_minimize(listener=%p, data=%p)", (void*) listener, data);
44+
3845
if (data == nullptr) {
3946
wlr_log(WLR_ERROR, "No data passed to wlr_foreign_toplevel_handle_v1.events.request_minimize");
4047
return;
@@ -47,19 +54,25 @@ static void foreign_toplevel_handle_request_minimize_notify(wl_listener* listene
4754
}
4855

4956
static void foreign_toplevel_handle_request_activate_notify(wl_listener* listener, [[maybe_unused]] void* data) {
57+
wlr_log(WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.request_activate(listener=%p, data=%p)", (void*) listener, data);
58+
5059
const ForeignToplevelHandle& handle = magpie_container_of(listener, handle, request_activate);
5160

5261
handle.view.set_minimized(false);
5362
handle.view.get_server().focus_view(std::dynamic_pointer_cast<View>(handle.view.shared_from_this()));
5463
}
5564

5665
static void foreign_toplevel_handle_request_close_notify(wl_listener* listener, [[maybe_unused]] void* data) {
66+
wlr_log(WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.request_close(listener=%p, data=%p)", (void*) listener, data);
67+
5768
const ForeignToplevelHandle& handle = magpie_container_of(listener, handle, request_close);
5869

5970
handle.view.close();
6071
}
6172

6273
static void foreign_toplevel_handle_set_rectangle_notify(wl_listener* listener, void* data) {
74+
wlr_log(WLR_DEBUG, "wlr_foreign_toplevel_handle_v1.events.set_rectangle(listener=%p, data=%p)", (void*) listener, data);
75+
6376
if (data == nullptr) {
6477
wlr_log(WLR_ERROR, "No data passed to wlr_foreign_toplevel_handle_v1.events.set_rectangle");
6578
return;

src/input/constraint.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77

88
#include "wlr-wrap-start.hpp"
99
#include <wlr/types/wlr_compositor.h>
10+
#include <wlr/util/log.h>
1011
#include "wlr-wrap-end.hpp"
1112

1213
static void constraint_destroy_notify(wl_listener* listener, [[maybe_unused]] void* data) {
14+
wlr_log(WLR_DEBUG, "wlr_pointer_constraint_v1.events.destroy(listener=%p, data=%p)", (void*) listener, data);
15+
1316
PointerConstraint& constraint = magpie_container_of(listener, constraint, destroy);
1417

1518
auto& current_constraint = constraint.seat.current_constraint;

src/input/cursor.cpp

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ void Cursor::process_move(const uint32_t time) {
106106
/* This event is forwarded by the cursor when a pointer emits an axis event,
107107
* for example when you move the scroll wheel. */
108108
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+
109111
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");
111113
return;
112114
}
113115

@@ -166,6 +168,8 @@ static void cursor_motion_absolute_notify(wl_listener* listener, void* data) {
166168

167169
/* This event is forwarded by the cursor when a pointer emits a button event. */
168170
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+
169173
if (data == nullptr) {
170174
wlr_log(WLR_ERROR, "No data passed to wlr_cursor.events.button");
171175
return;
@@ -224,8 +228,10 @@ static void cursor_motion_notify(wl_listener* listener, void* data) {
224228
}
225229

226230
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+
227233
if (data == nullptr) {
228-
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");
229235
return;
230236
}
231237

@@ -237,7 +243,7 @@ static void gesture_pinch_begin_notify(wl_listener* listener, void* data) {
237243

238244
static void gesture_pinch_update_notify(wl_listener* listener, void* data) {
239245
if (data == nullptr) {
240-
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");
241247
return;
242248
}
243249

@@ -249,8 +255,10 @@ static void gesture_pinch_update_notify(wl_listener* listener, void* data) {
249255
}
250256

251257
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+
252260
if (data == nullptr) {
253-
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");
254262
return;
255263
}
256264

@@ -261,8 +269,10 @@ static void gesture_pinch_end_notify(wl_listener* listener, void* data) {
261269
}
262270

263271
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+
264274
if (data == nullptr) {
265-
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");
266276
return;
267277
}
268278

@@ -274,7 +284,7 @@ static void gesture_swipe_begin_notify(wl_listener* listener, void* data) {
274284

275285
static void gesture_swipe_update_notify(wl_listener* listener, void* data) {
276286
if (data == nullptr) {
277-
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");
278288
return;
279289
}
280290

@@ -285,8 +295,10 @@ static void gesture_swipe_update_notify(wl_listener* listener, void* data) {
285295
}
286296

287297
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+
288300
if (data == nullptr) {
289-
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");
290302
return;
291303
}
292304

@@ -297,8 +309,10 @@ static void gesture_swipe_end_notify(wl_listener* listener, void* data) {
297309
}
298310

299311
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+
300314
if (data == nullptr) {
301-
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");
302316
return;
303317
}
304318

@@ -309,8 +323,10 @@ static void gesture_hold_begin_notify(wl_listener* listener, void* data) {
309323
}
310324

311325
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+
312328
if (data == nullptr) {
313-
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");
314330
return;
315331
}
316332

@@ -321,6 +337,8 @@ static void gesture_hold_end_notify(wl_listener* listener, void* data) {
321337
}
322338

323339
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+
324342
if (data == nullptr) {
325343
wlr_log(WLR_ERROR, "No data passed to wlr_cursor.events.set_shape");
326344
return;

src/input/keyboard.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* the destruction of the wlr_keyboard. It will no longer receive events
2020
* and should be destroyed. */
2121
static void keyboard_handle_destroy(wl_listener* listener, [[maybe_unused]] void* data) {
22+
wlr_log(WLR_DEBUG, "wlr_keyboard.events.destroy(listener=%p, data=%p)", (void*) listener, data);
23+
2224
Keyboard& keyboard = magpie_container_of(listener, keyboard, destroy);
2325

2426
auto& keyboards = keyboard.seat.keyboards;
@@ -51,6 +53,8 @@ static bool handle_compositor_keybinding(const Keyboard& keyboard, const uint32_
5153

5254
/* This event is raised when a key is pressed or released. */
5355
static void keyboard_handle_key(wl_listener* listener, void* data) {
56+
wlr_log(WLR_DEBUG, "wlr_keyboard.events.key(listener=%p, data=%p)", (void*) listener, data);
57+
5458
if (data == nullptr) {
5559
wlr_log(WLR_ERROR, "No data passed to wlr_keyboard.events.key");
5660
return;

src/input/seat.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "wlr-wrap-end.hpp"
2020

2121
static void new_input_notify(wl_listener* listener, void* data) {
22+
wlr_log(WLR_DEBUG, "wlr_seat.events.new_input(listener=%p, data=%p)", (void*) listener, data);
23+
2224
if (data == nullptr) {
2325
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.new_input");
2426
return;
@@ -31,6 +33,8 @@ static void new_input_notify(wl_listener* listener, void* data) {
3133
}
3234

3335
static void new_virtual_pointer_notify(wl_listener* listener, void* data) {
36+
wlr_log(WLR_DEBUG, "wlr_seat.events.new_virtual_pointer(listener=%p, data=%p)", (void*) listener, data);
37+
3438
if (data == nullptr) {
3539
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.new_virtual_pointer");
3640
return;
@@ -43,6 +47,8 @@ static void new_virtual_pointer_notify(wl_listener* listener, void* data) {
4347
}
4448

4549
static void new_virtual_keyboard_notify(wl_listener* listener, void* data) {
50+
wlr_log(WLR_DEBUG, "wlr_seat.events.new_virtual_keyboard(listener=%p, data=%p)", (void*) listener, data);
51+
4652
if (data == nullptr) {
4753
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.new_virtual_keyboard");
4854
return;
@@ -55,6 +61,8 @@ static void new_virtual_keyboard_notify(wl_listener* listener, void* data) {
5561
}
5662

5763
static void new_pointer_constraint_notify(wl_listener* listener, void* data) {
64+
wlr_log(WLR_DEBUG, "wlr_seat.events.new_pointer_constraint(listener=%p, data=%p)", (void*) listener, data);
65+
5866
if (data == nullptr) {
5967
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.new_pointer_constraint");
6068
return;
@@ -71,6 +79,8 @@ static void new_pointer_constraint_notify(wl_listener* listener, void* data) {
7179
}
7280

7381
static void request_cursor_notify(wl_listener* listener, void* data) {
82+
wlr_log(WLR_DEBUG, "wlr_seat.events.request_cursor(listener=%p, data=%p)", (void*) listener, data);
83+
7484
if (data == nullptr) {
7585
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.request_cursor");
7686
return;
@@ -95,6 +105,8 @@ static void request_cursor_notify(wl_listener* listener, void* data) {
95105
* ignore such requests if they so choose, but in magpie we always honor
96106
*/
97107
static void request_set_selection_notify(wl_listener* listener, void* data) {
108+
wlr_log(WLR_DEBUG, "wlr_seat.events.set_selection(listener=%p, data=%p)", (void*) listener, data);
109+
98110
if (data == nullptr) {
99111
wlr_log(WLR_ERROR, "No data passed to wlr_seat.events.request_set_selection");
100112
return;

src/output.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include <wlr/util/log.h>
1313
#include <wlr-wrap-end.hpp>
1414

15-
/* This function is called every time an output is ready to display a frame,
16-
* generally at the output's refresh rate (e.g. 60Hz). */
1715
static void output_request_state_notify(wl_listener* listener, void* data) {
16+
wlr_log(WLR_DEBUG, "wlr_output.events.request_state(listener=%p, data=%p)", (void*) listener, data);
17+
1818
if (data == nullptr) {
1919
wlr_log(WLR_ERROR, "No data passed to wlr_output.events.request_state");
2020
return;
@@ -47,6 +47,8 @@ static void output_frame_notify(wl_listener* listener, [[maybe_unused]] void* da
4747
}
4848

4949
static void output_destroy_notify(wl_listener* listener, [[maybe_unused]] void* data) {
50+
wlr_log(WLR_DEBUG, "wlr_output.events.destroy(listener=%p, data=%p)", (void*) listener, data);
51+
5052
Output& output = magpie_container_of(listener, output, destroy);
5153

5254
for (const auto& layer : output.layers) {

src/server.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ std::weak_ptr<Surface> Server::surface_at(const double lx, const double ly, wlr_
163163
/* This event is raised by the backend when a new output (aka a display or
164164
* monitor) becomes available. */
165165
static void new_output_notify(wl_listener* listener, void* data) {
166+
wlr_log(WLR_DEBUG, "wlr_backend.events.new_output(listener=%p, data=%p)", (void*) listener, data);
167+
166168
if (data == nullptr) {
167169
wlr_log(WLR_ERROR, "No data passed to wlr_backend.events.new_output");
168170
return;
@@ -212,6 +214,8 @@ static void new_output_notify(wl_listener* listener, void* data) {
212214
}
213215

214216
static void output_power_manager_set_mode_notify([[maybe_unused]] wl_listener* listener, void* data) {
217+
wlr_log(WLR_DEBUG, "wlr_output_power_manager.events.set_mode(listener=%p, data=%p)", (void*) listener, data);
218+
215219
if (data == nullptr) {
216220
wlr_log(WLR_ERROR, "No data passed to wlr_output_power_manager.events.set_mode");
217221
return;
@@ -234,6 +238,8 @@ static void output_power_manager_set_mode_notify([[maybe_unused]] wl_listener* l
234238
/* This event is raised when wlr_xdg_shell receives a new xdg surface from a
235239
* client, either a toplevel (application window) or popup. */
236240
static void new_xdg_surface_notify(wl_listener* listener, void* data) {
241+
wlr_log(WLR_DEBUG, "wlr_xdg_shell.events.new_surface(listener=%p, data=%p)", (void*) listener, data);
242+
237243
if (data == nullptr) {
238244
wlr_log(WLR_ERROR, "No data passed to wlr_xdg_shell.events.new_surface");
239245
return;
@@ -251,6 +257,8 @@ static void new_xdg_surface_notify(wl_listener* listener, void* data) {
251257
}
252258

253259
static void new_layer_surface_notify(wl_listener* listener, void* data) {
260+
wlr_log(WLR_DEBUG, "wlr_layer_shell_v1.events.new_surface(listener=%p, data=%p)", (void*) listener, data);
261+
254262
if (data == nullptr) {
255263
wlr_log(WLR_ERROR, "No data passed to wlr_layer_shell_v1.events.new_surface");
256264
return;
@@ -272,6 +280,8 @@ static void new_layer_surface_notify(wl_listener* listener, void* data) {
272280
}
273281

274282
static void request_activation_notify(wl_listener* listener, void* data) {
283+
wlr_log(WLR_DEBUG, "wlr_xdg_activation_v1.events.request_activation(listener=%p, data=%p)", (void*) listener, data);
284+
275285
if (data == nullptr) {
276286
wlr_log(WLR_ERROR, "No data passed to wlr_xdg_activation_v1.events.request_activation");
277287
return;
@@ -311,6 +321,8 @@ static void request_activation_notify(wl_listener* listener, void* data) {
311321
}
312322

313323
static void drm_lease_request_notify(wl_listener* listener, void* data) {
324+
wlr_log(WLR_DEBUG, "wlr_drm_lease_manager_v1.events.drm_lease_request(listener=%p, data=%p)", (void*) listener, data);
325+
314326
if (data == nullptr) {
315327
wlr_log(WLR_ERROR, "No data passed to wlr_drm_lease_manager_v1.events.drm_lease_request");
316328
return;
@@ -339,6 +351,8 @@ static void drm_lease_request_notify(wl_listener* listener, void* data) {
339351
}
340352

341353
void output_layout_change_notify(wl_listener* listener, [[maybe_unused]] void* data) {
354+
wlr_log(WLR_DEBUG, "wlr_output_manager.events.change(listener=%p, data=%p)", (void*) listener, data);
355+
342356
Server& server = magpie_container_of(listener, server, output_layout_change);
343357

344358
if (server.num_pending_output_layout_changes > 0) {
@@ -362,6 +376,8 @@ void output_layout_change_notify(wl_listener* listener, [[maybe_unused]] void* d
362376
}
363377

364378
void output_manager_apply_notify(wl_listener* listener, void* data) {
379+
wlr_log(WLR_DEBUG, "wlr_output_manager_v1.events.apply(listener=%p, data=%p)", (void*) listener, data);
380+
365381
if (data == nullptr) {
366382
wlr_log(WLR_ERROR, "No data passed to wlr_output_manager_v1.events.apply");
367383
return;

0 commit comments

Comments
 (0)