godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.14k stars 20.21k forks source link

Godot editor reporting as an instance of Godot_Engine instead of Godot_Editor when creating a blank project #52989

Open Linkandzelda opened 2 years ago

Linkandzelda commented 2 years ago

Godot version

3.3.3.stable.arch_linux + 3.4.beta5.official.dd0ee4872

System information

Arch Linux

Issue description

Trying to get the game window when played to be a floating window, but for all other windows to be tiled when using i3wm. This lead me to discover that when I create and load a blank project the Godot Editor window identifies as instance Godot_Engine, which is the same as the window when playing the game. This leads to it not being possible to create a simple rule in i3wm to set all instances of Godot_Engine to floating, because in this case it catches the editor too.

However I created a project from a template, and that project correctly reports as Godot_Editor. I am unsure what makes it report this way exactly.

Output of xprop for the test project:

WM_CLASS(STRING) = "Godot_Engine", "Godot"
WM_NAME(STRING) = "Godot Engine - Test Project 2"

Output of xprop for the template project:

WM_CLASS(STRING) = "Godot_Editor", "Godot"
WM_NAME(STRING) = "Godot Engine - Dodge the Creeps - Main.tscn"

Steps to reproduce

Create new project, and check the editor window with xprop command.

Minimal reproduction project

No response

Linkandzelda commented 2 years ago

It appears to be when no main scene is set on the project. Setting a main scene and reloading the project correctly identifies it as an instance of Godot_Editor.

akien-mga commented 2 years ago

Indeed, the context is set here: https://github.com/godotengine/godot/blob/e92064fbef13e651722ee47ae826de080757bc2e/main/main.cpp#L2364

But this code only rund when game_path is defined, which happens only if there's a main scene or a command line path to a scene.