git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commitbec4c8944cffa2a946e3a1555c36fc236771c76a
parent1993de4aa0
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-08 08:12
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/application.rs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/application.rs b/src/application.rs
index a938b27..7be62d5 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -8,12 +8,11 @@
 use std::time::{Duration, Instant};
 
 use cce_ui::engine::{
-    xdg_toplevel::ResizeEdge, Application, CursorIcon, EngineState, LogicalPosition, LogicalSize,
+    xdg_toplevel::ResizeEdge, Application, CursorIcon, LogicalPosition, LogicalSize,
     WindowAction, WindowSettings,
 };
 use cce_ui::vk::VkRenderer;
 use cce_ui::widget::{ElementState, KeyEvent, MouseButton, MouseScrollDelta};
-use wayland_client::QueueHandle;
 
 use crate::api::start_mcp_server;
 use crate::app::{CustomEvent, PendingWindowDrag, State};
@@ -144,10 +143,9 @@ impl State {
 impl Application for State {
     type Message = CustomEvent;
 
-    fn new(
-        _qh: &QueueHandle<EngineState<Self>>,
-        sender: calloop::channel::Sender<CustomEvent>,
-    ) -> Self {
+    fn create(sender: cce_ui::engine::AppSender<CustomEvent>) -> Self {
+        // The app keeps calloop's sender; `AppSender` converts into it.
+        let sender: calloop::channel::Sender<CustomEvent> = sender.into();
         let is_detached_network = std::env::args().any(|arg| arg == "--detached-network");
         let detached_pane = std::env::args()
             .find_map(|arg| crate::plate_menu::pane_from_detach_flag(&arg));