Post Error :
On Global :
auto bind = priv->getBind(wlResource); bind->postError(XDG_WM_BASE_ERROR_DEFUNCT_SURFACES, "xdg_wm_base destroyed before surfaces");
On Ressource :
postError(XDG_WM_BASE_ERROR_DEFUNCT_SURFACES, "xdg_wm_base destroyed before surfaces");
Get mostly used data :
Get the parent of private :
auto parent = handle();
Get Data from wlRessource :
when wlRessource is in the same class but in static :
auto priv = fromResource(wlResource)
when wlRessource is another class :
auto surface = Wayland::Resource<Surface>::fromResource(wlSurface)
Compile with sanityser
Place in the root CMakeFile :
Debug a Warning from the program :
If a Warning appears but doesn't stop the execution you can set QT_FATAL_WARNINGS to 1 to Fail on warning. In a bug in the signal, it is very useful.
Simply do: export QT_FATAL_WARNINGS=1 and lunch the program.
Debug an error with gdb:
GDB can help you to debug crash in your code. the basic utilization command is : dbus-run-session gdb --ex r --args build/bin/testIdle
When the error appears, you can check the backtrace with "bt" and if you want all variable type "bt -full"
Debug Signal emitted inside Wayland:
If you listen to some signal that is never sent, you can show all signals emitted in Wayland by set env var
WAYLAND_DEBUG=1 to see what's actually sent over the Wayland connection.