@@ -130,7 +130,6 @@ impl TreeQueue {
130130pub struct TilingLayout {
131131 output : Output ,
132132 queue : TreeQueue ,
133- pending_blockers : Vec < TilingBlocker > ,
134133 placeholder_id : Id ,
135134 swapping_stack_surface_id : Id ,
136135 last_overview_hover : Option < ( Option < Instant > , TargetZone ) > ,
@@ -353,7 +352,6 @@ impl TilingLayout {
353352 animation_start : None ,
354353 } ,
355354 output : output. clone ( ) ,
356- pending_blockers : Vec :: new ( ) ,
357355 placeholder_id : Id :: new ( ) ,
358356 swapping_stack_surface_id : Id :: new ( ) ,
359357 last_overview_hover : None ,
@@ -2345,8 +2343,20 @@ impl TilingLayout {
23452343
23462344 pub fn update_animation_state ( & mut self ) -> HashMap < ClientId , Client > {
23472345 let mut clients = HashMap :: new ( ) ;
2348- for blocker in self . pending_blockers . drain ( ..) {
2349- clients. extend ( blocker. signal_ready ( ) ) ;
2346+ let mut ready_trees = 0 ;
2347+ for ( _, _, blocker) in self . queue . trees . iter ( ) . skip ( 1 ) {
2348+ if let Some ( blocker) = blocker. as_ref ( ) {
2349+ if blocker. is_processed ( ) {
2350+ ready_trees += 1 ;
2351+ }
2352+ if blocker. is_ready ( ) {
2353+ clients. extend ( blocker. clients ( ) ) ;
2354+ continue ;
2355+ }
2356+ break ;
2357+ } else {
2358+ ready_trees += 1 ;
2359+ }
23502360 }
23512361
23522362 if let Some ( start) = self . queue . animation_start {
@@ -2361,6 +2371,7 @@ impl TilingLayout {
23612371 {
23622372 let _ = self . queue . animation_start . take ( ) ;
23632373 let _ = self . queue . trees . pop_front ( ) ;
2374+ ready_trees -= 1 ;
23642375 let front = self . queue . trees . front_mut ( ) . unwrap ( ) ;
23652376 if let Some ( root_id) = front. 0 . root_node_id ( ) {
23662377 for node in front
@@ -2383,28 +2394,12 @@ impl TilingLayout {
23832394 }
23842395 }
23852396
2386- let ready_trees = self
2387- . queue
2388- . trees
2389- . iter ( )
2390- . skip ( 1 )
2391- . take_while ( |( _, _, blocker) | {
2392- blocker
2393- . as_ref ( )
2394- . map ( |blocker| blocker. is_ready ( ) && blocker. is_signaled ( ) )
2395- . unwrap_or ( true )
2396- } )
2397- . count ( ) ;
2398-
23992397 // merge
24002398 let other_duration = if ready_trees > 1 {
24012399 self . queue
24022400 . trees
24032401 . drain ( 1 ..ready_trees)
2404- . fold ( None , |res, ( _, duration, blocker) | {
2405- if let Some ( blocker) = blocker {
2406- clients. extend ( blocker. signal_ready ( ) ) ;
2407- }
2402+ . fold ( None , |res, ( _, duration, _) | {
24082403 Some (
24092404 res. map ( |old_duration : Duration | old_duration. max ( duration) )
24102405 . unwrap_or ( duration) ,
@@ -2416,13 +2411,10 @@ impl TilingLayout {
24162411
24172412 // start
24182413 if ready_trees > 0 {
2419- let ( _, duration, blocker ) = self . queue . trees . get_mut ( 1 ) . unwrap ( ) ;
2414+ let ( _, duration, _ ) = self . queue . trees . get_mut ( 1 ) . unwrap ( ) ;
24202415 * duration = other_duration
24212416 . map ( |other| other. max ( * duration) )
24222417 . unwrap_or ( * duration) ;
2423- if let Some ( blocker) = blocker {
2424- clients. extend ( blocker. signal_ready ( ) ) ;
2425- }
24262418 self . queue . animation_start = Some ( Instant :: now ( ) ) ;
24272419 }
24282420
0 commit comments