1- mod state;
21use crate :: {
32 DefaultStyle ,
43 actions:: { IcedNewPopupSettings , LayershellCustomActionWithId , MenuDirection } ,
@@ -7,36 +6,28 @@ use crate::{
76 settings:: VirtualKeyboardSettings ,
87 user_interface:: UserInterfaces ,
98} ;
10- use std:: {
11- borrow:: Cow ,
12- collections:: { HashMap , VecDeque } ,
13- mem,
14- os:: fd:: AsFd ,
15- sync:: Arc ,
16- task:: Poll ,
17- time:: Duration ,
18- } ;
19-
209use crate :: {
2110 actions:: LayershellCustomAction , clipboard:: LayerShellClipboard , conversion, error:: Error ,
2211} ;
23-
12+ use crate :: {
13+ event:: { IcedLayerShellEvent , WindowEvent as LayerShellWindowEvent } ,
14+ proxy:: IcedProxy ,
15+ settings:: Settings ,
16+ } ;
17+ use futures:: { FutureExt , StreamExt , future:: LocalBoxFuture } ;
2418#[ cfg( not( all( feature = "linux-theme-detection" , target_os = "linux" ) ) ) ]
2519use iced:: theme:: Mode ;
2620use iced:: {
2721 Event as IcedEvent , theme,
2822 window:: { Event as IcedWindowEvent , Id as IcedId , RedrawRequest } ,
2923} ;
24+ use iced_core:: { Size , mouse:: Cursor , time:: Instant } ;
25+ use iced_futures:: { Executor , Runtime } ;
3026use iced_graphics:: { Compositor , Shell , compositor} ;
27+ use iced_program:: Instance ;
28+ use iced_program:: Program as IcedProgram ;
3129use iced_runtime:: Action ;
32-
33- use iced_runtime:: debug;
34-
35- use iced_core:: { Size , mouse:: Cursor , time:: Instant } ;
3630use iced_runtime:: user_interface;
37-
38- use iced_futures:: { Executor , Runtime } ;
39-
4031use layershellev:: {
4132 LayerShellEvent , NewPopUpSettings , RefreshRequest , ReturnData , WindowState , WindowWrapper ,
4233 calloop:: timer:: { TimeoutAction , Timer } ,
@@ -46,23 +37,22 @@ use layershellev::{
4637 zwp_virtual_keyboard_v1,
4738 } ,
4839} ;
49-
50- use futures :: { FutureExt , StreamExt , future :: LocalBoxFuture } ;
51- use window_manager :: Window ;
52-
53- use crate :: {
54- event :: { IcedLayerShellEvent , WindowEvent as LayerShellWindowEvent } ,
55- proxy :: IcedProxy ,
56- settings :: Settings ,
40+ use std :: {
41+ borrow :: Cow ,
42+ collections :: { HashMap , VecDeque } ,
43+ mem ,
44+ os :: fd :: AsFd ,
45+ sync :: Arc ,
46+ task :: Poll ,
47+ time :: Duration ,
5748} ;
49+ use window_manager:: Window ;
5850
51+ mod state;
5952mod window_manager;
6053
6154type MultiRuntime < E , Message > = Runtime < E , IcedProxy < Action < Message > > , Action < Message > > ;
6255
63- use iced_program:: Instance ;
64- use iced_program:: Program as IcedProgram ;
65-
6656// a dispatch loop, another is listen loop
6757pub fn run < P > (
6858 program : P ,
@@ -78,14 +68,14 @@ where
7868 use futures:: task;
7969 let ( message_sender, message_receiver) = std:: sync:: mpsc:: channel :: < Action < P :: Message > > ( ) ;
8070
81- let boot_span = debug :: boot ( ) ;
71+ let boot_span = iced_debug :: boot ( ) ;
8272 let proxy = IcedProxy :: new ( message_sender) ;
8373
8474 #[ cfg( feature = "debug" ) ]
8575 {
8676 let proxy = proxy. clone ( ) ;
8777
88- debug :: on_hotpatch ( move || {
78+ iced_debug :: on_hotpatch ( move || {
8979 proxy. send_action ( Action :: Reload ) ;
9080 } ) ;
9181 }
@@ -427,7 +417,7 @@ where
427417 || window_size. height != height
428418 || window. state . wayland_scale_factor ( ) != scale_float
429419 {
430- let layout_span = debug :: layout ( iced_id) ;
420+ let layout_span = iced_debug :: layout ( iced_id) ;
431421 window. state . update_view_port ( width, height, scale_float) ;
432422 if let Some ( ui) = self . user_interfaces . ui_mut ( & iced_id) {
433423 ui. relayout ( window. state . viewport ( ) . logical_size ( ) , & mut window. renderer ) ;
@@ -488,7 +478,7 @@ where
488478 Instant :: now ( ) ,
489479 ) ) ) ;
490480
491- let draw_span = debug :: draw ( iced_id) ;
481+ let draw_span = iced_debug :: draw ( iced_id) ;
492482 let ( ui_state, statuses) = ui. update (
493483 & events,
494484 cursor,
@@ -548,7 +538,7 @@ where
548538
549539 window. draw_preedit ( ) ;
550540
551- let present_span = debug :: present ( iced_id) ;
541+ let present_span = iced_debug :: present ( iced_id) ;
552542 match compositor. present (
553543 & mut window. renderer ,
554544 & mut window. surface ,
@@ -855,7 +845,7 @@ where
855845
856846 let mut rebuilds = Vec :: new ( ) ;
857847 for ( iced_id, window) in self . window_manager . iter_mut ( ) {
858- let interact_span = debug :: interact ( iced_id) ;
848+ let interact_span = iced_debug :: interact ( iced_id) ;
859849 let mut window_events = vec ! [ ] ;
860850
861851 self . iced_events . retain ( |( window_id, event) | {
@@ -912,7 +902,7 @@ where
912902 for ( _, window) in self . window_manager . iter_mut ( ) {
913903 window. state . synchronize ( application) ;
914904 }
915- debug :: theme_changed ( || {
905+ iced_debug :: theme_changed ( || {
916906 self . window_manager
917907 . first ( )
918908 . and_then ( |window| theme:: Base :: palette ( window. state . theme ( ) ) )
@@ -1039,7 +1029,7 @@ pub(crate) fn update<P: IcedProgram, E: Executor>(
10391029 let subscription = runtime. enter ( || application. subscription ( ) ) ;
10401030 let recipes = iced_futures:: subscription:: into_recipes ( subscription. map ( Action :: Output ) ) ;
10411031
1042- debug :: subscriptions_tracked ( recipes. len ( ) ) ;
1032+ iced_debug :: subscriptions_tracked ( recipes. len ( ) ) ;
10431033 runtime. track ( recipes) ;
10441034}
10451035
0 commit comments