Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/include/backend/opener.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <shared_data/opener_capabilities.hpp>

#include <expected>
#include <filesystem>
#include <memory>
Expand All @@ -24,6 +26,13 @@ class Opener
*/
std::expected<void, std::string> openInFileManager(std::filesystem::path const& path);

/**
* @brief Probe the platform's external-open facilities and report which calls are expected
* to succeed. Called once at startup by the frontend via RPC so it can gray out
* "Open" / "Open With" / "Open in File Manager" menu entries and warn the user.
*/
SharedData::OpenerCapabilities capabilities() const;

private:
struct Implementation;
std::unique_ptr<Implementation> impl_;
Expand Down
1 change: 1 addition & 0 deletions backend/include/backend/rpc_filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class RpcFilesystem : public RpcHelper::StrandRpc
void registerWriteFile();
void registerOpen();
void registerOpenInFileManager();
void registerOpenerCapabilities();

private:
Persistence::LocalFilesystemOptions options_;
Expand Down
8 changes: 7 additions & 1 deletion backend/source/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ else()
linux/opener_linux.cpp
process/fork_pool.cpp
)
# GLib's GDBus replaces sd-bus for portal calls: Ubuntu 24.04's xdg-dbus-proxy
# mangles sd-bus's one-shot AUTH EXTERNAL handshake but accepts GDBus's multi-step
# negotiation, so the app can talk to portals without --socket=session-bus.
# gio-unix-2.0 brings in GUnixFDList for file-descriptor passing.
find_package(PkgConfig REQUIRED)
pkg_check_modules(gio REQUIRED IMPORTED_TARGET gio-2.0 gio-unix-2.0)
target_link_libraries(
backend
PRIVATE
SDBusCpp::sdbus-c++
PkgConfig::gio
)
endif()

Expand Down
Loading