@@ -336,15 +336,14 @@ impl CosmicAppLibrary {
336336 self . needs_clear = true ;
337337 let id = window:: Id :: unique ( ) ;
338338 self . dummy_id = Some ( id) ;
339- Task :: batch ( vec ! [
340- cosmic:: surface:: surface_task( simple_layer_shell:: <Message >(
341- || LiveSettings {
342- padding: Some ( IcedMargin :: default ( ) ) ,
343- corners: Some ( CornerRadius :: default ( ) ) ,
344- blur: Some ( false ) ,
345- } ,
346- move || {
347- SctkLayerSurfaceSettings {
339+ cosmic:: surface:: surface_task ( simple_layer_shell :: < Message > (
340+ || LiveSettings {
341+ padding : Some ( IcedMargin :: default ( ) ) ,
342+ corners : Some ( CornerRadius :: default ( ) ) ,
343+ blur : Some ( false ) ,
344+ } ,
345+ move || {
346+ SctkLayerSurfaceSettings {
348347 id,
349348 layer : wlr_layer:: Layer :: Bottom ,
350349 keyboard_interactivity : wlr_layer:: KeyboardInteractivity :: None ,
@@ -358,11 +357,9 @@ impl CosmicAppLibrary {
358357 exclusive_zone : -1 ,
359358 size_limits : Limits :: NONE ,
360359 }
361- } ,
362- None :: <fn ( ) -> Element <' static , cosmic:: Action <Message >>>,
363- ) ) ,
364- overlap_notify( id, true ) ,
365- ] )
360+ } ,
361+ None :: < fn ( ) -> Element < ' static , cosmic:: Action < Message > > > ,
362+ ) )
366363 }
367364
368365 pub fn activate ( & mut self ) -> Task < Message > {
@@ -408,10 +405,6 @@ impl CosmicAppLibrary {
408405 }
409406
410407 fn handle_overlap ( & mut self ) -> Task < Message > {
411- if !matches ! ( self . surface_state, SurfaceState :: Visible ) {
412- return Task :: none ( ) ;
413- }
414-
415408 let mid_height = self . size . height / 2. ;
416409 self . margin = 0. ;
417410
@@ -1222,7 +1215,11 @@ impl cosmic::Application for CosmicAppLibrary {
12221215 }
12231216 Message :: Opened ( size, window_id) => {
12241217 let mut tasks = Vec :: new ( ) ;
1225- if self . dummy_id . is_none ( ) {
1218+ if let Some ( dummy) = self . dummy_id
1219+ && window_id == dummy
1220+ {
1221+ tasks. push ( overlap_notify ( window_id, true ) ) ;
1222+ } else if self . dummy_id . is_none ( ) {
12261223 tasks. push ( overlap_notify ( SurfaceId :: RESERVED , true ) ) ;
12271224 }
12281225 if window_id == SurfaceId :: RESERVED {
@@ -1247,11 +1244,11 @@ impl cosmic::Application for CosmicAppLibrary {
12471244 exclusive,
12481245 ..
12491246 } => {
1250- if self . needs_clear {
1251- self . needs_clear = false ;
1252- self . overlap . clear ( ) ;
1253- }
12541247 if exclusive > 0 || namespace == "Dock" || namespace == "Panel" {
1248+ if self . needs_clear {
1249+ self . needs_clear = false ;
1250+ self . overlap . clear ( ) ;
1251+ }
12551252 self . overlap . insert ( identifier, logical_rect) ;
12561253 }
12571254 return self . handle_overlap ( ) ;
0 commit comments