Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -279,7 +279,6 @@ jobs:
|
|||||||
VERSION_CODE=$(( $VERSION_CODE + 1 ))
|
VERSION_CODE=$(( $VERSION_CODE + 1 ))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CSS=images/wivrn-release.css
|
|
||||||
APPNAME=WiVRn
|
APPNAME=WiVRn
|
||||||
else
|
else
|
||||||
VERSION_CODE=1
|
VERSION_CODE=1
|
||||||
@@ -287,15 +286,20 @@ jobs:
|
|||||||
if [ ${{ github.ref_type }} = 'tag' ]
|
if [ ${{ github.ref_type }} = 'tag' ]
|
||||||
then
|
then
|
||||||
SUFFIX=".github"
|
SUFFIX=".github"
|
||||||
CSS=images/wivrn-release.css
|
|
||||||
APPNAME="WiVRn"
|
APPNAME="WiVRn"
|
||||||
else
|
else
|
||||||
SUFFIX=".github.testing"
|
SUFFIX=".github.testing"
|
||||||
CSS=images/wivrn-nightly.css
|
|
||||||
APPNAME="WiVRn Testing"
|
APPNAME="WiVRn Testing"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ${{ github.ref_type }} = 'tag' ]
|
||||||
|
then
|
||||||
|
CSS=images/wivrn-release.css
|
||||||
|
else
|
||||||
|
CSS=images/wivrn-nightly.css
|
||||||
|
fi
|
||||||
|
|
||||||
echo Setting version $VERSION and version code $VERSION_CODE in manifest
|
echo Setting version $VERSION and version code $VERSION_CODE in manifest
|
||||||
echo Using stylesheet $CSS and name $APPNAME
|
echo Using stylesheet $CSS and name $APPNAME
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -308,29 +308,29 @@ wivrn::deserialization_packet wivrn::UDP::receive_raw()
|
|||||||
|
|
||||||
static const size_t message_size = 2048;
|
static const size_t message_size = 2048;
|
||||||
static const size_t num_messages = 20;
|
static const size_t num_messages = 20;
|
||||||
|
if ((not buffer) or buffer.use_count() > 1)
|
||||||
|
{
|
||||||
#if defined(__cpp_lib_smart_ptr_for_overwrite) && __cpp_lib_smart_ptr_for_overwrite >= 202002L
|
#if defined(__cpp_lib_smart_ptr_for_overwrite) && __cpp_lib_smart_ptr_for_overwrite >= 202002L
|
||||||
buffer = std::make_shared_for_overwrite<uint8_t[]>(message_size * num_messages);
|
buffer = std::make_shared_for_overwrite<uint8_t[]>(message_size * num_messages);
|
||||||
#else
|
#else
|
||||||
buffer.reset(new uint8_t[message_size * num_messages]);
|
buffer.reset(new uint8_t[message_size * num_messages]);
|
||||||
#endif
|
#endif
|
||||||
std::vector<iovec> iovecs;
|
}
|
||||||
std::vector<mmsghdr> mmsgs;
|
std::array<iovec, num_messages> iovecs;
|
||||||
iovecs.reserve(num_messages);
|
std::array<mmsghdr, num_messages> mmsgs;
|
||||||
mmsgs.reserve(num_messages);
|
|
||||||
for (size_t i = 0; i < num_messages; ++i)
|
for (size_t i = 0; i < num_messages; ++i)
|
||||||
{
|
{
|
||||||
iovecs.push_back({
|
iovecs[i] = {
|
||||||
.iov_base = buffer.get() + message_size * i,
|
.iov_base = buffer.get() + message_size * i,
|
||||||
.iov_len = message_size,
|
.iov_len = message_size,
|
||||||
});
|
};
|
||||||
|
|
||||||
mmsgs.push_back(
|
mmsgs[i] = {
|
||||||
{
|
.msg_hdr = {
|
||||||
.msg_hdr = {
|
.msg_iov = &iovecs[i],
|
||||||
.msg_iov = &iovecs.back(),
|
.msg_iovlen = 1,
|
||||||
.msg_iovlen = 1,
|
},
|
||||||
},
|
};
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int received = recvmmsg(fd, mmsgs.data(), num_messages, MSG_DONTWAIT, nullptr);
|
int received = recvmmsg(fd, mmsgs.data(), num_messages, MSG_DONTWAIT, nullptr);
|
||||||
|
|||||||
@@ -256,23 +256,6 @@ modules:
|
|||||||
cleanup:
|
cleanup:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
- name: libnotify
|
|
||||||
buildsystem: meson
|
|
||||||
config-opts:
|
|
||||||
- -Dtests=false
|
|
||||||
- -Dintrospection=disabled
|
|
||||||
- -Dman=false
|
|
||||||
- -Dgtk_doc=false
|
|
||||||
- -Ddocbook_docs=disabled
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://download.gnome.org/sources/libnotify/0.8/libnotify-0.8.8.tar.xz
|
|
||||||
sha256: 23420ef619dc2cb5aebad613f4823a2fa41c07e5a1d05628d40f6ec4b35bfddd
|
|
||||||
x-checker-data:
|
|
||||||
type: gnome
|
|
||||||
name: libnotify
|
|
||||||
stable-only: true
|
|
||||||
|
|
||||||
- name: qcoro
|
- name: qcoro
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
config-opts:
|
config-opts:
|
||||||
|
|||||||
+1
-1
@@ -513,7 +513,7 @@ gboolean control_received(gint fd, GIOCondition condition, gpointer user_data)
|
|||||||
[&](const wivrn::from_headset::start_app & request) {
|
[&](const wivrn::from_headset::start_app & request) {
|
||||||
const auto & apps = list_applications();
|
const auto & apps = list_applications();
|
||||||
if (auto it = apps.find(request.app_id); it != apps.end())
|
if (auto it = apps.find(request.app_id); it != apps.end())
|
||||||
children->start_application(it->second.exec);
|
children->start_application(it->second.exec, it->second.path);
|
||||||
},
|
},
|
||||||
[&](const from_monado::headset_connected &) {
|
[&](const from_monado::headset_connected &) {
|
||||||
stop_publishing();
|
stop_publishing();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "utils/flatpak.h"
|
#include "utils/flatpak.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <filesystem>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -95,15 +96,15 @@ static std::vector<std::string> unescape_string(const std::string & app_string)
|
|||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
void children_manager::start_application(const std::string & exec)
|
void children_manager::start_application(const std::string & exec, const std::optional<std::string> & path)
|
||||||
{
|
{
|
||||||
start_application(unescape_string(exec));
|
start_application(unescape_string(exec), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
forked_children::forked_children(std::function<void()> state_changed_cb) :
|
forked_children::forked_children(std::function<void()> state_changed_cb) :
|
||||||
state_changed_cb(state_changed_cb) {}
|
state_changed_cb(state_changed_cb) {}
|
||||||
|
|
||||||
void forked_children::start_application(const std::vector<std::string> & args)
|
void forked_children::start_application(const std::vector<std::string> & args, const std::optional<std::string> & path)
|
||||||
{
|
{
|
||||||
if (args.empty())
|
if (args.empty())
|
||||||
return;
|
return;
|
||||||
@@ -151,6 +152,19 @@ void forked_children::start_application(const std::vector<std::string> & args)
|
|||||||
{
|
{
|
||||||
tmp.push_back("flatpak-spawn");
|
tmp.push_back("flatpak-spawn");
|
||||||
tmp.push_back("--host");
|
tmp.push_back("--host");
|
||||||
|
if (path)
|
||||||
|
tmp.push_back("--directory=" + *path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
std::filesystem::current_path(*path);
|
||||||
|
}
|
||||||
|
catch (std::exception & e)
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to set path to " << *path << ": " << e.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp.insert(tmp.end(), args.begin(), args.end());
|
tmp.insert(tmp.end(), args.begin(), args.end());
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@@ -32,8 +33,8 @@ class children_manager
|
|||||||
public:
|
public:
|
||||||
virtual ~children_manager();
|
virtual ~children_manager();
|
||||||
|
|
||||||
virtual void start_application(const std::vector<std::string> &) = 0;
|
virtual void start_application(const std::vector<std::string> &, const std::optional<std::string> & path = {}) = 0;
|
||||||
void start_application(const std::string &);
|
void start_application(const std::string &, const std::optional<std::string> & path = {});
|
||||||
|
|
||||||
virtual bool running() const = 0;
|
virtual bool running() const = 0;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ public:
|
|||||||
forked_children(std::function<void()> state_changed_cb);
|
forked_children(std::function<void()> state_changed_cb);
|
||||||
virtual ~forked_children();
|
virtual ~forked_children();
|
||||||
|
|
||||||
void start_application(const std::vector<std::string> &) override;
|
void start_application(const std::vector<std::string> &, const std::optional<std::string> & path) override;
|
||||||
|
|
||||||
// true if any unit started by this object is still running
|
// true if any unit started by this object is still running
|
||||||
bool running() const override;
|
bool running() const override;
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ struct variant_builder
|
|||||||
|
|
||||||
}; // namespace
|
}; // namespace
|
||||||
|
|
||||||
void systemd_units_manager::start_application(const std::vector<std::string> & args)
|
void systemd_units_manager::start_application(const std::vector<std::string> & args, const std::optional<std::string> & path)
|
||||||
{
|
{
|
||||||
if (args.empty())
|
if (args.empty())
|
||||||
return;
|
return;
|
||||||
@@ -224,6 +224,12 @@ void systemd_units_manager::start_application(const std::vector<std::string> & a
|
|||||||
&exec_start,
|
&exec_start,
|
||||||
1));
|
1));
|
||||||
|
|
||||||
|
if (path)
|
||||||
|
g_variant_builder_add(&b,
|
||||||
|
"(sv)",
|
||||||
|
"WorkingDirectory",
|
||||||
|
g_variant_new("s", path->c_str()));
|
||||||
|
|
||||||
if (auto path = std::getenv("PATH"))
|
if (auto path = std::getenv("PATH"))
|
||||||
{
|
{
|
||||||
variant_builder pathv(G_VARIANT_TYPE("as"));
|
variant_builder pathv(G_VARIANT_TYPE("as"));
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
systemd_units_manager(GDBusConnection * connection, std::function<void()> state_changed_cb);
|
systemd_units_manager(GDBusConnection * connection, std::function<void()> state_changed_cb);
|
||||||
|
|
||||||
// create and start the transient unit
|
// create and start the transient unit
|
||||||
void start_application(const std::vector<std::string> &) override;
|
void start_application(const std::vector<std::string> &, const std::optional<std::string> & path) override;
|
||||||
|
|
||||||
// true if any unit started by this object is still running
|
// true if any unit started by this object is still running
|
||||||
bool running() const override;
|
bool running() const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user