Repository: godotengine/godot (language: cpp)

Issue:
Embedded game draws over expanded bottom panel
### Tested versions

- Reproducible in: 4.4-beta3

### System information

Windows 11, Godot 4.4-beta3, Vulkan (Forward+)

### Issue description

If you had expanded bottom panel when you clicked `run project` game view draws over expanded panel

<img src="https://github.com/user-attachments/assets/05834839-7349-4156-94cd-2ddf4bc6b356" width="400px" />

Edit:
For my example I have set Editor settings > Run > Bottom Panel > Action on Play: Do Nothing.

For any other option as long as bottom panel is expanded even if it was un toggled/invisible it becomes toggled on, expands and game draws over it.

Expected behaviour for `Do Nothing` option would be panel to stay expanded and just don't draw game over it

For `Open Output`/`Open Debugger` probably to split the screen in half 🤷‍♂️

### Steps to reproduce

1) Expand any bottom panel (by clicking last icon right on bottom panel or Shift + F12 win)
2) Run the project

### Minimal reproduction project (MRP)

.


Discussion / hints:
Thanks for reporting the issue. I'm able to reproduce and I'll look into it.
@Hilderin Thanks!
Do you envision using the editor with the expanded bottom panel and not game window visible anywhere, or were you just surprised to see the misplaced overlay?

#102921 seems to implement support for the former use case but I'm not sure in which scenario one would want to start playing the game without being able to interact with it (aside from maybe profiling the first frames in auto-play).
@akien-mga misplaced overlay was also a factor but, I think I encountered this problem when I was trying to debug scene "setup" code (in `_ready` function)

Not all scenes are visual components right? it might be some system, saving on file, fetching data from network, checking game state, playing audio... when you run/debug those kind of scenes you wouldn't need scene view at all? **but I'm pretty new to godot so I might be missing/not understanding something.**

So my answer would be: I can rarely imagine scenario where I would start playing game without wanting to interact with it, but I can imagine running individual scenes that doesn't include visual/interactive nodes, during development/debugging, with hidden scene view so I maximize debugging screen space.
That makes sense, thanks for the details!

I tested and I don't seem to reproduce the issue on Linux (Fedora 41 KDE Plasma), so this may be Windows specific. Seems like @bruvzg also didn't reproduce on macOS.
> Seems like @bruvzg also didn't reproduce on macOS.

On Windows 11, there's no support for game embedding on macOS.
I was able to reproduce on Ubuntu 24.10 Gnome. I did not test on Fedora.

That being said, the PR as a lot of code for this kind of issue. I suggest to create another PR that only reset the bottom panel to it's normal size on game start when the embeddeing is enabled in the editor and te bottom panel is fully expanded. It should be pretty easy and should not have any other side effect that close of a release. We could check later the perfect solution if needed.

Fix patch:
diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp
index a1bee6d54c37..e984f196fbb1 100644
--- a/editor/gui/editor_bottom_panel.cpp
+++ b/editor/gui/editor_bottom_panel.cpp
@@ -293,6 +293,10 @@ void EditorBottomPanel::toggle_last_opened_bottom_panel() {
 	}
 }
 
+void EditorBottomPanel::set_expanded(bool p_expanded) {
+	expand_button->set_pressed(p_expanded);
+}
+
 EditorBottomPanel::EditorBottomPanel() {
 	item_vbox = memnew(VBoxContainer);
 	add_child(item_vbox);
diff --git a/editor/gui/editor_bottom_panel.h b/editor/gui/editor_bottom_panel.h
index c81d7da6fa8b..dd8eb0ad44f5 100644
--- a/editor/gui/editor_bottom_panel.h
+++ b/editor/gui/editor_bottom_panel.h
@@ -86,6 +86,7 @@ class EditorBottomPanel : public PanelContainer {
 	void move_item_to_end(Control *p_item);
 	void hide_bottom_panel();
 	void toggle_last_opened_bottom_panel();
+	void set_expanded(bool p_expanded);
 
 	EditorBottomPanel();
 };
diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp
index efc5719d2def..6318bf6d1645 100644
--- a/editor/plugins/game_view_plugin.cpp
+++ b/editor/plugins/game_view_plugin.cpp
@@ -42,6 +42,7 @@
 #include "editor/editor_node.h"
 #include "editor/editor_settings.h"
 #include "editor/editor_string_names.h"
+#include "editor/gui/editor_bottom_panel.h"
 #include "editor/gui/editor_run_bar.h"
 #include "editor/plugins/embedded_process.h"
 #include "editor/themes/editor_scale.h"
@@ -300,6 +301,8 @@ void GameView::_play_pressed() {
 		_update_embed_window_size();
 		if (!window_wrapper->get_window_enabled()) {
 			EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_GAME);
+			// Reset the normal size of the bottom panel when fully expanded.
+			EditorNode::get_singleton()->get_bottom_panel()->set_expanded(false);
 			embedded_process->grab_focus();
 		}
 		embedded_process->embed_process(current_process_id);


Test patch: