Skip to content

Commit

Permalink
Restore editor screenshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Sep 1, 2021
1 parent c97afc0 commit 91c0147
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
5 changes: 4 additions & 1 deletion editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,10 @@ void EditorNode::_save_screenshot(NodePath p_path) {
ERR_FAIL_COND_MSG(!editor_main_control, "Cannot get editor main control.");
Viewport *viewport = editor_main_control->get_viewport();
ERR_FAIL_COND_MSG(!viewport, "Cannot get editor main control viewport.");
Ref<ViewportTexture> texture = viewport->get_texture();
Ref<ViewportTexture> texture;
texture.instantiate();
texture->set_viewport_path_in_scene(viewport->get_path());
texture->setup_local_to_scene();
ERR_FAIL_COND_MSG(texture.is_null(), "Cannot get editor main control viewport texture.");
Ref<Image> img = texture->get_image();
ERR_FAIL_COND_MSG(img.is_null(), "Cannot get editor main control viewport texture image.");
Expand Down
32 changes: 14 additions & 18 deletions platform/linuxbsd/os_linuxbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,40 +188,36 @@ String OS_LinuxBSD::get_name() const {
}

Error OS_LinuxBSD::shell_open(String p_uri) {
Error ok;
int err_code;
Error err;
List<String> args;
args.push_back(p_uri);

// Agnostic
ok = execute("xdg-open", args, nullptr, &err_code);
if (ok == OK && !err_code) {
err = create_process("xdg-open", args);
if (err == OK) {
return OK;
} else if (err_code == 2) {
return ERR_FILE_NOT_FOUND;
}
// GNOME
args.push_front("open"); // The command is `gio open`, so we need to add it to args
ok = execute("gio", args, nullptr, &err_code);
if (ok == OK && !err_code) {
err = create_process("gio", args);
if (err == OK) {
return OK;
} else if (err_code == 2) {
return ERR_FILE_NOT_FOUND;
}
args.pop_front();
ok = execute("gvfs-open", args, nullptr, &err_code);
if (ok == OK && !err_code) {
err = create_process("gvfs-open", args);
if (err == OK) {
return OK;
} else if (err_code == 2) {
return ERR_FILE_NOT_FOUND;
}
// KDE
ok = execute("kde-open5", args, nullptr, &err_code);
if (ok == OK && !err_code) {
err = create_process("kde-open5", args);
if (err == OK) {
return OK;
}
err = create_process("kde-open", args);
if (err == OK) {
return OK;
}
ok = execute("kde-open", args, nullptr, &err_code);
return !err_code ? ok : FAILED;
return FAILED;
}

bool OS_LinuxBSD::_check_internal_feature_support(const String &p_feature) {
Expand Down

0 comments on commit 91c0147

Please sign in to comment.