fix(linux/wlgrab): add frame_timestamp using wayland's ready timestamp#4787
fix(linux/wlgrab): add frame_timestamp using wayland's ready timestamp#4787andygrundman wants to merge 1 commit intoLizardByte:masterfrom
Conversation
|
cc @psyke83 Have you ever used the wlgrab backend? |
|
|
|
||
| if (!display_name) { | ||
| BOOST_LOG(error) << "Environment variable WAYLAND_DISPLAY has not been defined"sv; | ||
| BOOST_LOG(error) << "[wayland] Environment variable WAYLAND_DISPLAY has not been defined"sv; |
There was a problem hiding this comment.
I like this pattern. It would be nice if we could automatically include the source file and line number from where a log message was initiated. I don't know how hard it would be to implement in Sunshine, but I did something similar in our python discord bot recently.
2026-02-27 23:14:42 - src.common.database - [database.py:321] - INFO - Committed changes to git data repository
2026-02-27 23:14:43 - src.common.database - [database.py:329] - INFO - Pushed changes to remote git data repository
2026-02-27 23:18:58 - src.common.webapp - [webapp.py:297] - INFO - received webhook from github_status
2026-02-27 23:18:58 - src.common.webapp - [webapp.py:299] - INFO - received webhook data:
In any event, it would be nice to have the capture method as a prefix for all the capture methods, whether on Linux, Windows, or macOS (even though there's only one on macOS right now).




Description
This PR adds frame_timestamp to the wlgrab backend, used with headless Wayland. The timestamp comes from Wayland's ready callback, which I think is the best place to take it from. I also added framerateX100 support since it's very simple.
I also wanted to make the logs a bit easier to understand across all the various Wayland code, so I added prefixes to all the logging. I also removed a couple logs from very hot callbacks.
I'll submit a future PR for wlgrab to ignore duplicate frames for variable fps.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage