DisplayServer (Linux): wait for delayed Wayland output events#2451
DisplayServer (Linux): wait for delayed Wayland output events#2451Suze021 wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 9 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
4a10e01 to
7434c83
Compare
7434c83 to
3a46e47
Compare
|
|
||
| const char* ffWaylandWaitForDone(WaylandDisplay* display) { | ||
| WaylandData* wldata = display->parent; | ||
| double deadline = ffTimeGetTick() + instance.config.general.processingTimeout; |
There was a problem hiding this comment.
processingTimeout is a signed integer. -1 means it should block infinitely, which should be handled independently.
In addition, ffTimeGetTick() returns integer too. Not sure why you use double here
| if (wldata->ffwl_display_roundtrip(wldata->display) < 0) { | ||
| return "Failed to roundtrip Wayland output information"; | ||
| } | ||
| if (!display->done) { | ||
| ffTimeSleep(1); | ||
| } |
There was a problem hiding this comment.
This both wastes time (keep posting sync events) and adds latency.
I'd use wl_display_dispatch_timeout here, which blocks until receiving an event. The problem is that wl_display_dispatch_timeout is relatively new. However, as users who stuck at an old distro, they may not care about using the newest fastfetch either, so it won't be a serious problem.
|
Posted a fix. Please test! There are other places missing WaitForDone. Not sure if I need to fix them. |
Summary
Wait for Wayland output completion events when a compositor delivers the final output state after the first roundtrip callback. This prevents an output proxy from being destroyed before its delayed mode data arrives.
Related issue (required for new logos for new distros)
Fixes #2074
Changes
doneevents for bothwl_outputandkde_output_device_v2.processingTimeoutand avoid a busy loop.Screenshots
Not applicable; this changes display detection only.
Testing
wl_outputand KDEkde_output_device_v2paths.Checklist