@@ -34,7 +34,8 @@ use smithay::{
3434 space:: SpaceElement ,
3535 utils:: {
3636 surface_presentation_feedback_flags_from_states, surface_primary_scanout_output,
37- take_presentation_feedback_surface_tree, OutputPresentationFeedback ,
37+ take_presentation_feedback_surface_tree, with_surfaces_surface_tree,
38+ OutputPresentationFeedback ,
3839 } ,
3940 LayerSurface , PopupKind , WindowSurface , WindowSurfaceType ,
4041 } ,
@@ -51,7 +52,8 @@ use smithay::{
5152 } ,
5253 utils:: { IsAlive , Logical , Point , Rectangle , Serial , Size } ,
5354 wayland:: {
54- compositor:: { with_states, SurfaceAttributes } ,
55+ compositor:: { with_states, SurfaceAttributes , SurfaceData } ,
56+ fifo:: FifoBarrierCachedState ,
5557 seat:: WaylandFocus ,
5658 session_lock:: LockSurface ,
5759 shell:: wlr_layer:: { KeyboardInteractivity , Layer , LayerSurfaceCachedState } ,
@@ -1905,6 +1907,98 @@ impl Shell {
19051907 } )
19061908 }
19071909
1910+ pub fn signal_fifos ( & self , output : & Output ) {
1911+ fn processor ( _surface : & WlSurface , states : & SurfaceData ) {
1912+ let fifo_barrier = states
1913+ . cached_state
1914+ . get :: < FifoBarrierCachedState > ( )
1915+ . current ( )
1916+ . barrier
1917+ . take ( ) ;
1918+ if let Some ( fifo_barrier) = fifo_barrier {
1919+ fifo_barrier. signal ( ) ;
1920+ }
1921+ }
1922+
1923+ if let Some ( session_lock) = self . session_lock . as_ref ( ) {
1924+ if let Some ( lock_surface) = session_lock. surfaces . get ( output) {
1925+ with_surfaces_surface_tree ( lock_surface. wl_surface ( ) , processor) ;
1926+ }
1927+ }
1928+
1929+ self . workspaces
1930+ . sets
1931+ . get ( output)
1932+ . unwrap ( )
1933+ . sticky_layer
1934+ . mapped ( )
1935+ . for_each ( |mapped| {
1936+ for ( window, _) in mapped. windows ( ) {
1937+ window. 0 . with_surfaces ( processor) ;
1938+ }
1939+ } ) ;
1940+
1941+ for workspace in self . workspaces . spaces_for_output ( output) {
1942+ if let Some ( window) = workspace. get_fullscreen ( ) {
1943+ window. 0 . with_surfaces ( processor) ;
1944+ }
1945+ workspace. mapped ( ) . for_each ( |mapped| {
1946+ for ( window, _) in mapped. windows ( ) {
1947+ window. 0 . with_surfaces ( processor) ;
1948+ }
1949+ } ) ;
1950+ workspace. minimized_windows . iter ( ) . for_each ( |m| {
1951+ for window in m. windows ( ) {
1952+ window. 0 . with_surfaces ( processor) ;
1953+ }
1954+ } ) ;
1955+ }
1956+
1957+ let map = smithay:: desktop:: layer_map_for_output ( output) ;
1958+ for layer_surface in map. layers ( ) {
1959+ layer_surface. with_surfaces ( processor) ;
1960+ }
1961+
1962+ self . override_redirect_windows . iter ( ) . for_each ( |or| {
1963+ // Find output the override redirect window overlaps the most with
1964+ let or_geo = or. geometry ( ) . as_global ( ) ;
1965+ let max_intersect_output = self
1966+ . outputs ( )
1967+ . filter_map ( |o| Some ( ( o, o. geometry ( ) . intersection ( or_geo) ?) ) )
1968+ . max_by_key ( |( _, intersection) | intersection. size . w * intersection. size . h )
1969+ . map ( |( o, _) | o) ;
1970+ if max_intersect_output == Some ( output) {
1971+ if let Some ( wl_surface) = or. wl_surface ( ) {
1972+ with_surfaces_surface_tree ( & wl_surface, processor) ;
1973+ }
1974+ }
1975+ } ) ;
1976+
1977+ for seat in self
1978+ . seats
1979+ . iter ( )
1980+ . filter ( |seat| & seat. active_output ( ) == output)
1981+ {
1982+ let cursor_status = seat. cursor_image_status ( ) ;
1983+
1984+ if let CursorImageStatus :: Surface ( wl_surface) = cursor_status {
1985+ with_surfaces_surface_tree ( & wl_surface, processor) ;
1986+ }
1987+
1988+ if let Some ( move_grab) = seat. user_data ( ) . get :: < SeatMoveGrabState > ( ) {
1989+ if let Some ( grab_state) = move_grab. lock ( ) . unwrap ( ) . as_ref ( ) {
1990+ for ( window, _) in grab_state. element ( ) . windows ( ) {
1991+ window. 0 . with_surfaces ( processor) ;
1992+ }
1993+ }
1994+ }
1995+
1996+ if let Some ( icon) = get_dnd_icon ( seat) {
1997+ with_surfaces_surface_tree ( & icon. surface , processor) ;
1998+ }
1999+ }
2000+ }
2001+
19082002 pub fn workspace_for_surface ( & self , surface : & WlSurface ) -> Option < ( WorkspaceHandle , Output ) > {
19092003 match self . outputs ( ) . find ( |o| {
19102004 let map = layer_map_for_output ( o) ;
0 commit comments