aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2017-04-08 11:28:25 +0200
committerRémi Verschelde2017-04-08 11:28:25 +0200
commit7f32db5ac9143deb2afe918fd3aee791c101481e (patch)
tree5e36bf67a5443b5d2028c57ec19e49145762088a
parent2491754de799ecb886c49e757332c1f0fc6f9478 (diff)
downloadgodot-7f32db5ac9143deb2afe918fd3aee791c101481e.tar.gz
godot-7f32db5ac9143deb2afe918fd3aee791c101481e.tar.zst
godot-7f32db5ac9143deb2afe918fd3aee791c101481e.zip
Revert "8145 - Mouse Position is unknown until first mouse event on X11 & Win"
This reverts commit e5d63aaece5310aee39ba1da9a595fc7a8410a50. Same reasoning as #8291.
-rw-r--r--platform/windows/os_windows.cpp3
-rw-r--r--platform/x11/os_x11.cpp9
2 files changed, 1 insertions, 11 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index d74369f46..37bfb68b7 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2177,9 +2177,6 @@ void OS_Windows::run() {
if (!main_loop)
return;
- // Process all events before the main initialization so the cursor will get initialized properly
- process_events(); // get rid of pending events
-
main_loop->init();
uint64_t last_ticks = get_ticks_usec();
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 002a890e0..82cb1a025 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1283,12 +1283,8 @@ void OS_X11::process_xevents() {
if (main_loop && mouse_mode != MOUSE_MODE_CAPTURED)
main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
- if (input) {
- // Update mouse position. It is triggered before mouse motion.
- Point2i pos(event.xmotion.x, event.xmotion.y);
- input->set_mouse_pos(pos);
+ if (input)
input->set_mouse_in_window(true);
- }
} break;
case FocusIn:
minimized = false;
@@ -1898,9 +1894,6 @@ void OS_X11::run() {
if (!main_loop)
return;
- // Process all events before the main initialization so the cursor will get initialized properly
- process_xevents(); // get rid of pending events
-
main_loop->init();
// uint64_t last_ticks=get_ticks_usec();