commit 7362b02cd373a63e72e0d27f3c700f568989038c
parent fc6ed0bb0d2923c4d1035b58d36ad2d5b44fe470
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Sun, 8 Aug 2021 14:11:03 +0200
More work
Diffstat:
4 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt
@@ -9,6 +9,8 @@ add_executable(clap-gui
application.hh
application.cc
)
+target_compile_options(clap-gui PRIVATE -fsanitize=address)
+target_link_options(clap-gui PRIVATE -fsanitize=address)
target_link_libraries(clap-gui clap-io Qt6::Quick)
set_target_properties(clap-gui PROPERTIES CXX_STANDARD 17)
diff --git a/examples/gui/application.cc b/examples/gui/application.cc
@@ -8,7 +8,7 @@
Application::Application(int argc, char **argv)
: QGuiApplication(argc, argv), quickView_(new QQuickView()) {
- bool waitForDebbugger = true;
+ bool waitForDebbugger = false;
while (waitForDebbugger)
;
@@ -55,6 +55,8 @@ Application::Application(int argc, char **argv)
socketReadNotifier_->setEnabled(true);
socketWriteNotifier_->setEnabled(false);
socketErrorNotifier_->setEnabled(false);
+
+ QCoreApplication::arguments();
}
void Application::modifyFd(clap_fd_flags flags) {
@@ -73,6 +75,14 @@ void Application::onMessage(const clap::RemoteChannel::Message &msg) {
break;
}
+ case clap::messages::kSizeRequest: {
+ clap::messages::SizeResponse rp;
+ rp.width = 300; //quickView_->width();
+ rp.height = 200; //quickView_->height();
+ remoteChannel_->sendResponseAsync(rp, msg.cookie);
+ break;
+ }
+
case clap::messages::kAttachX11Request: {
clap::messages::AttachX11Request rq;
msg.get(rq);
@@ -97,13 +107,5 @@ void Application::onMessage(const clap::RemoteChannel::Message &msg) {
remoteChannel_->sendResponseAsync(rp, msg.cookie);
break;
}
-
- case clap::messages::kSizeRequest: {
- clap::messages::SizeResponse rp;
- rp.width = 400; //quickView_->width();
- rp.height = 500; //quickView_->height();
- remoteChannel_->sendResponseAsync(rp, msg.cookie);
- break;
- }
}
}
diff --git a/examples/plugins/path-provider.cc b/examples/plugins/path-provider.cc
@@ -67,9 +67,10 @@ namespace clap {
const std::string pluginName_;
};
- std::unique_ptr<PathProvider> PathProvider::create(const std::string &pluginPath, const std::string& pluginName) {
+ std::unique_ptr<PathProvider> PathProvider::create(const std::string &_pluginPath, const std::string& pluginName) {
#ifdef __linux__
{
+ auto pluginPath = std::filesystem::absolute(_pluginPath);
auto devPtr = std::make_unique<LinuxDevelopmentPathProvider>(pluginPath, pluginName);
if (devPtr->isValid())
return std::move(devPtr);
diff --git a/examples/plugins/remote-gui.cc b/examples/plugins/remote-gui.cc
@@ -149,7 +149,7 @@ namespace clap {
messages::AttachResponse response;
request.window = window;
- std::snprintf(request.display, sizeof(request.display), "%s", display_name);
+ std::snprintf(request.display, sizeof(request.display), "%s", display_name ? : "");
return channel_->sendRequestSync(request, response);
}