Skip to main content

euv_core/platform/linux/
struct.rs

1use super::*;
2
3/// Cached `libX11.so.6` function pointer table resolved once per process.
4#[derive(Clone, Copy, Debug, Default)]
5pub(crate) struct LinuxX11Syms {
6    /// Handle returned by `dlopen("libX11.so.6")`.
7    pub(crate) lib: usize,
8    /// `XOpenDisplay` symbol address.
9    pub(crate) open_display: usize,
10    /// `XDefaultScreen` symbol address.
11    pub(crate) default_screen: usize,
12    /// `XRootWindow` symbol address.
13    pub(crate) root_window: usize,
14    /// `XCreateSimpleWindow` symbol address.
15    pub(crate) create_simple_window: usize,
16    /// `XStoreName` symbol address.
17    pub(crate) store_name: usize,
18    /// `XMapWindow` symbol address.
19    pub(crate) map_window: usize,
20    /// `XResizeWindow` symbol address.
21    pub(crate) resize_window: usize,
22    /// `XDestroyWindow` symbol address.
23    pub(crate) destroy_window: usize,
24    /// `XFlush` symbol address.
25    pub(crate) flush: usize,
26    /// `XDefaultGC` symbol address.
27    pub(crate) default_gc: usize,
28    /// `XDefaultVisual` symbol address.
29    pub(crate) default_visual: usize,
30    /// `XDefaultDepth` symbol address.
31    pub(crate) default_depth: usize,
32    /// `XCreateImage` symbol address.
33    pub(crate) create_image: usize,
34    /// `XPutImage` symbol address.
35    pub(crate) put_image: usize,
36    /// `XFree` symbol address.
37    pub(crate) free: usize,
38    /// `XSelectInput` symbol address.
39    pub(crate) select_input: usize,
40    /// `XInternAtom` symbol address.
41    pub(crate) intern_atom: usize,
42    /// `XSetWMProtocols` symbol address.
43    pub(crate) set_wm_protocols: usize,
44    /// `XPending` symbol address.
45    pub(crate) pending: usize,
46    /// `XNextEvent` symbol address.
47    pub(crate) next_event: usize,
48    /// `XLookupString` symbol address.
49    pub(crate) lookup_string: usize,
50    /// `XResourceManagerString` symbol address.
51    pub(crate) resource_manager_string: usize,
52}
53
54/// Cached `libXrandr.so.2` function pointer table resolved once per process.
55#[derive(Clone, Copy, Debug, Default)]
56pub(crate) struct LinuxXRandrSyms {
57    /// `XRRGetScreenInfo` symbol address.
58    pub(crate) get_screen_info: usize,
59    /// `XRRConfigCurrentRate` symbol address.
60    pub(crate) config_current_rate: usize,
61    /// `XRRFreeScreenConfigInfo` symbol address.
62    pub(crate) free_screen_config_info: usize,
63}
64
65/// Cached `libXext.so.6` MIT-SHM function pointer table resolved once per process.
66#[derive(Clone, Copy, Debug, Default)]
67pub(crate) struct LinuxXShmSyms {
68    /// `XShmQueryExtension` symbol address.
69    pub(crate) query_extension: usize,
70    /// `XShmCreateImage` symbol address.
71    pub(crate) create_image: usize,
72    /// `XShmAttach` symbol address.
73    pub(crate) attach: usize,
74    /// `XShmDetach` symbol address.
75    pub(crate) detach: usize,
76    /// `XShmPutImage` symbol address.
77    pub(crate) put_image: usize,
78}
79
80/// Cached `libwayland-client.so.0` + Vulkan WSI symbol table resolved once per process.
81#[derive(Clone, Copy, Debug, Default)]
82pub(crate) struct LinuxWaylandSyms {
83    /// Handle returned by `dlopen("libwayland-client.so.0")`.
84    pub(crate) lib: usize,
85    /// `wl_display_connect` symbol address.
86    pub(crate) display_connect: usize,
87    /// `wl_display_disconnect` symbol address.
88    pub(crate) display_disconnect: usize,
89    /// `wl_display_dispatch_pending` symbol address.
90    pub(crate) display_dispatch_pending: usize,
91    /// `wl_display_dispatch` symbol address.
92    pub(crate) display_dispatch: usize,
93    /// `wl_display_flush` symbol address.
94    pub(crate) display_flush: usize,
95    /// `wl_display_roundtrip` symbol address.
96    pub(crate) display_roundtrip: usize,
97    /// `wl_display_get_error` symbol address.
98    pub(crate) display_get_error: usize,
99    /// `wl_proxy_marshal_flags` symbol address.
100    pub(crate) proxy_marshal_flags: usize,
101    /// `wl_proxy_add_listener` symbol address.
102    pub(crate) proxy_add_listener: usize,
103    /// `wl_proxy_destroy` symbol address.
104    pub(crate) proxy_destroy: usize,
105    /// `wl_proxy_get_version` symbol address.
106    pub(crate) proxy_get_version: usize,
107    /// Exported `wl_registry_interface` pointer address.
108    pub(crate) registry_interface: usize,
109    /// Exported `wl_compositor_interface` pointer address.
110    pub(crate) compositor_interface: usize,
111    /// Exported `wl_surface_interface` pointer address.
112    pub(crate) surface_interface: usize,
113    /// Exported `wl_shm_interface` pointer address.
114    pub(crate) shm_interface: usize,
115    /// Exported `wl_shm_pool_interface` pointer address.
116    pub(crate) shm_pool_interface: usize,
117    /// Exported `wl_buffer_interface` pointer address.
118    pub(crate) buffer_interface: usize,
119    /// True when `vkCreateWaylandSurfaceKHR` is available in `libvulkan.so.1`.
120    pub(crate) vulkan_wsi_available: bool,
121    /// True when `vkCreateXlibSurfaceKHR` is available in `libvulkan.so.1`.
122    pub(crate) xlib_vulkan_wsi_available: bool,
123}
124
125/// Raw `wl_registry_listener` ABI table registered during Wayland global discovery.
126#[repr(C)]
127#[derive(Clone, Copy)]
128pub(crate) struct WlRegistryListener {
129    /// Callback invoked for each advertised Wayland global `(data, registry, name, interface, version)`.
130    pub(crate) global: unsafe extern "C" fn(*mut c_void, *mut c_void, u32, *const c_char, u32),
131    /// Callback invoked when a Wayland global is removed `(data, registry, name)`.
132    pub(crate) global_remove: unsafe extern "C" fn(*mut c_void, *mut c_void, u32),
133}
134
135/// Raw `wl_buffer_listener` ABI table tracking compositor buffer release notifications.
136#[repr(C)]
137#[derive(Clone, Copy)]
138pub(crate) struct WlBufferListener {
139    /// Callback invoked when the compositor finishes reading a `wl_buffer` (`(data, buffer)`).
140    pub(crate) release: unsafe extern "C" fn(*mut c_void, *mut c_void),
141}
142
143/// Mutable state populated by `WL_REGISTRY_LISTENER` during initial `wl_display_roundtrip`.
144#[repr(C)]
145#[derive(Clone, Copy, Debug, Default)]
146pub(crate) struct WlRegistryBindState {
147    /// Bound `wl_compositor*` proxy handle.
148    pub(crate) compositor: usize,
149    /// Negotiated `wl_compositor` protocol version.
150    pub(crate) compositor_version: u32,
151    /// Bound `wl_shm*` proxy handle.
152    pub(crate) shm: usize,
153}
154
155/// Descriptor carrying POSIX shared-memory FD, geometry, format, and release flag pointer for `WaylandShmCommitOps`.
156#[derive(Clone, Copy, Data, Debug, Default, Eq, New, PartialEq)]
157pub struct WaylandShmBufferDescriptor {
158    /// Open shared-memory file descriptor (`memfd_create` or `/dev/shm`).
159    #[get(type(copy))]
160    pub(crate) fd: i32,
161    /// Total mapped buffer byte size.
162    #[get(type(copy))]
163    pub(crate) size: i32,
164    /// Physical buffer width in pixels.
165    #[get(type(copy))]
166    pub(crate) width: i32,
167    /// Physical buffer height in pixels.
168    #[get(type(copy))]
169    pub(crate) height: i32,
170    /// Row stride in bytes (`width * 4`).
171    #[get(type(copy))]
172    pub(crate) stride: i32,
173    /// Wayland shm pixel format (`WL_SHM_FORMAT_ARGB8888` or `WL_SHM_FORMAT_XRGB8888`).
174    #[get(type(copy))]
175    pub(crate) format: u32,
176    /// Raw pointer to the slot's release `AtomicBool` userdata registered on `wl_buffer.release`.
177    #[get(type(copy))]
178    pub(crate) release_flag_ptr: usize,
179}
180
181/// Single double-buffered Wayland `wl_shm` memory mapping and protocol buffer slot.
182#[derive(Debug)]
183pub struct WaylandShmBufferSlot {
184    /// Open POSIX shared-memory file descriptor (`-1` when unallocated).
185    pub(crate) fd: i32,
186    /// Base pointer returned by `mmap(..., MAP_SHARED, fd, 0)` (`0` when unmapped).
187    pub(crate) mapped_ptr: usize,
188    /// Mapped byte capacity of this shared-memory region.
189    pub(crate) mapped_len: usize,
190    /// Current allocated buffer width in physical pixels.
191    pub(crate) width: u32,
192    /// Current allocated buffer height in physical pixels.
193    pub(crate) height: u32,
194    /// Row stride in bytes (`width * 4`).
195    pub(crate) stride: u32,
196    /// Bound Wayland shm pixel format (`WL_SHM_FORMAT_ARGB8888` or `WL_SHM_FORMAT_XRGB8888`).
197    pub(crate) format: u32,
198    /// Associated `wl_shm_pool*` proxy handle (`0` when detached).
199    pub(crate) wl_pool: usize,
200    /// Associated `wl_buffer*` proxy handle (`0` when detached).
201    pub(crate) wl_buffer: usize,
202    /// Atomic busy flag cleared asynchronously by `wl_buffer.release` (`true` while held by compositor).
203    pub(crate) busy: Box<AtomicBool>,
204    /// True once this slot has received a complete full-frame pixel copy for its current dimensions.
205    pub(crate) has_full_copy: bool,
206}
207
208/// Double-buffered Wayland `wl_shm` software swapchain owning two POSIX shm mappings and dirty-rect tracking.
209#[derive(Debug)]
210pub struct WaylandShmSwapchain {
211    /// Two ping-pong shared-memory slots enabling tear-free double-buffered Wayland commits.
212    pub(crate) slots: [WaylandShmBufferSlot; WL_SHM_SLOT_COUNT],
213    /// Wayland shm pixel format (`WL_SHM_FORMAT_XRGB8888` or `WL_SHM_FORMAT_ARGB8888`).
214    pub(crate) pixel_format: u32,
215    /// Dirty rectangles from the immediately preceding submitted frame so double-buffered back slots stay coherent.
216    pub(crate) previous_dirty_rects: Vec<(u32, u32, u32, u32)>,
217    /// Index (`0` or `1`) of the most recently committed buffer slot.
218    pub(crate) last_committed_slot: u8,
219    /// Cumulative count of successfully committed Wayland shm frames.
220    pub(crate) submitted_frames: u64,
221    /// Cumulative count of unchanged frames skipped without commit.
222    pub(crate) skipped_unchanged_frames: u64,
223    /// Cumulative count of failed presentation attempts.
224    pub(crate) failed_frames: u64,
225}
226
227/// Native `libwayland-client.so.0` transport invoking `wl_shm_pool`, `wl_buffer`, `wl_surface`, and `wl_display_flush`.
228#[derive(Clone, Copy, Data, Debug, Default, Eq, New, PartialEq)]
229pub struct NativeWaylandShmTransport {
230    /// Live `wl_display*` connection pointer.
231    #[get(type(copy))]
232    pub(crate) display: usize,
233    /// Live `wl_surface*` proxy pointer.
234    #[get(type(copy))]
235    pub(crate) surface: usize,
236    /// Live `wl_shm*` global proxy pointer.
237    #[get(type(copy))]
238    pub(crate) wl_shm: usize,
239    /// Negotiated `wl_surface` interface version (`>= 4` uses `damage_buffer`, `< 4` uses `damage`).
240    #[get(type(copy))]
241    pub(crate) surface_version: u32,
242}
243
244/// Explicit per-frame Linux presentation telemetry separating direct GPU vs Wayland shm vs X11 software blits.
245#[derive(Clone, Copy, Data, Debug, Default, Eq, PartialEq)]
246pub struct LinuxPresentTelemetry {
247    /// Active presentation transport (`GpuDirect`, `WaylandShmSoftware`, or `X11Software`).
248    #[get(type(copy))]
249    pub(crate) mode: LinuxPresentationMode,
250    /// Explicit frame outcome (`Submitted`, `SkippedUnchanged`, or `Failed`).
251    #[get(type(copy))]
252    pub(crate) outcome: LinuxPresentOutcome,
253    /// True whenever a CPU software framebuffer mirror is active (`false` for `GpuDirect`).
254    #[get(type(copy))]
255    pub(crate) cpu_mirror_active: bool,
256    /// Exact pixel bytes copied into Wayland shm or uploaded via X11 `XPutImage` (`0` for `GpuDirect` or skip).
257    #[get(type(copy))]
258    pub(crate) upload_bytes: u64,
259    /// Number of dirty rectangles damaged or uploaded during this frame.
260    #[get(type(copy))]
261    pub(crate) dirty_rect_count: u32,
262    /// Double-buffered Wayland shm slot index (`0` or `1`) committed on this frame.
263    #[get(type(copy))]
264    pub(crate) committed_buffer_slot: u8,
265    /// Cumulative submitted frames recorded on this window.
266    #[get(type(copy))]
267    pub(crate) submitted_frames: u64,
268    /// Cumulative unchanged frames skipped on this window.
269    #[get(type(copy))]
270    pub(crate) skipped_unchanged_frames: u64,
271    /// Cumulative failed frames recorded on this window.
272    #[get(type(copy))]
273    pub(crate) failed_frames: u64,
274}
275
276/// Raw 192-byte X11 `XEvent` union storage aligned for 64-bit Linux LP64 ABI.
277#[repr(C)]
278#[derive(Clone, Copy)]
279pub(crate) struct X11EventRaw {
280    /// Raw union payload words.
281    pub(crate) pad: [isize; 24],
282}
283
284/// X11 `XKeyEvent` / `XButtonEvent` ABI layout on LP64 Linux.
285#[repr(C)]
286#[derive(Clone, Copy)]
287pub(crate) struct X11KeyOrButtonEvent {
288    /// Event discriminant (`KeyPress`, `KeyRelease`, `ButtonPress`, `ButtonRelease`).
289    pub(crate) event_type: i32,
290    /// X server serial number.
291    pub(crate) serial: usize,
292    /// Non-zero when generated by `SendEvent`.
293    pub(crate) send_event: i32,
294    /// Connection `Display*`.
295    pub(crate) display: *mut c_void,
296    /// Target `Window` XID.
297    pub(crate) window: u64,
298    /// Root window XID.
299    pub(crate) root: u64,
300    /// Subwindow XID.
301    pub(crate) subwindow: u64,
302    /// Event timestamp in milliseconds.
303    pub(crate) time: u64,
304    /// Pointer X coordinate relative to window.
305    pub(crate) x: i32,
306    /// Pointer Y coordinate relative to window.
307    pub(crate) y: i32,
308    /// Pointer X relative to root window.
309    pub(crate) x_root: i32,
310    /// Pointer Y relative to root window.
311    pub(crate) y_root: i32,
312    /// Modifier key / button mask.
313    pub(crate) state: u32,
314    /// Hardware keycode or mouse button number.
315    pub(crate) detail: u32,
316    /// Same-screen flag.
317    pub(crate) same_screen: i32,
318}
319
320/// X11 `XMotionEvent` ABI layout on LP64 Linux.
321#[repr(C)]
322#[derive(Clone, Copy)]
323pub(crate) struct X11MotionEvent {
324    /// Event discriminant (`MotionNotify`).
325    pub(crate) event_type: i32,
326    /// X server serial number.
327    pub(crate) serial: usize,
328    /// Send-event flag.
329    pub(crate) send_event: i32,
330    /// Connection `Display*`.
331    pub(crate) display: *mut c_void,
332    /// Target `Window` XID.
333    pub(crate) window: u64,
334    /// Root window XID.
335    pub(crate) root: u64,
336    /// Subwindow XID.
337    pub(crate) subwindow: u64,
338    /// Timestamp in milliseconds.
339    pub(crate) time: u64,
340    /// Pointer X coordinate relative to window.
341    pub(crate) x: i32,
342    /// Pointer Y coordinate relative to window.
343    pub(crate) y: i32,
344    /// Pointer X relative to root window.
345    pub(crate) x_root: i32,
346    /// Pointer Y relative to root window.
347    pub(crate) y_root: i32,
348    /// Active modifier mask.
349    pub(crate) state: u32,
350    /// Motion hint byte.
351    pub(crate) is_hint: c_char,
352    /// Same-screen flag.
353    pub(crate) same_screen: i32,
354}
355
356/// X11 `XConfigureEvent` ABI layout on LP64 Linux.
357#[repr(C)]
358#[derive(Clone, Copy)]
359pub(crate) struct X11ConfigureEvent {
360    /// Event discriminant (`ConfigureNotify`).
361    pub(crate) event_type: i32,
362    /// X server serial number.
363    pub(crate) serial: usize,
364    /// Send-event flag.
365    pub(crate) send_event: i32,
366    /// Connection `Display*`.
367    pub(crate) display: *mut c_void,
368    /// Event-delivery window XID.
369    pub(crate) event_window: u64,
370    /// Reconfigured target window XID.
371    pub(crate) window: u64,
372    /// New window X position.
373    pub(crate) x: i32,
374    /// New window Y position.
375    pub(crate) y: i32,
376    /// New window client width in physical pixels.
377    pub(crate) width: i32,
378    /// New window client height in physical pixels.
379    pub(crate) height: i32,
380}
381
382/// X11 `XClientMessageEvent` ABI layout on LP64 Linux.
383#[repr(C)]
384#[derive(Clone, Copy)]
385pub(crate) struct X11ClientMessageEvent {
386    /// Event discriminant (`ClientMessage`).
387    pub(crate) event_type: i32,
388    /// X server serial number.
389    pub(crate) serial: usize,
390    /// Send-event flag.
391    pub(crate) send_event: i32,
392    /// Connection `Display*`.
393    pub(crate) display: *mut c_void,
394    /// Target `Window` XID.
395    pub(crate) window: u64,
396    /// Message type atom (`WM_PROTOCOLS`).
397    pub(crate) message_type: u64,
398    /// Data format (`8`, `16`, or `32`).
399    pub(crate) format: i32,
400    /// 32-bit protocol data payload (`l[0]` holds `WM_DELETE_WINDOW`).
401    pub(crate) data: [u64; 5],
402}
403
404/// Bundle returned when opening a native Linux X11 or Wayland window.
405#[derive(Clone, Copy, Data, Debug)]
406pub(crate) struct LinuxNativeWindowHandle {
407    /// Dynamically loaded `libX11` or `libwayland-client` handle.
408    #[get(type(copy))]
409    pub(crate) lib: usize,
410    /// True when backed by Wayland; false when backed by X11.
411    #[get(type(copy))]
412    pub(crate) is_wayland: bool,
413    /// Raw `Display*` or `wl_display*`.
414    #[get(type(copy))]
415    pub(crate) display: usize,
416    /// Native X11 `Window` XID or Wayland surface pointer.
417    #[get(type(copy))]
418    pub(crate) window: u64,
419    /// Cached X11 `GC` handle for `XPutImage`.
420    #[get(type(copy))]
421    pub(crate) gc: usize,
422    /// Cached X11 `Visual*` pointer for `XCreateImage`.
423    #[get(type(copy))]
424    pub(crate) visual: usize,
425    /// X11 default visual color depth (e.g., `24` or `32`).
426    #[get(type(copy))]
427    pub(crate) depth: u32,
428    /// Interned `WM_DELETE_WINDOW` atom for graceful window closing.
429    #[get(type(copy))]
430    pub(crate) wm_delete_atom: u64,
431    /// Probed display DPI scale factor (`1.0..=4.0`).
432    #[get(type(copy))]
433    pub(crate) scale_factor: f32,
434    /// True when X11 MIT-SHM (`XShmQueryExtension`) is supported on this display.
435    #[get(type(copy))]
436    pub(crate) mit_shm_available: bool,
437    /// True when Wayland Vulkan WSI (`VK_KHR_wayland_surface`) is available.
438    #[get(type(copy))]
439    pub(crate) wayland_vulkan_wsi: bool,
440    /// True when X11 Vulkan WSI (`VK_KHR_xlib_surface`) is available.
441    #[get(type(copy))]
442    pub(crate) xlib_vulkan_wsi: bool,
443    /// Bound Wayland `wl_compositor*` proxy pointer (`0` on X11 or unavailable).
444    #[get(type(copy))]
445    pub(crate) wl_compositor: usize,
446    /// Bound Wayland `wl_shm*` proxy pointer (`0` on X11 or unavailable).
447    #[get(type(copy))]
448    pub(crate) wl_shm: usize,
449    /// Negotiated Wayland `wl_surface` interface version (`0` on X11).
450    #[get(type(copy))]
451    pub(crate) wl_surface_version: u32,
452}
453
454/// Native Linux X11 / Wayland window record.
455#[derive(Clone, Data, Debug)]
456pub struct LinuxWindowRecord {
457    /// Window configuration.
458    pub(crate) config: WindowConfig,
459    /// Live window state.
460    #[get(type(copy))]
461    pub(crate) state: WindowState,
462    /// True when backed by Wayland; false when backed by X11 Xlib.
463    #[get(type(copy))]
464    pub(crate) is_wayland: bool,
465    /// Raw display handle (`Display*` or `wl_display*`).
466    #[get(type(copy))]
467    pub(crate) display: usize,
468    /// Raw window or surface identifier (`Window` or `wl_surface*`).
469    #[get(type(copy))]
470    pub(crate) window: u64,
471    /// Cached X11 `GC` handle used by `XPutImage`.
472    #[get(type(copy))]
473    pub(crate) gc: usize,
474    /// Cached X11 `Visual*` pointer used by `XCreateImage`.
475    #[get(type(copy))]
476    pub(crate) visual: usize,
477    /// X11 visual depth in bits (`24` or `32`).
478    #[get(type(copy))]
479    pub(crate) depth: u32,
480    /// Interned `WM_DELETE_WINDOW` protocol atom.
481    #[get(type(copy))]
482    pub(crate) wm_delete_atom: u64,
483    /// Whether `XMapWindow` has been issued after Frame 1 presentation (eliminates unmapped flash).
484    #[get(type(copy))]
485    pub(crate) revealed: bool,
486    /// Whether X11 MIT-SHM shared-memory image transport is supported by the X server.
487    #[get(type(copy))]
488    pub(crate) mit_shm_available: bool,
489    /// Whether Wayland Vulkan WSI (`VK_KHR_wayland_surface`) is ready on this display.
490    #[get(type(copy))]
491    pub(crate) wayland_vulkan_wsi: bool,
492    /// Whether X11 Vulkan WSI (`VK_KHR_xlib_surface`) is ready on this display.
493    #[get(type(copy))]
494    pub(crate) xlib_vulkan_wsi: bool,
495    /// Bound Wayland `wl_compositor*` proxy pointer (`0` on X11).
496    #[get(type(copy))]
497    pub(crate) wl_compositor: usize,
498    /// Bound Wayland `wl_shm*` proxy pointer (`0` on X11).
499    #[get(type(copy))]
500    pub(crate) wl_shm: usize,
501    /// Negotiated Wayland `wl_surface` interface version (`>= 4` supports `damage_buffer`).
502    #[get(type(copy))]
503    pub(crate) wl_surface_version: u32,
504    /// Reported `wl_output.mode` refresh rate in millihertz (e.g. `240000` for `240Hz`, `0` if unset).
505    #[get(type(copy))]
506    pub(crate) wayland_output_refresh_milli_hz: u32,
507    /// Latest `wp_presentation` feedback timestamp in nanoseconds (`0` before first presentation).
508    #[get(type(copy))]
509    pub(crate) wayland_presentation_time_ns: u64,
510    /// Whether a `wl_surface::frame` callback is currently armed awaiting compositor VSync.
511    #[get(type(copy))]
512    pub(crate) wayland_frame_callback_pending: bool,
513    /// Active Linux presentation mode (`GpuDirect`, `WaylandShmSoftware`, or `X11Software`).
514    #[get(type(copy))]
515    pub(crate) presentation_mode: LinuxPresentationMode,
516    /// Explicit CPU-mirror telemetry flag (`true` on Wayland shm / X11 software; `false` on direct GPU).
517    #[get(type(copy))]
518    pub(crate) cpu_mirror_active: bool,
519    /// Most recent per-frame Linux presentation telemetry snapshot.
520    #[get(type(copy))]
521    pub(crate) last_telemetry: LinuxPresentTelemetry,
522    /// Double-buffered Wayland `wl_shm` software swapchain attached to this window when Wayland is active.
523    #[get(skip)]
524    #[get_mut(skip)]
525    #[set(skip)]
526    pub(crate) wayland_shm: Option<Arc<Mutex<WaylandShmSwapchain>>>,
527}
528
529/// Direct Linux X11 / Wayland (`dlopen`-loaded) + Vulkan platform backend.
530#[derive(Clone, Data, Debug)]
531pub struct LinuxPlatform {
532    /// Monotonic window handle generator.
533    #[get(pub(crate), type(copy))]
534    #[get_mut(pub(crate))]
535    #[set(pub(crate))]
536    pub(crate) next_id: u64,
537    /// Dynamically loaded `libX11` handle if present.
538    #[get(pub(crate), type(copy))]
539    #[get_mut(pub(crate))]
540    #[set(pub(crate))]
541    pub(crate) x11_lib: usize,
542    /// Active native Linux windows.
543    pub(crate) windows: HashMap<WindowId, LinuxWindowRecord>,
544    /// Queued window and input events.
545    pub(crate) pending_events: Vec<WindowEvent>,
546    /// Clipboard text cache.
547    #[get(skip)]
548    pub(crate) clipboard_cache: Option<String>,
549    /// Whether the Linux X11/Wayland frame pump is paused for background freeze.
550    #[get(pub(crate), type(copy))]
551    #[set(pub(crate))]
552    pub(crate) pump_paused: bool,
553}