diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/export/export.cpp | 25 | ||||
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java | 2 | ||||
-rw-r--r-- | platform/android/os_android.cpp | 3 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/javascript/detect.py | 5 | ||||
-rw-r--r-- | platform/javascript/export/export.cpp | 55 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 2 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 2 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 4 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/windows/detect.py | 7 | ||||
-rw-r--r-- | platform/windows/export/export.cpp | 8 | ||||
-rwxr-xr-x | platform/windows/os_windows.cpp | 4 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 113 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 1 |
15 files changed, 155 insertions, 92 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index b9968c08aa..78d87c5629 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -610,7 +610,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { static Error save_apk_so(void *p_userdata, const SharedObject &p_so) { if (!p_so.path.get_file().begins_with("lib")) { String err = "Android .so file names must start with \"lib\", but got: " + p_so.path; - ERR_PRINTS(err); + ERR_PRINT(err); return FAILED; } APKExportData *ed = (APKExportData *)p_userdata; @@ -631,7 +631,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { if (!exported) { String abis_string = String(" ").join(abis); String err = "Cannot determine ABI for library \"" + p_so.path + "\". One of the supported ABIs must be used as a tag: " + abis_string; - ERR_PRINTS(err); + ERR_PRINT(err); return FAILED; } return OK; @@ -642,9 +642,6 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { String dst_path = p_path.replace_first("res://", "assets/"); store_in_apk(ed, dst_path, p_data, _should_compress_asset(p_path, p_data) ? Z_DEFLATED : 0); - if (ed->ep->step("File: " + p_path, 3 + p_file * 100 / p_total)) { - return ERR_SKIP; - } return OK; } @@ -1497,7 +1494,7 @@ public: String adb = EditorSettings::get_singleton()->get("export/android/adb"); // Export_temp APK. - if (ep.step("Exporting APK", 0)) { + if (ep.step("Exporting APK...", 0)) { device_lock->unlock(); return ERR_SKIP; } @@ -1547,7 +1544,7 @@ public: } print_line("Installing to device (please wait...): " + devices[p_device].name); - if (ep.step("Installing to device (please wait...)", 2)) { + if (ep.step("Installing to device, please wait...", 2)) { CLEANUP_AND_RETURN(ERR_SKIP); } @@ -1614,7 +1611,7 @@ public: } } - if (ep.step("Running on Device...", 3)) { + if (ep.step("Running on device...", 3)) { CLEANUP_AND_RETURN(ERR_SKIP); } args.clear(); @@ -1878,7 +1875,7 @@ public: new_file += "//CHUNK_" + text + "_BEGIN\n"; if (!found) { - ERR_PRINTS("No end marker found in build.gradle for chunk: " + text); + ERR_PRINT("No end marker found in build.gradle for chunk: " + text); f->seek(pos); } else { @@ -1914,7 +1911,7 @@ public: new_file += "//DIR_" + text + "_BEGIN\n"; if (!found) { - ERR_PRINTS("No end marker found in build.gradle for dir: " + text); + ERR_PRINT("No end marker found in build.gradle for dir: " + text); f->seek(pos); } else { //add chunk lines @@ -1973,7 +1970,7 @@ public: new_file += "<!--CHUNK_" + text + "_BEGIN-->\n"; if (!found) { - ERR_PRINTS("No end marker found in AndroidManifest.xml for chunk: " + text); + ERR_PRINT("No end marker found in AndroidManifest.xml for chunk: " + text); f->seek(pos); } else { //add chunk lines @@ -1992,7 +1989,7 @@ public: String last_tag = "android:icon=\"@mipmap/icon\""; int last_tag_pos = l.find(last_tag); if (last_tag_pos == -1) { - ERR_PRINTS("Not adding application attributes as the expected tag was not found in '<application': " + last_tag); + ERR_PRINT("Not adding application attributes as the expected tag was not found in '<application': " + last_tag); new_file += l + "\n"; } else { String base = l.substr(0, last_tag_pos + last_tag.length()); @@ -2119,7 +2116,7 @@ public: FileAccess *src_f = NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); - if (ep.step("Creating APK", 0)) { + if (ep.step("Creating APK...", 0)) { return ERR_SKIP; } @@ -2281,7 +2278,7 @@ public: ret = unzGoToNextFile(pkg); } - if (ep.step("Adding Files...", 1)) { + if (ep.step("Adding files...", 1)) { CLEANUP_AND_RETURN(ERR_SKIP); } Error err = OK; diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java index 44998aa6c0..e901b4b36d 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotEditText.java @@ -123,7 +123,7 @@ public class GodotEditText extends EditText { } private void setMaxInputLength(EditText p_edit_text, int p_max_input_length) { - if (p_max_input_length >= 0) { + if (p_max_input_length > 0) { InputFilter[] filters = new InputFilter[1]; filters[0] = new InputFilter.LengthFilter(p_max_input_length); p_edit_text.setFilters(filters); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 44c5b5d6b4..e5d9bdc60c 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -507,9 +507,8 @@ void OS_Android::process_double_tap(Point2 p_pos) { ev.instance(); ev->set_position(p_pos); ev->set_global_position(p_pos); - ev->set_pressed(true); + ev->set_pressed(false); ev->set_doubleclick(true); - ev->set_button_index(1); input->parse_input_event(ev); } diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index b606d570c2..104f9e751e 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -1030,7 +1030,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p print_line("Creating " + dir_name); Error dir_err = tmp_app_path->make_dir_recursive(dir_name); if (dir_err) { - ERR_PRINTS("Can't create '" + dir_name + "'."); + ERR_PRINT("Can't create '" + dir_name + "'."); unzClose(src_pkg_zip); memdelete(tmp_app_path); return ERR_CANT_CREATE; @@ -1040,7 +1040,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p /* write the file */ FileAccess *f = FileAccess::open(file, FileAccess::WRITE); if (!f) { - ERR_PRINTS("Can't write '" + file + "'."); + ERR_PRINT("Can't write '" + file + "'."); unzClose(src_pkg_zip); memdelete(tmp_app_path); return ERR_CANT_CREATE; @@ -1064,7 +1064,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p unzClose(src_pkg_zip); if (!found_library) { - ERR_PRINTS("Requested template library '" + library_to_use + "' not found. It might be missing from your template archive."); + ERR_PRINT("Requested template library '" + library_to_use + "' not found. It might be missing from your template archive."); memdelete(tmp_app_path); return ERR_FILE_NOT_FOUND; } @@ -1093,7 +1093,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p String project_file_name = dest_dir + binary_name + ".xcodeproj/project.pbxproj"; FileAccess *f = FileAccess::open(project_file_name, FileAccess::WRITE); if (!f) { - ERR_PRINTS("Can't write '" + project_file_name + "'."); + ERR_PRINT("Can't write '" + project_file_name + "'."); return ERR_CANT_CREATE; }; f->store_buffer(project_file_data.ptr(), project_file_data.size()); diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 7bf3e1bc1d..1766833364 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -131,6 +131,11 @@ def configure(env): env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) + # Only include the JavaScript support code for the web environment + # (i.e. exclude Node.js and other unused environments). + # This makes the JavaScript support code about 4 KB smaller. + env.Append(LINKFLAGS=['-s', 'ENVIRONMENT=web']) + # This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0) # and undefined if using 'upstream'. And to make things simple, earlier # Emscripten versions didn't include 'fastcomp' in their path, so we check diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 9b93d4f140..c1cb8bcb58 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -86,7 +86,7 @@ public: ERR_FAIL_COND_MSG(req[0] != "GET" || req[2] != "HTTP/1.1", "Invalid method or HTTP version."); String filepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); - String basereq = "/tmp_js_export"; + const String basereq = "/tmp_js_export"; String ctype = ""; if (req[1] == basereq + ".html") { filepath += ".html"; @@ -97,8 +97,13 @@ public: } else if (req[1] == basereq + ".pck") { filepath += ".pck"; ctype = "application/octet-stream"; - } else if (req[1] == basereq + ".png") { - filepath += ".png"; + } else if (req[1] == basereq + ".png" || req[1] == "/favicon.png") { + // Also allow serving the generated favicon for a smoother loading experience. + if (req[1] == "/favicon.png") { + filepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("favicon.png"); + } else { + filepath += ".png"; + } ctype = "image/png"; } else if (req[1] == basereq + ".wasm") { filepath += ".wasm"; @@ -470,11 +475,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese } Ref<Image> splash; - String splash_path = GLOBAL_GET("application/boot_splash/image"); - splash_path = splash_path.strip_edges(); + const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges(); if (!splash_path.empty()) { splash.instance(); - Error err = splash->load(splash_path); + const Error err = splash->load(splash_path); if (err) { EditorNode::get_singleton()->show_warning(TTR("Could not read boot splash image file:") + "\n" + splash_path + "\n" + TTR("Using default boot splash image.")); splash.unref(); @@ -483,11 +487,32 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese if (splash.is_null()) { splash = Ref<Image>(memnew(Image(boot_splash_png))); } - String png_path = p_path.get_base_dir().plus_file(p_path.get_file().get_basename() + ".png"); - if (splash->save_png(png_path) != OK) { - EditorNode::get_singleton()->show_warning(TTR("Could not write file:") + "\n" + png_path); + const String splash_png_path = p_path.get_base_dir().plus_file(p_path.get_file().get_basename() + ".png"); + if (splash->save_png(splash_png_path) != OK) { + EditorNode::get_singleton()->show_warning(TTR("Could not write file:") + "\n" + splash_png_path); return ERR_FILE_CANT_WRITE; } + + // Save a favicon that can be accessed without waiting for the project to finish loading. + // This way, the favicon can be displayed immediately when loading the page. + Ref<Image> favicon; + const String favicon_path = String(GLOBAL_GET("application/config/icon")).strip_edges(); + if (!favicon_path.empty()) { + favicon.instance(); + const Error err = favicon->load(favicon_path); + if (err) { + favicon.unref(); + } + } + + if (favicon.is_valid()) { + const String favicon_png_path = p_path.get_base_dir().plus_file("favicon.png"); + if (favicon->save_png(favicon_png_path) != OK) { + EditorNode::get_singleton()->show_warning(TTR("Could not write file:") + "\n" + favicon_png_path); + return ERR_FILE_CANT_WRITE; + } + } + return OK; } @@ -536,9 +561,8 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese return OK; } - String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); - String path = basepath + ".html"; - Error err = export_project(p_preset, true, path, p_debug_flags); + const String basepath = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_js_export"); + Error err = export_project(p_preset, true, basepath + ".html", p_debug_flags); if (err != OK) { // Export generates several files, clean them up on failure. DirAccess::remove_file_or_error(basepath + ".html"); @@ -546,13 +570,14 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese DirAccess::remove_file_or_error(basepath + ".pck"); DirAccess::remove_file_or_error(basepath + ".png"); DirAccess::remove_file_or_error(basepath + ".wasm"); + DirAccess::remove_file_or_error(EditorSettings::get_singleton()->get_cache_dir().plus_file("favicon.png")); return err; } - IP_Address bind_ip; - uint16_t bind_port = EDITOR_GET("export/web/http_port"); + const uint16_t bind_port = EDITOR_GET("export/web/http_port"); // Resolve host if needed. - String bind_host = EDITOR_GET("export/web/http_host"); + const String bind_host = EDITOR_GET("export/web/http_host"); + IP_Address bind_ip; if (bind_host.is_valid_ip_address()) { bind_ip = bind_host; } else { diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 632a7df9e8..34dce90b6b 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -980,7 +980,7 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, EMSCRIPTEN_RESULT result; #define EM_CHECK(ev) \ if (result != EMSCRIPTEN_RESULT_SUCCESS) \ - ERR_PRINTS("Error while setting " #ev " callback: Code " + itos(result)) + ERR_PRINT("Error while setting " #ev " callback: Code " + itos(result)); #define SET_EM_CALLBACK(target, ev, cb) \ result = emscripten_set_##ev##_callback(target, NULL, true, &cb); \ EM_CHECK(ev) diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index cf38664022..f372093268 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -692,7 +692,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p unzClose(src_pkg_zip); if (!found_binary) { - ERR_PRINTS("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive."); + ERR_PRINT("Requested template binary '" + binary_to_use + "' not found. It might be missing from your template archive."); err = ERR_FILE_NOT_FOUND; } diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 53fe11b3bb..bc77ac3cfd 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -2931,7 +2931,7 @@ void OS_OSX::run() { quit = true; } } @catch (NSException *exception) { - ERR_PRINTS("NSException: " + String([exception reason].UTF8String)); + ERR_PRINT("NSException: " + String([exception reason].UTF8String)); } }; @@ -2987,7 +2987,7 @@ Error OS_OSX::move_to_trash(const String &p_path) { NSError *err; if (![fm trashItemAtURL:url resultingItemURL:nil error:&err]) { - ERR_PRINTS("trashItemAtURL error: " + String(err.localizedDescription.UTF8String)); + ERR_PRINT("trashItemAtURL error: " + String(err.localizedDescription.UTF8String)); return FAILED; } diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 57fb9004b8..96a196c65d 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1176,7 +1176,7 @@ public: err += TTR("Invalid square 71x71 logo image dimensions (should be 71x71).") + "\n"; } - if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image((Object::cast_to<StreamTexture>((Object *)p_preset->get("images/square150x150_logo"))), 150, 0)) { + if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image((Object::cast_to<StreamTexture>((Object *)p_preset->get("images/square150x150_logo"))), 150, 150)) { valid = false; err += TTR("Invalid square 150x150 logo image dimensions (should be 150x150).") + "\n"; } @@ -1397,7 +1397,7 @@ public: } if (!FileAccess::exists(signtool_path)) { - ERR_PRINTS("Could not find signtool executable at " + signtool_path + ", aborting."); + ERR_PRINT("Could not find signtool executable at " + signtool_path + ", aborting."); return ERR_FILE_NOT_FOUND; } @@ -1418,12 +1418,12 @@ public: } if (!FileAccess::exists(cert_path)) { - ERR_PRINTS("Could not find certificate file at " + cert_path + ", aborting."); + ERR_PRINT("Could not find certificate file at " + cert_path + ", aborting."); return ERR_FILE_NOT_FOUND; } if (cert_alg < 0 || cert_alg > 2) { - ERR_PRINTS("Invalid certificate algorithm " + itos(cert_alg) + ", aborting."); + ERR_PRINT("Invalid certificate algorithm " + itos(cert_alg) + ", aborting."); return ERR_INVALID_DATA; } diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 500736bd3f..72c3f60d99 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -293,12 +293,7 @@ def configure_mingw(env): ## Compiler configuration - if (os.name == "nt"): - # Force splitting libmodules.a in multiple chunks to work around - # issues reaching the linker command line size limit, which also - # seem to induce huge slowdown for 'ar' (GH-30892). - env['split_libmodules'] = True - else: + if os.name != "nt": env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe" # for linux cross-compilation if (env["bits"] == "default"): diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 34d66ecd79..31501c2cd3 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -105,7 +105,7 @@ void EditorExportPlatformWindows::_rcedit_add_data(const Ref<EditorExportPreset> } if (!FileAccess::exists(rcedit_path)) { - ERR_PRINTS("Could not find rcedit executable at " + rcedit_path + ", no icon or app information data will be included."); + ERR_PRINT("Could not find rcedit executable at " + rcedit_path + ", no icon or app information data will be included."); return; } @@ -114,7 +114,7 @@ void EditorExportPlatformWindows::_rcedit_add_data(const Ref<EditorExportPreset> String wine_path = EditorSettings::get_singleton()->get("export/windows/wine"); if (wine_path != String() && !FileAccess::exists(wine_path)) { - ERR_PRINTS("Could not find wine executable at " + wine_path + ", no icon or app information data will be included."); + ERR_PRINT("Could not find wine executable at " + wine_path + ", no icon or app information data will be included."); return; } @@ -188,7 +188,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p #ifdef WINDOWS_ENABLED String signtool_path = EditorSettings::get_singleton()->get("export/windows/signtool"); if (signtool_path != String() && !FileAccess::exists(signtool_path)) { - ERR_PRINTS("Could not find signtool executable at " + signtool_path + ", aborting."); + ERR_PRINT("Could not find signtool executable at " + signtool_path + ", aborting."); return ERR_FILE_NOT_FOUND; } if (signtool_path == String()) { @@ -197,7 +197,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p #else String signtool_path = EditorSettings::get_singleton()->get("export/windows/osslsigncode"); if (signtool_path != String() && !FileAccess::exists(signtool_path)) { - ERR_PRINTS("Could not find osslsigncode executable at " + signtool_path + ", aborting."); + ERR_PRINT("Could not find osslsigncode executable at " + signtool_path + ", aborting."); return ERR_FILE_NOT_FOUND; } if (signtool_path == String()) { diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index a6977a7a86..2daaf9359a 100755 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2854,7 +2854,7 @@ void OS_Windows::set_native_icon(const String &p_filename) { ERR_FAIL_COND_MSG(big_icon_index == -1, "No valid icons found!"); if (small_icon_index == -1) { - WARN_PRINTS("No small icon found, reusing " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon!"); + WARN_PRINT("No small icon found, reusing " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon!"); small_icon_index = big_icon_index; small_icon_cc = big_icon_cc; } @@ -3363,7 +3363,7 @@ Error OS_Windows::move_to_trash(const String &p_path) { delete[] from; if (ret) { - ERR_PRINTS("SHFileOperation error: " + itos(ret)); + ERR_PRINT("SHFileOperation error: " + itos(ret)); return FAILED; } diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 57c7b0594c..1cd763853c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -526,19 +526,73 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a "watch", "left_ptr_watch", "fleur", - "hand1", - "X_cursor", - "sb_v_double_arrow", - "sb_h_double_arrow", + "dnd-move", + "crossed_circle", + "v_double_arrow", + "h_double_arrow", "size_bdiag", "size_fdiag", - "hand1", - "sb_v_double_arrow", - "sb_h_double_arrow", + "move", + "row_resize", + "col_resize", "question_arrow" }; img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size); + if (!img[i]) { + const char *fallback = NULL; + + switch (i) { + case CURSOR_POINTING_HAND: + fallback = "pointer"; + break; + case CURSOR_CROSS: + fallback = "crosshair"; + break; + case CURSOR_WAIT: + fallback = "wait"; + break; + case CURSOR_BUSY: + fallback = "progress"; + break; + case CURSOR_DRAG: + fallback = "grabbing"; + break; + case CURSOR_CAN_DROP: + fallback = "hand1"; + break; + case CURSOR_FORBIDDEN: + fallback = "forbidden"; + break; + case CURSOR_VSIZE: + fallback = "ns-resize"; + break; + case CURSOR_HSIZE: + fallback = "ew-resize"; + break; + case CURSOR_BDIAGSIZE: + fallback = "fd_double_arrow"; + break; + case CURSOR_FDIAGSIZE: + fallback = "bd_double_arrow"; + break; + case CURSOR_MOVE: + img[i] = img[CURSOR_DRAG]; + break; + case CURSOR_VSPLIT: + fallback = "sb_v_double_arrow"; + break; + case CURSOR_HSPLIT: + fallback = "sb_h_double_arrow"; + break; + case CURSOR_HELP: + fallback = "help"; + break; + } + if (fallback != NULL) { + img[i] = XcursorLibraryLoadImage(fallback, cursor_theme, cursor_size); + } + } if (img[i]) { cursors[i] = XcursorImageLoadCursor(x11_display, img[i]); } else { @@ -669,14 +723,8 @@ bool OS_X11::refresh_device_info() { int range_max_x = 0; int range_max_y = 0; int pressure_resolution = 0; - int pressure_min = 0; - int pressure_max = 0; int tilt_resolution_x = 0; int tilt_resolution_y = 0; - int tilt_range_min_x = 0; - int tilt_range_min_y = 0; - int tilt_range_max_x = 0; - int tilt_range_max_y = 0; for (int j = 0; j < dev->num_classes; j++) { #ifdef TOUCH_ENABLED if (dev->classes[j]->type == XITouchClass && ((XITouchClassInfo *)dev->classes[j])->mode == XIDirectTouch) { @@ -697,17 +745,14 @@ bool OS_X11::refresh_device_info() { range_max_y = class_info->max; absolute_mode = true; } else if (class_info->number == VALUATOR_PRESSURE && class_info->mode == XIModeAbsolute) { - pressure_resolution = class_info->resolution; - pressure_min = class_info->min; - pressure_max = class_info->max; + pressure_resolution = (class_info->max - class_info->min); + if (pressure_resolution == 0) pressure_resolution = 1; } else if (class_info->number == VALUATOR_TILTX && class_info->mode == XIModeAbsolute) { - tilt_resolution_x = class_info->resolution; - tilt_range_min_x = class_info->min; - tilt_range_max_x = class_info->max; + tilt_resolution_x = (class_info->max - class_info->min); + if (tilt_resolution_x == 0) tilt_resolution_x = 1; } else if (class_info->number == VALUATOR_TILTY && class_info->mode == XIModeAbsolute) { - tilt_resolution_y = class_info->resolution; - tilt_range_min_y = class_info->min; - tilt_range_max_y = class_info->max; + tilt_resolution_y = (class_info->max - class_info->min); + if (tilt_resolution_y == 0) tilt_resolution_y = 1; } } } @@ -728,15 +773,6 @@ bool OS_X11::refresh_device_info() { print_verbose("XInput: Absolute pointing device: " + String(dev->name)); } - if (pressure_resolution <= 0) { - pressure_resolution = (pressure_max - pressure_min); - } - if (tilt_resolution_x <= 0) { - tilt_resolution_x = (tilt_range_max_x - tilt_range_min_x); - } - if (tilt_resolution_y <= 0) { - tilt_resolution_y = (tilt_range_max_y - tilt_range_min_y); - } xi.pressure = 0; xi.pen_devices[dev->deviceid] = Vector3(pressure_resolution, tilt_resolution_x, tilt_resolution_y); } @@ -1429,11 +1465,15 @@ void OS_X11::set_window_fullscreen(bool p_enabled) { set_window_maximized(true); } set_wm_fullscreen(p_enabled); - if (!p_enabled && !current_videomode.always_on_top) { + if (!p_enabled && current_videomode.always_on_top) { // Restore set_window_maximized(false); } - + if (!p_enabled) { + set_window_position(last_position_before_fs); + } else { + last_position_before_fs = get_window_position(); + } current_videomode.fullscreen = p_enabled; } @@ -3402,7 +3442,7 @@ Error OS_X11::move_to_trash(const String &p_path) { // Issue an error if none of the previous locations is appropriate for the trash can. if (trash_can == "") { - ERR_PRINTS("move_to_trash: Could not determine the trash can location"); + ERR_PRINT("move_to_trash: Could not determine the trash can location"); return FAILED; } @@ -3413,7 +3453,7 @@ Error OS_X11::move_to_trash(const String &p_path) { // Issue an error if trash can is not created proprely. if (err != OK) { - ERR_PRINTS("move_to_trash: Could not create the trash can \"" + trash_can + "\""); + ERR_PRINT("move_to_trash: Could not create the trash can \"" + trash_can + "\""); return err; } @@ -3427,7 +3467,7 @@ Error OS_X11::move_to_trash(const String &p_path) { // Issue an error if "mv" failed to move the given resource to the trash can. if (err != OK || retval != 0) { - ERR_PRINTS("move_to_trash: Could not move the resource \"" + p_path + "\" to the trash can \"" + trash_can + "\""); + ERR_PRINT("move_to_trash: Could not move the resource \"" + p_path + "\" to the trash can \"" + trash_can + "\""); return FAILED; } @@ -3502,4 +3542,5 @@ OS_X11::OS_X11() { window_focused = true; xim_style = 0L; mouse_mode = MOUSE_MODE_VISIBLE; + last_position_before_fs = Vector2(); } diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 01e5aac3df..25b406743b 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -115,6 +115,7 @@ class OS_X11 : public OS_Unix { // IME bool im_active; Vector2 im_position; + Vector2 last_position_before_fs; Size2 min_size; Size2 max_size; |