-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not deal with multiple connections when parsing libwayland's WAYLAND_DEBUG=1
output
#5
Comments
Hi @wmww First, thanks for this nice tool! I'd appreciate your feedback. |
That will only work with a patched libwayland. Are you using a libwayland with the patches? The normal way to do that is use the wayland-debug snap and The way you implemented it isn't quite what I would want to upstream. As noted in #56 we already sort of have this feature, but it's implemented in the wrong place. You could work on that if you want, or just use your patch if it works for you. I should fix #56 at some point. |
@nickdiego never mind I fixed it. A simple |
Yes, but in my case I patch directly chromium's in-tree libwayland fork. I'm considering even to propose to merge those patches there. Unless you're planning to try to upstream them in the near future, is that the case?
Yup, I've tried that out, though (before your today's patches) it used to follow the most recent connection. Is that correct? or was the
Cooool! :) Thanks for doing that. I'll for sure test that asap and report back here. Thanks a lot! |
Yay! Just checked and it works really well! And it doesn't seem to have broken anything else (haven't tested so much though). Thanks again! |
Fantastic. Yeah previously there was always one "current" connection, which you could manually switch but this was only really practical in GDB mode. Now it shows messages from all connections unless one is explicitly selected. |
Currently there is no possible solution to this problem (workarounds below). I'm creating this issue as an explanation.
Background
Any Wayland client or server built with libwayland produces Wayland messages on stderr when run with the environment variable
WAYLAND_DEBUG=1
set. The produced output is similar to wayland-debug's unfiltered output, but uglier and with less context. There is one critical missing piece: there is no info about which connection a message is on.wayland-debug fails when parsing
WAYLAND_DEBUG=1
output with multiple connections. I will not put effort into making it continue to syntax highlight in this case, as most of it's other features would still be impossible. Instead, you can try...Workarounds
GDB mode
If you can run as a GDB extension (
./main.py -g some_wayland_compositor
), this problem goes away. GDB mode is great, and has extra features (breakpoints on Wayland messages!), but you need libwayland debug symbols installed and it can be slow in some cases.Run wayland-debug on the client you care about
Clients generally only make a single Wayland connection, so using the
WAYLAND_DEBUG=1
output from a client instead of a compositor might fix the problem.Only spew client or server messages
Instead of
WAYLAND_DEBUG=1
, you can also run a libwayland app withWAYLAND_DEBUG=client
orWAYLAND_DEBUG=server
. This will only show messages from that type of connection. This usually won't work, as the most common problem is when a compositor has multiple client connections. Even if you are only running one client, wallpaper and panels may use Wayland internally.The text was updated successfully, but these errors were encountered: