From 82b16caa2e1d1c8976c09d19099c612588e4c7f4 Mon Sep 17 00:00:00 2001 From: oiupoyt Date: Mon, 5 Oct 2026 07:23:49 +0530 Subject: [PATCH] perf: optimize PipeWire DRM format negotiation and sharpen Gallery modal with drop shadows --- src/capture/wayland_stream.rs | 8 +++++++- src/overlay_egui.rs | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/capture/wayland_stream.rs b/src/capture/wayland_stream.rs index 430d024..224247b 100644 --- a/src/capture/wayland_stream.rs +++ b/src/capture/wayland_stream.rs @@ -77,10 +77,16 @@ impl PipeWireStream { let stride = data.chunk().stride() as u32; let offset = data.chunk().offset(); let frame = if fd > 0 { + let drm_fourcc = match user_data.format.format() { + spa::param::video::VideoFormat::BGRx | spa::param::video::VideoFormat::BGRA => 0x34325258, // DRM_FORMAT_XRGB8888 + spa::param::video::VideoFormat::RGBx | spa::param::video::VideoFormat::RGBA => 0x34324258, // DRM_FORMAT_XBGR8888 + spa::param::video::VideoFormat::NV12 => 0x3231564e, // DRM_FORMAT_NV12 + _ => 0x34325241, // DRM_FORMAT_ARGB8888 + }; Frame::DmaBuf { width: user_data.format.size().width, height: user_data.format.size().height, - format: 0x34325241, // DRM_FORMAT_ARGB8888 + format: drm_fourcc, modifier: user_data.format.modifier(), fd, stride, diff --git a/src/overlay_egui.rs b/src/overlay_egui.rs index b651510..d1c5625 100644 --- a/src/overlay_egui.rs +++ b/src/overlay_egui.rs @@ -2798,10 +2798,12 @@ impl ScytheOverlayApp { let modal_rect = egui::Rect::from_min_size(egui::pos2(left_pad, top_pad), egui::vec2(modal_w, modal_h)); self.panel_rect = modal_rect; + draw_window_shadow(ui.painter(), modal_rect, 1.0); + ui.allocate_new_ui(egui::UiBuilder::new().max_rect(modal_rect), |ui| { egui::Frame::NONE - .fill(Color32::from_rgba_unmultiplied(11, 12, 15, 252)) - .stroke(Stroke::new(1.0_f32, Color32::from_rgba_unmultiplied(accent.r(), accent.g(), accent.b(), 140))) + .fill(Color32::from_rgb(21, 25, 30)) + .stroke(Stroke::new(1.0_f32, Color32::from_rgb(42, 50, 62))) .corner_radius(CornerRadius::ZERO) .inner_margin(Margin::symmetric(20_i8, 16_i8)) .show(ui, |ui| {