wayland::read_intent(3)
πΈ wayland::read_intent(3) πΈ
okay so bestie, welcome to the Wayland++ manual π this page is wayland::read_intent(3), and it's all about being a responsible little read-intent icon. no cap.
β¨ NAME β¨
wayland::read_intent β Represents an intention to read from the display file descriptor. literally the whole vibe.
β¨ SYNOPSIS β¨
#include <wayland-client.hpp>
π«Ά Public Member Functions π«Ά
bool is_finalized () constβ Check whether this intent was already finalized withcancelorread.void cancel ()β Cancel read intent.void read ()β Read events from display file descriptor.
π Detailed Description π
okay so picture this: wayland::read_intent represents an intention to read from the display file descriptor. that's the main character job.
When you're not using the convenience method display_t::dispatch that takes care of this automatically, threads that want to read events from a Wayland display file descriptor have to announce their intention to do so beforehand β in the C API, this is done using wl_display_prepare_read. Then that intention must be resolved either by actually invoking a read from the file descriptor or by cancelling. no ghosting the intent, periodt.
This is an RAII class, and it's giving responsible-friend energy: when it goes out of scope, the intent is cancelled automatically if it was not finalized by manually cancelling or reading before. Otherwise, it would be easy to forget resolving the intent, e.g. when handling errors, potentially leading to a deadlock. and a deadlock is absolutely not the vibe ππ.
Read intents can only be created by a display_t with display_t::obtain_read_intent and display_t::obtain_queue_read_intent. that's the guest list, iykyk π
.
π¨ Undefined behavior alert: Undefined behavior occurs when the associateddisplay_torevent_queue_tis destroyed when aread_intenthas not been finalized yet. do not do this, fr fr π.
Definition at line 372 of file wayland-client.hpp.
π Member Function Documentation π
π§ void wayland::read_intent::cancel () π§
Cancel read intent. An exception is thrown when the read intent was already finalized. so don't try to double-cancel and expect a chill response, bestie π.
π¦ bool wayland::read_intent::is_finalized () const π¦
Check whether this intent was already finalized with cancel or read. simple little vibe check β¨.
π₯ void wayland::read_intent::read () π₯
Read events from display file descriptor. This will read events from the file descriptor for the display. This function does not dispatch events, it only reads and queues events into their corresponding event queues. If no data avilable on the file descriptor, read() returns immediately. To dispatch events that may have been queued, call display_t::dispatch_pending or display_t::dispatch_queue_pending.
An exception is thrown when the read intent was already finalized. Each read intent can only be used for reading once. A new one must be obtained for any further read requests. one read per read intent, that's the rule π«Ά.
π Author π
Generated automatically by Doxygen for Wayland++ from the source code. slay, Doxygen π.
okay that's the page, bestie π«Ά β it's Version 1.0.1, dated Fri Mar 27 2026 13:15:00, and the manual page is wayland::read_intent(3). bye, love you, don't forget to finalize your read intent πβ¨
π¦ where this page comes from
- ubuntu stonking: waylandpp-dev 1.0.1-2 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms