@@ -82,6 +82,7 @@ use smithay::wayland::pointer_constraints::{with_pointer_constraint, PointerCons
82
82
use smithay:: wayland:: pointer_gestures:: PointerGesturesState ;
83
83
use smithay:: wayland:: presentation:: PresentationState ;
84
84
use smithay:: wayland:: relative_pointer:: RelativePointerManagerState ;
85
+ use smithay:: wayland:: seat:: WaylandFocus ;
85
86
use smithay:: wayland:: security_context:: SecurityContextState ;
86
87
use smithay:: wayland:: selection:: data_device:: { set_data_device_selection, DataDeviceState } ;
87
88
use smithay:: wayland:: selection:: primary_selection:: PrimarySelectionState ;
@@ -3154,16 +3155,13 @@ impl Niri {
3154
3155
// However, this should probably be restricted to sending frame callbacks to more surfaces,
3155
3156
// to err on the safe side.
3156
3157
self . send_frame_callbacks ( output) ;
3158
+ #[ cfg( feature = "xdp-gnome-screencast" ) ]
3159
+ self . send_frame_callbacks_for_cast ( output) ;
3157
3160
backend. with_primary_renderer ( |renderer| {
3158
3161
#[ cfg( feature = "xdp-gnome-screencast" ) ]
3159
3162
{
3160
3163
// Render and send to PipeWire screencast streams.
3161
3164
self . render_for_screen_cast ( renderer, output, target_presentation_time) ;
3162
-
3163
- // FIXME: when a window is hidden, it should probably still receive frame callbacks
3164
- // and get rendered for screen cast. This is currently
3165
- // unimplemented, but happens to work by chance, since output
3166
- // redrawing is more eager than it should be.
3167
3165
self . render_windows_for_screen_cast ( renderer, output, target_presentation_time) ;
3168
3166
}
3169
3167
@@ -3562,6 +3560,37 @@ impl Niri {
3562
3560
}
3563
3561
}
3564
3562
3563
+ #[ cfg( feature = "xdp-gnome-screencast" ) ]
3564
+ fn send_frame_callbacks_for_cast ( & self , output : & Output ) {
3565
+ let _span = tracy_client:: span!( "Niri::send_frame_callbacks_for_cast" ) ;
3566
+ let frame_callback_time = get_monotonic_time ( ) ;
3567
+
3568
+ for mapped in self . layout . windows_for_output ( output) {
3569
+ for cast in & self . casts {
3570
+ if !cast. is_active . get ( ) {
3571
+ continue ;
3572
+ }
3573
+ let CastTarget :: Window { id } = cast. target else {
3574
+ continue ;
3575
+ } ;
3576
+ if u64:: from ( mapped. id ( ) . get ( ) ) != id {
3577
+ continue ;
3578
+ } ;
3579
+ let Some ( surface) = mapped. window . wl_surface ( ) else {
3580
+ continue ;
3581
+ } ;
3582
+
3583
+ send_frames_surface_tree (
3584
+ surface. as_ref ( ) ,
3585
+ output,
3586
+ frame_callback_time,
3587
+ FRAME_CALLBACK_THROTTLE ,
3588
+ |_, _| Some ( output. clone ( ) ) ,
3589
+ ) ;
3590
+ }
3591
+ }
3592
+ }
3593
+
3565
3594
pub fn take_presentation_feedbacks (
3566
3595
& mut self ,
3567
3596
output : & Output ,
0 commit comments