Effective DisplayServer separation, rename X11 -> LinuxBSD
This commit is contained in:
parent
4396e98834
commit
f8a79a97c7
83 changed files with 1304 additions and 5378 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include "editor/editor_node.h"
|
||||
#include "scene/debugger/scene_debugger.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
EditorDebuggerTree::EditorDebuggerTree() {
|
||||
set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
|
|
@ -257,7 +258,7 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) {
|
|||
text = text.substr(slash + 1);
|
||||
}
|
||||
}
|
||||
OS::get_singleton()->set_clipboard(text);
|
||||
DisplayServer::get_singleton()->clipboard_set(text);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "scene/gui/texture_button.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
using CameraOverride = EditorDebuggerNode::CameraOverride;
|
||||
|
||||
|
|
@ -73,7 +74,7 @@ void ScriptEditorDebugger::_put_msg(String p_message, Array p_data) {
|
|||
void ScriptEditorDebugger::debug_copy() {
|
||||
String msg = reason->get_text();
|
||||
if (msg == "") return;
|
||||
OS::get_singleton()->set_clipboard(msg);
|
||||
DisplayServer::get_singleton()->clipboard_set(msg);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::debug_skip_breakpoints() {
|
||||
|
|
@ -116,7 +117,7 @@ void ScriptEditorDebugger::debug_continue() {
|
|||
|
||||
// Allow focus stealing only if we actually run this client for security.
|
||||
if (remote_pid && EditorNode::get_singleton()->has_child_process(remote_pid))
|
||||
OS::get_singleton()->enable_for_stealing_focus(remote_pid);
|
||||
DisplayServer::get_singleton()->enable_for_stealing_focus(remote_pid);
|
||||
|
||||
_clear_execution();
|
||||
_put_msg("continue", Array());
|
||||
|
|
@ -253,7 +254,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
|
|||
_update_buttons_state();
|
||||
_set_reason_text(error, MESSAGE_ERROR);
|
||||
emit_signal("breaked", true, can_continue);
|
||||
OS::get_singleton()->move_window_to_foreground();
|
||||
DisplayServer::get_singleton()->window_move_to_foreground();
|
||||
if (error != "") {
|
||||
tabs->set_current_tab(0);
|
||||
}
|
||||
|
|
@ -1420,7 +1421,7 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) {
|
|||
ci = ci->get_next();
|
||||
}
|
||||
|
||||
OS::get_singleton()->set_clipboard(text);
|
||||
DisplayServer::get_singleton()->clipboard_set(text);
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::_tab_changed(int p_tab) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "editor/editor_file_system.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor_scale.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path) {
|
||||
|
||||
|
|
@ -188,7 +189,7 @@ EditorDirDialog::EditorDirDialog() {
|
|||
|
||||
tree->connect("item_activated", callable_mp(this, &EditorDirDialog::_item_activated));
|
||||
|
||||
makedir = add_button(TTR("Create Folder"), OS::get_singleton()->get_swap_ok_cancel(), "makedir");
|
||||
makedir = add_button(TTR("Create Folder"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "makedir");
|
||||
makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir));
|
||||
|
||||
makedialog = memnew(ConfirmationDialog);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "scene/gui/center_container.h"
|
||||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/margin_container.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func = NULL;
|
||||
EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func = NULL;
|
||||
|
|
@ -631,7 +632,7 @@ void EditorFileDialog::_item_menu_id_pressed(int p_option) {
|
|||
|
||||
case ITEM_MENU_COPY_PATH: {
|
||||
Dictionary item_meta = item_list->get_item_metadata(item_list->get_current());
|
||||
OS::get_singleton()->set_clipboard(item_meta["path"]);
|
||||
DisplayServer::get_singleton()->clipboard_set(item_meta["path"]);
|
||||
} break;
|
||||
|
||||
case ITEM_MENU_DELETE: {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
#include "editor/register_exporters.h"
|
||||
#include "editor/run_settings_dialog.h"
|
||||
#include "editor/settings_config_dialog.h"
|
||||
|
||||
#include "servers/display_server.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -179,7 +179,9 @@ void EditorNode::_update_scene_tabs() {
|
|||
|
||||
bool show_rb = EditorSettings::get_singleton()->get("interface/scene_tabs/show_script_button");
|
||||
|
||||
OS::get_singleton()->global_menu_clear("_dock");
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) {
|
||||
DisplayServer::get_singleton()->global_menu_clear("_dock");
|
||||
}
|
||||
|
||||
scene_tabs->clear_tabs();
|
||||
Ref<Texture2D> script_icon = gui_base->get_icon("Script", "EditorIcons");
|
||||
|
|
@ -195,15 +197,19 @@ void EditorNode::_update_scene_tabs() {
|
|||
bool unsaved = (i == current) ? saved_version != editor_data.get_undo_redo().get_version() : editor_data.get_scene_version(i) != 0;
|
||||
scene_tabs->add_tab(editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), icon);
|
||||
|
||||
OS::get_singleton()->global_menu_add_item("_dock", editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), GLOBAL_SCENE, i);
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) {
|
||||
DisplayServer::get_singleton()->global_menu_add_item("_dock", editor_data.get_scene_title(i) + (unsaved ? "(*)" : ""), GLOBAL_SCENE, i);
|
||||
}
|
||||
|
||||
if (show_rb && editor_data.get_scene_root_script(i).is_valid()) {
|
||||
scene_tabs->set_tab_right_button(i, script_icon);
|
||||
}
|
||||
}
|
||||
|
||||
OS::get_singleton()->global_menu_add_separator("_dock");
|
||||
OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant());
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) {
|
||||
DisplayServer::get_singleton()->global_menu_add_separator("_dock");
|
||||
DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant());
|
||||
}
|
||||
|
||||
scene_tabs->set_current_tab(editor_data.get_edited_scene());
|
||||
|
||||
|
|
@ -252,7 +258,7 @@ void EditorNode::_update_title() {
|
|||
if (unsaved_cache)
|
||||
title += " (*)";
|
||||
|
||||
OS::get_singleton()->set_window_title(title);
|
||||
DisplayServer::get_singleton()->window_set_title(title);
|
||||
}
|
||||
|
||||
void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
|
||||
|
|
@ -2537,7 +2543,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
}
|
||||
}
|
||||
|
||||
OS::get_singleton()->request_attention();
|
||||
DisplayServer::get_singleton()->window_request_attention();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2585,13 +2591,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
} break;
|
||||
case SETTINGS_TOGGLE_FULLSCREEN: {
|
||||
|
||||
OS::get_singleton()->set_window_fullscreen(!OS::get_singleton()->is_window_fullscreen());
|
||||
DisplayServer::get_singleton()->window_set_mode(DisplayServer::get_singleton()->window_get_mode() == DisplayServer::WINDOW_MODE_FULLSCREEN ? DisplayServer::WINDOW_MODE_WINDOWED : DisplayServer::WINDOW_MODE_FULLSCREEN);
|
||||
|
||||
} break;
|
||||
case SETTINGS_TOGGLE_CONSOLE: {
|
||||
|
||||
bool was_visible = OS::get_singleton()->is_console_visible();
|
||||
OS::get_singleton()->set_console_visible(!was_visible);
|
||||
bool was_visible = DisplayServer::get_singleton()->is_console_visible();
|
||||
DisplayServer::get_singleton()->console_set_visible(!was_visible);
|
||||
EditorSettings::get_singleton()->set_setting("interface/editor/hide_console_window", was_visible);
|
||||
} break;
|
||||
case EDITOR_SCREENSHOT: {
|
||||
|
|
@ -3937,7 +3943,7 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) {
|
|||
|
||||
void EditorNode::_copy_warning(const String &p_str) {
|
||||
|
||||
OS::get_singleton()->set_clipboard(warning->get_text());
|
||||
DisplayServer::get_singleton()->clipboard_set(warning->get_text());
|
||||
}
|
||||
|
||||
void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) {
|
||||
|
|
@ -5286,7 +5292,7 @@ void EditorNode::_video_driver_selected(int p_which) {
|
|||
|
||||
String driver = video_driver->get_item_metadata(p_which);
|
||||
|
||||
String current = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
|
||||
String current = ""; //OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
|
||||
|
||||
if (driver == current) {
|
||||
return;
|
||||
|
|
@ -5485,11 +5491,18 @@ EditorNode::EditorNode() {
|
|||
|
||||
if (id) {
|
||||
|
||||
if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton()) {
|
||||
bool found_touchscreen = false;
|
||||
for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) {
|
||||
if (DisplayServer::get_singleton()->screen_is_touchscreen(i)) {
|
||||
found_touchscreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_touchscreen && Input::get_singleton()) {
|
||||
//only if no touchscreen ui hint, set emulation
|
||||
id->set_emulate_touch_from_mouse(false); //just disable just in case
|
||||
}
|
||||
id->set_custom_mouse_cursor(RES());
|
||||
DisplayServer::get_singleton()->cursor_set_custom_image(RES());
|
||||
}
|
||||
|
||||
singleton = this;
|
||||
|
|
@ -5518,8 +5531,8 @@ EditorNode::EditorNode() {
|
|||
switch (display_scale) {
|
||||
case 0: {
|
||||
// Try applying a suitable display scale automatically
|
||||
const int screen = OS::get_singleton()->get_current_screen();
|
||||
editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0);
|
||||
const int screen = DisplayServer::get_singleton()->window_get_current_screen();
|
||||
editor_set_scale(DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000 ? 2.0 : 1.0);
|
||||
} break;
|
||||
|
||||
case 1: {
|
||||
|
|
@ -5553,7 +5566,7 @@ EditorNode::EditorNode() {
|
|||
}
|
||||
|
||||
// Define a minimum window size to prevent UI elements from overlapping or being cut off
|
||||
OS::get_singleton()->set_min_window_size(Size2(1024, 600) * EDSCALE);
|
||||
DisplayServer::get_singleton()->window_set_min_size(Size2(1024, 600) * EDSCALE);
|
||||
|
||||
ResourceLoader::set_abort_on_missing_resources(false);
|
||||
FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"));
|
||||
|
|
@ -6257,6 +6270,10 @@ EditorNode::EditorNode() {
|
|||
video_driver->set_disabled(true);
|
||||
right_menu_hb->add_child(video_driver);
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#warning neeeds to be reimplemented
|
||||
#endif
|
||||
#if 0
|
||||
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
|
||||
String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
|
||||
video_driver_current = 0;
|
||||
|
|
@ -6272,7 +6289,7 @@ EditorNode::EditorNode() {
|
|||
}
|
||||
|
||||
_update_video_driver_color();
|
||||
|
||||
#endif
|
||||
video_restart_dialog = memnew(ConfirmationDialog);
|
||||
video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor."));
|
||||
video_restart_dialog->get_ok()->set_text(TTR("Save & Restart"));
|
||||
|
|
@ -6413,7 +6430,7 @@ EditorNode::EditorNode() {
|
|||
confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current));
|
||||
|
||||
save_confirmation = memnew(ConfirmationDialog);
|
||||
save_confirmation->add_button(TTR("Don't Save"), OS::get_singleton()->get_swap_ok_cancel(), "discard");
|
||||
save_confirmation->add_button(TTR("Don't Save"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "discard");
|
||||
gui_base->add_child(save_confirmation);
|
||||
save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current));
|
||||
save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes));
|
||||
|
|
@ -6624,7 +6641,7 @@ EditorNode::EditorNode() {
|
|||
|
||||
open_imported = memnew(ConfirmationDialog);
|
||||
open_imported->get_ok()->set_text(TTR("Open Anyway"));
|
||||
new_inherited_button = open_imported->add_button(TTR("New Inherited"), !OS::get_singleton()->get_swap_ok_cancel(), "inherit");
|
||||
new_inherited_button = open_imported->add_button(TTR("New Inherited"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "inherit");
|
||||
open_imported->connect("confirmed", callable_mp(this, &EditorNode::_open_imported));
|
||||
open_imported->connect("custom_action", callable_mp(this, &EditorNode::_inherit_imported));
|
||||
gui_base->add_child(open_imported);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "core/project_settings.h"
|
||||
#include "editor_settings.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
EditorRun::Status EditorRun::get_status() const {
|
||||
|
||||
|
|
@ -70,19 +71,19 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L
|
|||
int screen = EditorSettings::get_singleton()->get("run/window_placement/screen");
|
||||
if (screen == 0) {
|
||||
// Same as editor
|
||||
screen = OS::get_singleton()->get_current_screen();
|
||||
screen = DisplayServer::get_singleton()->window_get_current_screen();
|
||||
} else if (screen == 1) {
|
||||
// Previous monitor (wrap to the other end if needed)
|
||||
screen = Math::wrapi(
|
||||
OS::get_singleton()->get_current_screen() - 1,
|
||||
DisplayServer::get_singleton()->window_get_current_screen() - 1,
|
||||
0,
|
||||
OS::get_singleton()->get_screen_count());
|
||||
DisplayServer::get_singleton()->get_screen_count());
|
||||
} else if (screen == 2) {
|
||||
// Next monitor (wrap to the other end if needed)
|
||||
screen = Math::wrapi(
|
||||
OS::get_singleton()->get_current_screen() + 1,
|
||||
DisplayServer::get_singleton()->window_get_current_screen() + 1,
|
||||
0,
|
||||
OS::get_singleton()->get_screen_count());
|
||||
DisplayServer::get_singleton()->get_screen_count());
|
||||
} else {
|
||||
// Fixed monitor ID
|
||||
// There are 3 special options, so decrement the option ID by 3 to get the monitor ID
|
||||
|
|
@ -94,8 +95,8 @@ Error EditorRun::run(const String &p_scene, const String &p_custom_args, const L
|
|||
}
|
||||
|
||||
Rect2 screen_rect;
|
||||
screen_rect.position = OS::get_singleton()->get_screen_position(screen);
|
||||
screen_rect.size = OS::get_singleton()->get_screen_size(screen);
|
||||
screen_rect.position = DisplayServer::get_singleton()->screen_get_position(screen);
|
||||
screen_rect.size = DisplayServer::get_singleton()->screen_get_size(screen);
|
||||
|
||||
Size2 desired_size;
|
||||
desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width");
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
_initial_set("run/window_placement/rect", 1);
|
||||
hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen");
|
||||
String screen_hints = "Same as Editor,Previous Monitor,Next Monitor";
|
||||
for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) {
|
||||
for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) {
|
||||
screen_hints += ",Monitor " + itos(i + 1);
|
||||
}
|
||||
_initial_set("run/window_placement/rect_custom_position", Vector2());
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "import_dock.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
Ref<Texture2D> FileSystemDock::_get_tree_item_icon(EditorFileSystemDirectory *p_dir, int p_idx) {
|
||||
Ref<Texture2D> file_icon;
|
||||
|
|
@ -1765,7 +1766,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
|
|||
case FILE_COPY_PATH: {
|
||||
if (!p_selected.empty()) {
|
||||
String fpath = p_selected[0];
|
||||
OS::get_singleton()->set_clipboard(fpath);
|
||||
DisplayServer::get_singleton()->clipboard_set(fpath);
|
||||
}
|
||||
} break;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#include "scene/main/viewport.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
#include "script_text_editor.h"
|
||||
#include "servers/display_server.h"
|
||||
#include "text_editor.h"
|
||||
|
||||
/*** SCRIPT EDITOR ****/
|
||||
|
|
@ -651,7 +652,7 @@ void ScriptEditor::_close_docs_tab() {
|
|||
void ScriptEditor::_copy_script_path() {
|
||||
ScriptEditorBase *se = _get_current_editor();
|
||||
RES script = se->get_edited_resource();
|
||||
OS::get_singleton()->set_clipboard(script->get_path());
|
||||
DisplayServer::get_singleton()->clipboard_set(script->get_path());
|
||||
}
|
||||
|
||||
void ScriptEditor::_close_other_tabs() {
|
||||
|
|
@ -3291,7 +3292,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
|
||||
erase_tab_confirm = memnew(ConfirmationDialog);
|
||||
erase_tab_confirm->get_ok()->set_text(TTR("Save"));
|
||||
erase_tab_confirm->add_button(TTR("Discard"), OS::get_singleton()->get_swap_ok_cancel(), "discard");
|
||||
erase_tab_confirm->add_button(TTR("Discard"), DisplayServer::get_singleton()->get_swap_ok_cancel(), "discard");
|
||||
erase_tab_confirm->connect("confirmed", callable_mp(this, &ScriptEditor::_close_current_tab));
|
||||
erase_tab_confirm->connect("custom_action", callable_mp(this, &ScriptEditor::_close_discard_current_tab));
|
||||
add_child(erase_tab_confirm);
|
||||
|
|
@ -3325,7 +3326,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
|
|||
disk_changed->connect("confirmed", callable_mp(this, &ScriptEditor::_reload_scripts));
|
||||
disk_changed->get_ok()->set_text(TTR("Reload"));
|
||||
|
||||
disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave");
|
||||
disk_changed->add_button(TTR("Resave"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "resave");
|
||||
disk_changed->connect("custom_action", callable_mp(this, &ScriptEditor::_resave_scripts));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "servers/display_server.h"
|
||||
#include "servers/visual/shader_types.h"
|
||||
|
||||
/*** SHADER SCRIPT EDITOR ****/
|
||||
|
|
@ -699,7 +700,7 @@ ShaderEditor::ShaderEditor(EditorNode *p_node) {
|
|||
disk_changed->connect("confirmed", callable_mp(this, &ShaderEditor::_reload_shader_from_disk));
|
||||
disk_changed->get_ok()->set_text(TTR("Reload"));
|
||||
|
||||
disk_changed->add_button(TTR("Resave"), !OS::get_singleton()->get_swap_ok_cancel(), "resave");
|
||||
disk_changed->add_button(TTR("Resave"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "resave");
|
||||
disk_changed->connect("custom_action", callable_mp(this, &ShaderEditor::save_external_data));
|
||||
|
||||
add_child(disk_changed);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
#include "scene/gui/viewport_container.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "scene/resources/surface_tool.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
#define DISTANCE_DEFAULT 4
|
||||
|
||||
|
|
@ -2213,14 +2214,14 @@ void SpatialEditorViewport::set_freelook_active(bool active_now) {
|
|||
}
|
||||
|
||||
// Hide mouse like in an FPS (warping doesn't work)
|
||||
OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_CAPTURED);
|
||||
DisplayServer::get_singleton()->mouse_set_mode(DisplayServer::MOUSE_MODE_CAPTURED);
|
||||
|
||||
} else if (freelook_active && !active_now) {
|
||||
// Sync camera cursor to cursor to "cut" interpolation jumps due to changing referential
|
||||
cursor = camera_cursor;
|
||||
|
||||
// Restore mouse
|
||||
OS::get_singleton()->set_mouse_mode(OS::MOUSE_MODE_VISIBLE);
|
||||
DisplayServer::get_singleton()->mouse_set_mode(DisplayServer::MOUSE_MODE_VISIBLE);
|
||||
}
|
||||
|
||||
freelook_active = active_now;
|
||||
|
|
@ -3926,8 +3927,11 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
|
|||
view_menu->get_popup()->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option));
|
||||
display_submenu->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option));
|
||||
view_menu->set_disable_shortcuts(true);
|
||||
|
||||
if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) {
|
||||
#ifndef _MSC_VER
|
||||
#warning this needs to be fixed
|
||||
#endif
|
||||
//if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) {
|
||||
if (false) {
|
||||
// Alternate display modes only work when using the Vulkan renderer; make this explicit.
|
||||
const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL);
|
||||
const int wireframe_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#include "scene/gui/panel.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/visual_shader_nodes.h"
|
||||
#include "servers/display_server.h"
|
||||
#include "servers/visual/shader_types.h"
|
||||
|
||||
Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) {
|
||||
|
|
@ -1646,7 +1647,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos) {
|
|||
}
|
||||
|
||||
// keep dialog within window bounds
|
||||
Size2 window_size = OS::get_singleton()->get_window_size();
|
||||
Size2 window_size = DisplayServer::get_singleton()->window_get_size();
|
||||
Rect2 dialog_rect = members_dialog->get_global_rect();
|
||||
if (dialog_rect.position.y + dialog_rect.size.y > window_size.y) {
|
||||
int difference = dialog_rect.position.y + dialog_rect.size.y - window_size.y;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "core/os/os.h"
|
||||
#include "editor_scale.h"
|
||||
#include "main/main.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
void BackgroundProgress::_add_task(const String &p_task, const String &p_label, int p_steps) {
|
||||
|
||||
|
|
@ -219,7 +220,7 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int
|
|||
t.state->set_text(p_state);
|
||||
last_progress_tick = OS::get_singleton()->get_ticks_usec();
|
||||
if (cancel_hb->is_visible()) {
|
||||
OS::get_singleton()->force_process_input();
|
||||
DisplayServer::get_singleton()->process_events();
|
||||
}
|
||||
|
||||
Main::iteration(); // this will not work on a lot of platforms, so it's only meant for the editor
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "scene/gui/margin_container.h"
|
||||
#include "scene/gui/scroll_container.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
void ProjectExportDialog::_notification(int p_what) {
|
||||
|
||||
|
|
@ -1250,7 +1251,7 @@ ProjectExportDialog::ProjectExportDialog() {
|
|||
|
||||
get_cancel()->set_text(TTR("Close"));
|
||||
get_ok()->set_text(TTR("Export PCK/Zip"));
|
||||
export_button = add_button(TTR("Export Project"), !OS::get_singleton()->get_swap_ok_cancel(), "export");
|
||||
export_button = add_button(TTR("Export Project"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "export");
|
||||
export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project));
|
||||
// Disable initially before we select a valid preset
|
||||
export_button->set_disabled(true);
|
||||
|
|
@ -1265,7 +1266,7 @@ ProjectExportDialog::ProjectExportDialog() {
|
|||
export_all_dialog->add_button(TTR("Release"), true, "release");
|
||||
export_all_dialog->connect("custom_action", callable_mp(this, &ProjectExportDialog::_export_all_dialog_action));
|
||||
|
||||
export_all_button = add_button(TTR("Export All"), !OS::get_singleton()->get_swap_ok_cancel(), "export");
|
||||
export_all_button = add_button(TTR("Export All"), !DisplayServer::get_singleton()->get_swap_ok_cancel(), "export");
|
||||
export_all_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_all_dialog));
|
||||
export_all_button->set_disabled(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
#include "scene/gui/separator.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/gui/tool_button.h"
|
||||
#include "servers/display_server.h"
|
||||
|
||||
static inline String get_project_key_from_path(const String &dir) {
|
||||
return dir.replace("/", "::");
|
||||
|
|
@ -1284,7 +1285,11 @@ void ProjectList::load_projects() {
|
|||
}
|
||||
|
||||
void ProjectList::update_dock_menu() {
|
||||
OS::get_singleton()->global_menu_clear("_dock");
|
||||
|
||||
if (!DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) {
|
||||
return;
|
||||
}
|
||||
DisplayServer::get_singleton()->global_menu_clear("_dock");
|
||||
|
||||
int favs_added = 0;
|
||||
int total_added = 0;
|
||||
|
|
@ -1294,18 +1299,18 @@ void ProjectList::update_dock_menu() {
|
|||
favs_added++;
|
||||
} else {
|
||||
if (favs_added != 0) {
|
||||
OS::get_singleton()->global_menu_add_separator("_dock");
|
||||
DisplayServer::get_singleton()->global_menu_add_separator("_dock");
|
||||
}
|
||||
favs_added = 0;
|
||||
}
|
||||
OS::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", GLOBAL_OPEN_PROJECT, Variant(_projects[i].path.plus_file("project.godot")));
|
||||
DisplayServer::get_singleton()->global_menu_add_item("_dock", _projects[i].project_name + " ( " + _projects[i].path + " )", GLOBAL_OPEN_PROJECT, Variant(_projects[i].path.plus_file("project.godot")));
|
||||
total_added++;
|
||||
}
|
||||
}
|
||||
if (total_added != 0) {
|
||||
OS::get_singleton()->global_menu_add_separator("_dock");
|
||||
DisplayServer::get_singleton()->global_menu_add_separator("_dock");
|
||||
}
|
||||
OS::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant());
|
||||
DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), GLOBAL_NEW_WINDOW, Variant());
|
||||
}
|
||||
|
||||
void ProjectList::create_project_item_control(int p_index) {
|
||||
|
|
@ -2413,8 +2418,8 @@ ProjectManager::ProjectManager() {
|
|||
switch (display_scale) {
|
||||
case 0: {
|
||||
// Try applying a suitable display scale automatically
|
||||
const int screen = OS::get_singleton()->get_current_screen();
|
||||
editor_set_scale(OS::get_singleton()->get_screen_dpi(screen) >= 192 && OS::get_singleton()->get_screen_size(screen).x > 2000 ? 2.0 : 1.0);
|
||||
const int screen = DisplayServer::get_singleton()->window_get_current_screen();
|
||||
editor_set_scale(DisplayServer::get_singleton()->screen_get_dpi(screen) >= 192 && DisplayServer::get_singleton()->screen_get_size(screen).x > 2000 ? 2.0 : 1.0);
|
||||
} break;
|
||||
|
||||
case 1: editor_set_scale(0.75); break;
|
||||
|
|
@ -2430,12 +2435,12 @@ ProjectManager::ProjectManager() {
|
|||
}
|
||||
|
||||
// Define a minimum window size to prevent UI elements from overlapping or being cut off
|
||||
OS::get_singleton()->set_min_window_size(Size2(750, 420) * EDSCALE);
|
||||
DisplayServer::get_singleton()->window_set_min_size(Size2(750, 420) * EDSCALE);
|
||||
|
||||
#ifndef OSX_ENABLED
|
||||
// The macOS platform implementation uses its own hiDPI window resizing code
|
||||
// TODO: Resize windows on hiDPI displays on Windows and Linux and remove the line below
|
||||
OS::get_singleton()->set_window_size(OS::get_singleton()->get_window_size() * MAX(1, EDSCALE));
|
||||
DisplayServer::get_singleton()->window_set_size(DisplayServer::get_singleton()->window_get_size() * MAX(1, EDSCALE));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -2459,7 +2464,7 @@ ProjectManager::ProjectManager() {
|
|||
|
||||
String cp;
|
||||
cp += 0xA9;
|
||||
OS::get_singleton()->set_window_title(VERSION_NAME + String(" - ") + TTR("Project Manager") + " - " + cp + " 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors");
|
||||
DisplayServer::get_singleton()->window_set_title(VERSION_NAME + String(" - ") + TTR("Project Manager") + " - " + cp + " 2007-2020 Juan Linietsky, Ariel Manzur & Godot Contributors");
|
||||
|
||||
Control *center_box = memnew(Control);
|
||||
center_box->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
#include "editor/plugins/spatial_editor_plugin.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/packed_scene.h"
|
||||
#include "servers/display_server.h"
|
||||
#include "servers/visual_server.h"
|
||||
|
||||
void SceneTreeDock::_nodes_drag_begin() {
|
||||
|
||||
|
|
@ -822,7 +824,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|||
if (node) {
|
||||
Node *root = EditorNode::get_singleton()->get_edited_scene();
|
||||
NodePath path = root->get_path().rel_path_to(node->get_path());
|
||||
OS::get_singleton()->set_clipboard(path);
|
||||
DisplayServer::get_singleton()->clipboard_set(path);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue