summaryrefslogtreecommitdiffstats
path: root/scene/main/viewport.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/viewport.h')
-rw-r--r--scene/main/viewport.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 0d31c07e57..edacee2d88 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -281,7 +281,7 @@ private:
bool disable_3d = false;
- void _propagate_viewport_notification(Node *p_node, int p_what);
+ static void _propagate_drag_notification(Node *p_node, int p_what);
void _update_global_transform();
@@ -349,9 +349,7 @@ private:
Ref<Texture2D> vrs_texture;
struct GUI {
- bool forced_mouse_focus = false; //used for menu buttons
bool mouse_in_viewport = false;
- bool key_event_accepted = false;
HashMap<int, ObjectID> touch_focus;
Control *mouse_focus = nullptr;
Control *mouse_click_grabber = nullptr;
@@ -363,7 +361,6 @@ private:
Window *subwindow_over = nullptr; // mouse_over and subwindow_over are mutually exclusive. At all times at least one of them is nullptr.
Window *windowmanager_window_over = nullptr; // Only used in root Viewport.
Control *drag_mouse_over = nullptr;
- Vector2 drag_mouse_over_pos;
Control *tooltip_control = nullptr;
Window *tooltip_popup = nullptr;
Label *tooltip_label = nullptr;
@@ -372,7 +369,7 @@ private:
Point2 last_mouse_pos;
Point2 drag_accum;
bool drag_attempted = false;
- Variant drag_data;
+ Variant drag_data; // Only used in root-Viewport and SubViewports, that are not children of a SubViewportContainer.
ObjectID drag_preview_id;
Ref<SceneTreeTimer> tooltip_timer;
double tooltip_delay = 0.0;
@@ -380,8 +377,10 @@ private:
List<Control *> roots;
HashSet<ObjectID> canvas_parents_with_dirty_order;
int canvas_sort_index = 0; //for sorting items with canvas as root
- bool dragging = false;
+ bool dragging = false; // Is true in the viewport in which dragging started while dragging is active.
+ bool global_dragging = false; // Is true while dragging is active. Only used in root-Viewport and SubViewports that are not children of a SubViewportContainer.
bool drag_successful = false;
+ Control *target_control = nullptr; // Control that the mouse is over in the innermost nested Viewport. Only used in root-Viewport and SubViewports, that are not children of a SubViewportContainer.
bool embed_subwindows_hint = false;
Window *subwindow_focused = nullptr;
@@ -402,14 +401,14 @@ private:
bool disable_input = false;
- bool _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
+ void _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
void _gui_call_notification(Control *p_control, int p_what);
void _gui_sort_roots();
Control *_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform);
void _gui_input_event(Ref<InputEvent> p_event);
- void _perform_drop(Control *p_control = nullptr, Point2 p_pos = Point2());
+ void _perform_drop(Control *p_control = nullptr);
void _gui_cleanup_internal_state(Ref<InputEvent> p_event);
void _push_unhandled_input_internal(const Ref<InputEvent> &p_event);
@@ -662,8 +661,6 @@ public:
Viewport *get_parent_viewport() const;
Window *get_base_window() const;
- void pass_mouse_focus_to(Viewport *p_viewport, Control *p_control);
-
void set_canvas_cull_mask(uint32_t p_layers);
uint32_t get_canvas_cull_mask() const;
@@ -675,9 +672,9 @@ public:
Transform2D get_screen_transform() const;
virtual Transform2D get_screen_transform_internal(bool p_absolute_position = false) const;
virtual Transform2D get_popup_base_transform() const { return Transform2D(); }
- virtual bool is_directly_attached_to_screen() const { return false; };
- virtual bool is_attached_in_viewport() const { return false; };
- virtual bool is_sub_viewport() const { return false; };
+ virtual Viewport *get_section_root_viewport() const { return nullptr; }
+ virtual bool is_attached_in_viewport() const { return false; }
+ virtual bool is_sub_viewport() const { return false; }
private:
// 2D audio, camera, and physics. (don't put World2D here because World2D is needed for Control nodes).
@@ -839,9 +836,9 @@ public:
virtual Transform2D get_screen_transform_internal(bool p_absolute_position = false) const override;
virtual Transform2D get_popup_base_transform() const override;
- virtual bool is_directly_attached_to_screen() const override;
+ virtual Viewport *get_section_root_viewport() const override;
virtual bool is_attached_in_viewport() const override;
- virtual bool is_sub_viewport() const override { return true; };
+ virtual bool is_sub_viewport() const override { return true; }
void _validate_property(PropertyInfo &p_property) const;
SubViewport();