summaryrefslogtreecommitdiffstats
path: root/scene/main/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r--scene/main/window.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 586a88ea85..0ccc056a8d 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -724,6 +724,9 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) {
if (!is_inside_tree()) {
return;
}
+ // Ensure keeping the order of input events and window events when input events are buffered or accumulated.
+ Input::get_singleton()->flush_buffered_events();
+
Window *root = get_tree()->get_root();
if (!root->gui.windowmanager_window_over) {
#ifdef DEV_ENABLED
@@ -1212,10 +1215,10 @@ void Window::set_force_native(bool p_force_native) {
if (force_native == p_force_native) {
return;
}
- force_native = p_force_native;
if (is_visible() && !is_in_edited_scene_root()) {
- WARN_PRINT("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
+ ERR_FAIL_MSG("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
}
+ force_native = p_force_native;
}
bool Window::get_force_native() const {
@@ -1576,6 +1579,7 @@ bool Window::_can_consume_input_events() const {
}
void Window::_window_input(const Ref<InputEvent> &p_ev) {
+ ERR_MAIN_THREAD_GUARD;
if (EngineDebugger::is_active()) {
// Quit from game window using the stop shortcut (F8 by default).
// The custom shortcut is provided via environment variable when running from the editor.
@@ -2717,9 +2721,6 @@ void Window::_update_mouse_over(Vector2 p_pos) {
if (is_embedded()) {
mouse_in_window = true;
_propagate_window_notification(this, NOTIFICATION_WM_MOUSE_ENTER);
- } else {
- // Prevent update based on delayed InputEvents from DisplayServer.
- return;
}
}