mirror of
https://github.com/CloudNebulaProject/wayray.git
synced 2026-04-10 13:10:41 +00:00
Fix PixmanRenderer compositing: remove EGL features from default build
renderer_gl and backend_winit pulled in backend_egl, which changed the ImportAll blanket impl to require ImportEgl — a trait PixmanRenderer doesn't implement. This caused render_output to silently skip client surface compositing (only the clear color rendered). Fix: move renderer_gl and backend_winit behind a "winit" cargo feature. Default build uses only renderer_pixman, which satisfies ImportAll via the simpler ImportMemWl + ImportDmaWl blanket impl. Winit backend: cargo build -p wrsrvd --features winit Headless (default): cargo build -p wrsrvd
This commit is contained in:
parent
3c6430c982
commit
9fc27d3b56
5 changed files with 34 additions and 36 deletions
|
|
@ -4,6 +4,11 @@ edition.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# Enable the Winit development backend (requires display server).
|
||||||
|
# Build with: cargo build -p wrsrvd --features winit
|
||||||
|
winit = ["smithay/renderer_gl", "smithay/backend_winit"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wayray-protocol.workspace = true
|
wayray-protocol.workspace = true
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
|
@ -11,16 +16,14 @@ tracing-subscriber.workspace = true
|
||||||
miette.workspace = true
|
miette.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
|
|
||||||
smithay = { version = "0.7", default-features = false, features = [
|
|
||||||
"wayland_frontend",
|
|
||||||
"desktop",
|
|
||||||
"renderer_gl",
|
|
||||||
"renderer_pixman",
|
|
||||||
"backend_winit",
|
|
||||||
] }
|
|
||||||
ctrlc = "3"
|
ctrlc = "3"
|
||||||
quinn.workspace = true
|
quinn.workspace = true
|
||||||
rustls.workspace = true
|
rustls.workspace = true
|
||||||
rcgen.workspace = true
|
rcgen.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|
||||||
|
smithay = { version = "0.7", default-features = false, features = [
|
||||||
|
"wayland_frontend",
|
||||||
|
"desktop",
|
||||||
|
"renderer_pixman",
|
||||||
|
] }
|
||||||
|
|
|
||||||
|
|
@ -268,24 +268,6 @@ fn render_headless_frame(data: &mut CalloopData) {
|
||||||
std::slice::from_raw_parts(ptr, frame_bytes)
|
std::slice::from_raw_parts(ptr, frame_bytes)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Debug: check if the framebuffer contains anything besides the clear color.
|
|
||||||
if element_count > 0 {
|
|
||||||
// Clear color [0.1, 0.1, 0.1, 1.0] ≈ [25, 25, 25, 255] in u8
|
|
||||||
// Count unique non-bg BGRA values in first 1000 pixels
|
|
||||||
let unique: std::collections::HashSet<[u8; 4]> = pixels
|
|
||||||
.chunks_exact(4)
|
|
||||||
.take(1000)
|
|
||||||
.map(|p| [p[0], p[1], p[2], p[3]])
|
|
||||||
.collect();
|
|
||||||
tracing::info!(
|
|
||||||
unique_colors = unique.len(),
|
|
||||||
first_pixel = ?&pixels[..4.min(pixels.len())],
|
|
||||||
stride,
|
|
||||||
total_bytes = pixels.len(),
|
|
||||||
"framebuffer content check"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send frame over network if a client is connected.
|
// Send frame over network if a client is connected.
|
||||||
if data.client_connected {
|
if data.client_connected {
|
||||||
send_frame_to_network(data, pixels, &damage, output_size.w, output_size.h, stride);
|
send_frame_to_network(data, pixels, &damage, output_size.w, output_size.h, stride);
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
pub mod headless;
|
pub mod headless;
|
||||||
|
|
||||||
|
#[cfg(feature = "winit")]
|
||||||
pub mod winit;
|
pub mod winit;
|
||||||
|
|
|
||||||
|
|
@ -75,10 +75,18 @@ fn main() -> Result<()> {
|
||||||
);
|
);
|
||||||
|
|
||||||
if use_winit {
|
if use_winit {
|
||||||
let result = backend::winit::run(display, state, output);
|
#[cfg(feature = "winit")]
|
||||||
net_handle.shutdown();
|
{
|
||||||
result
|
let result = backend::winit::run(display, state, output);
|
||||||
} else {
|
net_handle.shutdown();
|
||||||
backend::headless::run(display, state, output, net_handle)
|
return result;
|
||||||
|
}
|
||||||
|
#[cfg(not(feature = "winit"))]
|
||||||
|
{
|
||||||
|
eprintln!("Winit backend not compiled. Build with: cargo build --features winit");
|
||||||
|
std::process::exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backend::headless::run(display, state, output, net_handle)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
|
#[cfg(feature = "winit")]
|
||||||
|
use smithay::backend::input::{
|
||||||
|
AbsolutePositionEvent, Event as InputEventTrait, InputBackend, InputEvent, KeyboardKeyEvent,
|
||||||
|
PointerAxisEvent as PointerAxisEventTrait, PointerButtonEvent as PointerButtonEventTrait,
|
||||||
|
};
|
||||||
use smithay::{
|
use smithay::{
|
||||||
backend::input::{
|
backend::input::{Axis, AxisSource, ButtonState},
|
||||||
AbsolutePositionEvent, Axis, AxisSource, ButtonState, Event as InputEventTrait,
|
|
||||||
InputBackend, InputEvent, KeyboardKeyEvent, PointerAxisEvent as PointerAxisEventTrait,
|
|
||||||
PointerButtonEvent as PointerButtonEventTrait,
|
|
||||||
},
|
|
||||||
desktop::{Space, WindowSurfaceType},
|
desktop::{Space, WindowSurfaceType},
|
||||||
input::{
|
input::{
|
||||||
Seat, SeatState,
|
Seat, SeatState,
|
||||||
|
|
@ -82,6 +83,8 @@ impl WayRay {
|
||||||
|
|
||||||
/// Process an input event from the backend and forward it to the appropriate
|
/// Process an input event from the backend and forward it to the appropriate
|
||||||
/// Smithay seat device (keyboard or pointer).
|
/// Smithay seat device (keyboard or pointer).
|
||||||
|
/// Only used by the Winit backend for local input processing.
|
||||||
|
#[cfg(feature = "winit")]
|
||||||
pub fn process_input_event<B: InputBackend>(&mut self, event: InputEvent<B>) {
|
pub fn process_input_event<B: InputBackend>(&mut self, event: InputEvent<B>) {
|
||||||
match event {
|
match event {
|
||||||
InputEvent::Keyboard { event } => {
|
InputEvent::Keyboard { event } => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue