Update sample project
This commit is contained in:
parent
3df7a93022
commit
da436d5814
3 changed files with 13 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue