Merge remote-tracking branch 'origin/master'

This commit is contained in:
Yukino Song
2024-10-05 22:48:35 +08:00
38 changed files with 422 additions and 164 deletions

View File

@@ -47,13 +47,13 @@ namespace boost {
namespace filesystem {
class path;
}
namespace process {
namespace process::inline v1 {
class child;
class group;
template <typename Char>
class basic_environment;
typedef basic_environment<char> environment;
} // namespace process
} // namespace process::inline v1
} // namespace boost
#endif
namespace video {
@@ -600,8 +600,8 @@ namespace platf {
bool
needs_encoder_reenumeration();
boost::process::child
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::environment &env, FILE *file, std::error_code &ec, boost::process::group *group);
boost::process::v1::child
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::v1::environment &env, FILE *file, std::error_code &ec, boost::process::v1::group *group);
enum class thread_priority_e : int {
low, ///< Low priority

View File

@@ -15,7 +15,7 @@
// lib includes
#include <arpa/inet.h>
#include <boost/asio/ip/address.hpp>
#include <boost/process.hpp>
#include <boost/process/v1.hpp>
#include <dlfcn.h>
#include <fcntl.h>
#include <ifaddrs.h>
@@ -352,7 +352,7 @@ get_local_ip_for_gateway() {
auto working_dir = boost::filesystem::path(std::getenv("HOME"));
std::string cmd = R"(xdg-open ")" + url + R"(")";
boost::process::environment _env = boost::this_process::environment();
boost::process::v1::environment _env = boost::this_process::environment();
std::error_code ec;
auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr);
if (ec) {

View File

@@ -362,6 +362,9 @@ const KeyCodeMap kKeyCodesMap[] = {
CGEventSetDoubleValueField(event, kCGMouseEventDeltaY, deltaY);
CGEventPost(kCGHIDEventTap, event);
// For why this is here, see:
// https://stackoverflow.com/questions/15194409/simulated-mouseevent-not-working-properly-osx
CGWarpMouseCursorPosition(location);
}
inline CGEventType

View File

@@ -23,7 +23,7 @@
#include "src/platform/common.h"
#include <boost/asio/ip/address.hpp>
#include <boost/process.hpp>
#include <boost/process/v1.hpp>
using namespace std::literals;
namespace fs = std::filesystem;
@@ -203,7 +203,7 @@ namespace platf {
boost::filesystem::path working_dir;
std::string cmd = R"(open ")" + url + R"(")";
boost::process::environment _env = boost::this_process::environment();
boost::process::v1::environment _env = boost::this_process::environment();
std::error_code ec;
auto child = run_command(false, false, cmd, working_dir, _env, nullptr, ec, nullptr);
if (ec) {

View File

@@ -7,9 +7,9 @@
#include <thread>
#include <boost/algorithm/string/join.hpp>
#include <boost/process.hpp>
#include <boost/process/v1.hpp>
// We have to include boost/process.hpp before display.h due to WinSock.h,
// We have to include boost/process/v1.hpp before display.h due to WinSock.h,
// but that prevents the definition of NTSTATUS so we must define it ourself.
typedef long NTSTATUS;

View File

@@ -10,7 +10,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/asio/ip/address.hpp>
#include <boost/process.hpp>
#include <boost/process/v1.hpp>
#include <boost/program_options/parsers.hpp>
// prevent clang format from "optimizing" the header include order
@@ -1121,7 +1121,7 @@ namespace platf {
*/
void
open_url(const std::string &url) {
boost::process::environment _env = boost::this_process::environment();
boost::process::v1::environment _env = boost::this_process::environment();
auto working_dir = boost::filesystem::path();
std::error_code ec;