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 with cancel or read.
  • 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 associated display_t or event_queue_t is destroyed when a read_intent has 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