diff --git a/.github/workflows/godot.yml b/.github/workflows/godot.yml index 0184ddd..eaeccba 100644 --- a/.github/workflows/godot.yml +++ b/.github/workflows/godot.yml @@ -24,20 +24,16 @@ jobs: with: dotnet-version: 6.0.x - - name: Build - run: dotnet build - - name: Download Godot run: | cd $HOME wget https://github.com/godotengine/godot/releases/download/${{ env.gdver }}/Godot_v${{ env.gdver }}_mono_linux_x86_64.zip unzip Godot_v${{ env.gdver }}_mono_linux_x86_64.zip - # HACK: no better solution for now - - name: Import resources + - name: Import resources and build run: | export gdbin=$HOME/Godot_v${{ env.gdver }}_mono_linux_x86_64/Godot_v${{ env.gdver }}_mono_linux.x86_64 - timeout 45 $gdbin --headless --editor || true + $gdbin --headless --build-solutions --quit # TODO: run tests with the exported binary - name: Test diff --git a/addons/imgui-godot/ImGuiGodot/Internal/Input.cs b/addons/imgui-godot/ImGuiGodot/Internal/Input.cs index 9a94412..d1f5d24 100644 --- a/addons/imgui-godot/ImGuiGodot/Internal/Input.cs +++ b/addons/imgui-godot/ImGuiGodot/Internal/Input.cs @@ -12,13 +12,15 @@ internal sealed class Input private Vector2 _mouseWheel = Vector2.Zero; private ImGuiMouseCursor _currentCursor = ImGuiMouseCursor.None; private readonly Window _mainWindow; + private readonly bool _hasMouse; public Input(Window mainWindow) { _mainWindow = mainWindow; + _hasMouse = DisplayServer.HasFeature(DisplayServer.Feature.Mouse); } - public void Update(ImGuiIOPtr io) + private void UpdateMouse(ImGuiIOPtr io) { var mousePos = DisplayServer.MouseGetPosition(); @@ -66,6 +68,12 @@ public void Update(ImGuiIOPtr io) { _currentCursor = ImGuiMouseCursor.None; } + } + + public void Update(ImGuiIOPtr io) + { + if (_hasMouse) + UpdateMouse(io); CurrentSubViewport = null; }