Repository navigation
Conversation
akien-mga
left a comment
There was a problem hiding this comment.
Makes sense. The headless window size being hardcoded to 64x64 is something I've been struggling with at times for some automated testing scenarios.
I guess the 64x64 and 1920x1080 defaults are arbitrary though, should we align them somehow with the non dummy/mock servers?
|
I agree with @akien-mga . One way we could do is to use parameters, which are passed to the DisplayServer constructor. I've checked, X11 and Wayland have quite a few parameters passed to their constructors, including |
|
Maybe, but this might break something that expect it ro be 64x64, so it's probably better to do for 4.9. |
ELginas
left a comment
There was a problem hiding this comment.
Does fix the repro from the issue, only I was not able to reproduce failing tests. New PR behaviour is slightly different than from 4.7.2, just something to keep in mind, but I hope that's not an issue.
> godot --path ~/pr/godot-demos --headless
Godot Engine v4.7.2.stable.arch_linux.ed1daf0bf (2026-08-17 01:18:38 UTC) - https://godotengine.org
version: 4.7.2-stable (arch_linux)
DisplayServer.window_get_size: (0, 0)
root.size before: (64, 64)
root.size after setting 1280x720: (1280, 720)
root.size after window_set_size + 1 frame: (1280, 720)
visible rect: [P: (0.0, 0.0), S: (1280.0, 720.0)]
canvas transform: [X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
full-rect Control size: (0.0, 0.0)
Control global xform affine_inverse: [X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
> ./bin/godot.linuxbsd.editor.dev.x86_64.llvm --path ~/pr/godot-demos --headless
Godot Engine v4.8.beta.custom_build.98d5be8a2 (2026-11-25 19:03:35 UTC) - https://godotengine.org
version: 4.8-beta (custom_build)
DisplayServer.window_get_size: (64, 64)
root.size before: (64, 64)
root.size after setting 1280x720: (1280, 720)
root.size after window_set_size + 1 frame: (1280, 720)
visible rect: [P: (0.0, 0.0), S: (1280.0, 720.0)]
canvas transform: [X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
full-rect Control size: (0.0, 0.0)
Control global xform affine_inverse: [X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)]
What problem(s) does this PR solve?
Additional information
Moves window size code from
DisplayServerMocktoDisplayServerHeadless.