-
-
Notifications
You must be signed in to change notification settings - Fork 841
DisplayServer (Linux): wait for delayed Wayland output events #2451
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| #include <sys/socket.h> | ||
|
|
||
| #include "common/properties.h" | ||
| #include "common/time.h" | ||
|
|
||
| #include "wayland.h" | ||
| #include "kde-output-device-v2-client-protocol.h" | ||
|
|
@@ -217,6 +218,26 @@ uint32_t ffWaylandHandleRotation(WaylandDisplay* display) { | |
| return rotation; | ||
| } | ||
|
|
||
| const char* ffWaylandWaitForDone(WaylandDisplay* display) { | ||
| WaylandData* wldata = display->parent; | ||
| double deadline = ffTimeGetTick() + instance.config.general.processingTimeout; | ||
|
|
||
| // Some compositors emit the final output state asynchronously after the roundtrip callback (#2074) | ||
| while (!display->done) { | ||
| if (ffTimeGetTick() >= deadline) { | ||
| return "Timeout waiting for Wayland output information"; | ||
| } | ||
| if (wldata->ffwl_display_roundtrip(wldata->display) < 0) { | ||
| return "Failed to roundtrip Wayland output information"; | ||
| } | ||
| if (!display->done) { | ||
| ffTimeSleep(1); | ||
| } | ||
|
Comment on lines
+230
to
+235
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This both wastes time (keep posting I'd use |
||
| } | ||
|
|
||
| return nullptr; | ||
| } | ||
|
|
||
| const char* ffdsConnectWayland(FFDisplayServerResult* result) { | ||
| if (getenv("XDG_RUNTIME_DIR") == nullptr) { | ||
| return "Wayland requires $XDG_RUNTIME_DIR being set"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processingTimeout is a signed integer.
-1means it should block infinitely, which should be handled independently.In addition, ffTimeGetTick() returns integer too. Not sure why you use
doublehere