summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-16 09:23:40 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-16 09:23:40 +0200
commitd79040e7eb011e94857b7d6d7725267120f84c3c (patch)
treee3c11e1907d711b5a0cf632db95173f296368da0 /scene/main
parentd347d2f5853303c91eee51079e2042657d156e83 (diff)
parent06b86fad0d7d21d5c61da9ff4896c768ba6c1679 (diff)
Merge pull request #65496 from MinusKube/popup-capture-mouse-bug
Fix MOUSE_MODE_CAPTURED not working correctly with popups
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.h2
-rw-r--r--scene/main/window.cpp12
-rw-r--r--scene/main/window.h2
3 files changed, 1 insertions, 15 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index afea3ea56c..c7c474c70f 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -568,7 +568,7 @@ public:
bool is_input_disabled() const;
Vector2 get_mouse_position() const;
- virtual void warp_mouse(const Vector2 &p_position);
+ void warp_mouse(const Vector2 &p_position);
void set_physics_object_picking(bool p_enable);
bool get_physics_object_picking();
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index f481cd8346..ebe9587b31 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -986,18 +986,6 @@ DisplayServer::WindowID Window::get_window_id() const {
return window_id;
}
-void Window::warp_mouse(const Vector2 &p_position) {
- Transform2D xform = get_screen_transform();
- Vector2 gpos = xform.xform(p_position);
-
- if (transient_parent && !transient_parent->is_embedding_subwindows()) {
- Transform2D window_trans = Transform2D().translated(get_position() + (transient_parent->get_visible_rect().size - transient_parent->get_real_size()));
- gpos = window_trans.xform(gpos);
- }
-
- Input::get_singleton()->warp_mouse(gpos);
-}
-
void Window::set_wrap_controls(bool p_enable) {
wrap_controls = p_enable;
if (wrap_controls) {
diff --git a/scene/main/window.h b/scene/main/window.h
index 8113117103..8c6ca65436 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -254,8 +254,6 @@ public:
void set_use_font_oversampling(bool p_oversampling);
bool is_using_font_oversampling() const;
- void warp_mouse(const Vector2 &p_position) override;
-
void set_wrap_controls(bool p_enable);
bool is_wrapping_controls() const;
void child_controls_changed();