diff --git a/learning-rust4.4/icon.svg.import b/learning-rust4.4/icon.svg.import index e974ee3..0ce7ef0 100644 --- a/learning-rust4.4/icon.svg.import +++ b/learning-rust4.4/icon.svg.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cnyljy7e3rf70" +uid="uid://b2u3ggnem2sce" path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" metadata={ "vram_texture": false diff --git a/learning-rust4.4/root.gd b/learning-rust4.4/root.gd index 702d7ec..e2992b9 100644 --- a/learning-rust4.4/root.gd +++ b/learning-rust4.4/root.gd @@ -3,8 +3,14 @@ extends Node2D func _on_button_pressed() -> void: print("Starting request in godot") - $XdgPortals.request_screencast() + await $ScreencastRunner.request_capture() + print("awaiting result") + await $ScreencastRunner.screencast_result -func _on_xdg_portals_screencast_sucess(pipewire_node_id: int) -> void: - print("Stream id in godot: ", pipewire_node_id) +func _on_screencast_runner_screencast_failure(reason: String) -> void: + push_warning("Screencast failed, ", reason) + + +func _on_screencast_runner_screencast_sucess(pipewire_node_id: int) -> void: + print("Screencast success: ", pipewire_node_id) diff --git a/learning-rust4.4/root.tscn b/learning-rust4.4/root.tscn index e27f8e1..ccf815e 100644 --- a/learning-rust4.4/root.tscn +++ b/learning-rust4.4/root.tscn @@ -10,7 +10,8 @@ offset_right = 8.0 offset_bottom = 8.0 text = "Request" -[node name="XdgPortals" type="XdgPortals" parent="."] +[node name="ScreencastRunner" type="ScreencastRunner" parent="."] [connection signal="pressed" from="Button" to="." method="_on_button_pressed"] -[connection signal="screencast_sucess" from="XdgPortals" to="." method="_on_xdg_portals_screencast_sucess"] +[connection signal="screencast_failure" from="ScreencastRunner" to="." method="_on_screencast_runner_screencast_failure"] +[connection signal="screencast_sucess" from="ScreencastRunner" to="." method="_on_screencast_runner_screencast_sucess"]