@@ -16,14 +16,16 @@ use cosmic::{
1616 alignment:: Horizontal ,
1717 event:: {
1818 self , listen_with,
19- wayland:: { self , LayerEvent , OverlapNotifyEvent , OutputEvent } ,
19+ wayland:: { self , LayerEvent , OutputEvent , OverlapNotifyEvent } ,
2020 } ,
2121 keyboard:: { Key , key:: Named } ,
2222 platform_specific:: shell:: commands:: activation:: request_token,
2323 time,
2424 window:: Id as SurfaceId ,
2525 } ,
26- iced_runtime:: platform_specific:: wayland:: layer_surface:: { IcedOutput , SctkLayerSurfaceSettings } ,
26+ iced_runtime:: platform_specific:: wayland:: layer_surface:: {
27+ IcedOutput , SctkLayerSurfaceSettings ,
28+ } ,
2729 iced_winit:: commands:: layer_surface:: {
2830 Anchor , KeyboardInteractivity , destroy_layer_surface, get_layer_surface,
2931 } ,
@@ -67,8 +69,8 @@ pub struct Args {
6769pub enum OsdTask {
6870 #[ clap( about = "Display external display toggle indicator" ) ]
6971 Display ,
70- #[ clap( about = "Show numbers on all displays for identification" , name = "identify-displays" ) ]
71- DisplayIdentifier ,
72+ #[ clap( about = "Show numbers on all displays for identification" ) ]
73+ IdentifyDisplays ,
7274 #[ clap( about = "Toggle the on screen display and start the log out timer" ) ]
7375 LogOut ,
7476 #[ clap( about = "Toggle the on screen display and start the restart timer" ) ]
@@ -117,7 +119,7 @@ impl OsdTask {
117119 . map ( msg) ,
118120 OsdTask :: Touchpad => Task :: none ( ) ,
119121 OsdTask :: Display => Task :: none ( ) ,
120- OsdTask :: DisplayIdentifier => Task :: none ( ) ,
122+ OsdTask :: IdentifyDisplays => Task :: none ( ) ,
121123 }
122124 }
123125}
@@ -515,7 +517,9 @@ impl cosmic::Application for App {
515517 if let Some ( state) = state {
516518 self . surfaces . insert ( id, Surface :: OsdIndicator ( state) ) ;
517519 }
518- return cmd. map ( move |msg| cosmic:: action:: app ( Msg :: DisplayIdentifierSurface ( ( id, msg) ) ) ) ;
520+ return cmd. map ( move |msg| {
521+ cosmic:: action:: app ( Msg :: DisplayIdentifierSurface ( ( id, msg) ) )
522+ } ) ;
519523 }
520524 Task :: none ( )
521525 }
@@ -766,7 +770,9 @@ impl cosmic::Application for App {
766770 ) ;
767771
768772 self . surfaces . insert ( id, Surface :: OsdIndicator ( state) ) ;
769- tasks. push ( cmd. map ( move |msg| cosmic:: action:: app ( Msg :: DisplayIdentifierSurface ( ( id, msg) ) ) ) ) ;
773+ tasks. push ( cmd. map ( move |msg| {
774+ cosmic:: action:: app ( Msg :: DisplayIdentifierSurface ( ( id, msg) ) )
775+ } ) ) ;
770776 }
771777
772778 Task :: batch ( tasks)
@@ -840,10 +846,16 @@ impl cosmic::Application for App {
840846 _ => None ,
841847 } ) ) ;
842848
843- subscriptions. extend ( self . surfaces . iter ( ) . filter_map ( |( id, surface) | match surface {
844- Surface :: PolkitDialog ( state) => Some ( state. subscription ( ) . with ( * id) . map ( Msg :: PolkitDialog ) ) ,
845- Surface :: OsdIndicator ( _) => None , // OSD indicators don't have subscriptions
846- } ) ) ;
849+ subscriptions. extend (
850+ self . surfaces
851+ . iter ( )
852+ . filter_map ( |( id, surface) | match surface {
853+ Surface :: PolkitDialog ( state) => {
854+ Some ( state. subscription ( ) . with ( * id) . map ( Msg :: PolkitDialog ) )
855+ }
856+ Surface :: OsdIndicator ( _) => None , // OSD indicators don't have subscriptions
857+ } ) ,
858+ ) ;
847859 if self . action_to_confirm . is_some ( ) {
848860 subscriptions. push ( time:: every ( Duration :: from_millis ( 1000 ) ) . map ( |_| Msg :: Countdown ) ) ;
849861 }
@@ -861,9 +873,9 @@ impl cosmic::Application for App {
861873 Surface :: PolkitDialog ( state) => {
862874 state. view ( ) . map ( move |msg| Msg :: PolkitDialog ( ( id, msg) ) )
863875 }
864- Surface :: OsdIndicator ( state) => {
865- state . view ( ) . map ( move |msg| Msg :: DisplayIdentifierSurface ( ( id , msg ) ) )
866- }
876+ Surface :: OsdIndicator ( state) => state
877+ . view ( )
878+ . map ( move |msg| Msg :: DisplayIdentifierSurface ( ( id , msg ) ) ) ,
867879 } ;
868880 } else if let Some ( ( indicator_id, state) ) = & self . indicator {
869881 if id == * indicator_id {
@@ -880,7 +892,7 @@ impl cosmic::Application for App {
880892 OsdTask :: ConfirmHeadphones { .. } => "confirm-device-type" ,
881893 OsdTask :: Touchpad => "touchpad" ,
882894 OsdTask :: Display => "external-display" ,
883- OsdTask :: DisplayIdentifier => "display-identifier " ,
895+ OsdTask :: IdentifyDisplays => "identify-displays " ,
884896 } ;
885897
886898 let title = fl ! (
@@ -1185,7 +1197,7 @@ impl cosmic::Application for App {
11851197
11861198 Msg :: Display ( enabled)
11871199 } ) ;
1188- } else if let OsdTask :: DisplayIdentifier = cmd {
1200+ } else if let OsdTask :: IdentifyDisplays = cmd {
11891201 return cosmic:: task:: future ( async move {
11901202 let Ok ( output_lists) = cosmic_randr_shell:: list ( ) . await else {
11911203 log:: error!( "Failed to list displays with cosmic-randr" ) ;
0 commit comments