screensaver
git clone https://git.lucas.co/cce-screenaver.git
refactor: build the app with Application::create
Application::new(qh, sender) took the session's Wayland queue handle,
which no client ever used, and calloop's sender; cce-ui is retiring it
for create(sender: AppSender<_>), which names no window system. The
body is unchanged: an app that keeps calloop's sender converts the
AppSender into it on the first line, and the now-unused QueueHandle and
EngineState imports go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/main.rs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index a149d9b..e6c521f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,4 @@
-use wayland_client::QueueHandle;
-use cce_ui::engine::{Application, EngineState, LogicalPosition, LogicalSize, WindowSettings};
+use cce_ui::engine::{Application, LogicalPosition, LogicalSize, WindowSettings};
use cce_ui::widget::{MouseButton, ElementState, MouseScrollDelta, KeyEvent};
use std::time::SystemTime;
@@ -74,7 +73,7 @@ enum AppMessage {
impl Application for ScreensaverApp {
type Message = AppMessage;
- fn new(_qh: &QueueHandle<EngineState<Self>>, _sender: calloop::channel::Sender<Self::Message>) -> Self {
+ fn create(_sender: cce_ui::engine::AppSender<Self::Message>) -> Self {
let style_env = std::env::var("CCE_SCREENSAVER_STYLE").unwrap_or_default();
let style = match style_env.to_lowercase().as_str() {
"starfield" => ScreensaverStyle::Starfield,