[macOS] Use native window drag for the custom editor title bars.

This commit is contained in:
Pāvels Nadtočajevs
2024-11-24 19:27:08 +02:00
parent d741a646a5
commit b248d66265
6 changed files with 36 additions and 2 deletions
+6 -2
View File
@@ -54,8 +54,12 @@ void EditorTitleBar::gui_input(const Ref<InputEvent> &p_event) {
if (w) {
if (mb->get_button_index() == MouseButton::LEFT) {
if (mb->is_pressed()) {
click_pos = DisplayServer::get_singleton()->mouse_get_position() - w->get_position();
moving = true;
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_WINDOW_DRAG)) {
DisplayServer::get_singleton()->window_start_drag(w->get_window_id());
} else {
click_pos = DisplayServer::get_singleton()->mouse_get_position() - w->get_position();
moving = true;
}
} else {
moving = false;
}