Fix: D-Bus CreateSession "Missing token" error\n\nAdded a handle_token to the QVariantMap passed to the CreateSession call in wayland_poc.cpp to resolve the "Missing token" error. Updated lessons_learned.md.
This commit is contained in:
parent
0ccac075a4
commit
536e264590
@ -108,6 +108,11 @@ This document summarizes the key challenges, debugging steps, and solutions enco
|
|||||||
* **Diagnosis:** The `xdg-desktop-portal` API for `CreateSession` had changed, and the `handlePath`, `sessionPath`, and `applicationName` arguments were no longer expected.
|
* **Diagnosis:** The `xdg-desktop-portal` API for `CreateSession` had changed, and the `handlePath`, `sessionPath`, and `applicationName` arguments were no longer expected.
|
||||||
* **Fix:** Modified the `CreateSession` call in `wayland_poc.cpp` to only send an empty `QVariantMap` as its argument.
|
* **Fix:** Modified the `CreateSession` call in `wayland_poc.cpp` to only send an empty `QVariantMap` as its argument.
|
||||||
|
|
||||||
|
* **D-Bus `CreateSession` "Missing token" Error:**
|
||||||
|
* **Problem:** After fixing the `CreateSession` signature, the call failed with a "Missing token" error.
|
||||||
|
* **Diagnosis:** The `CreateSession` method, while expecting a single dictionary of options, also requires a `handle_token` within that dictionary.
|
||||||
|
* **Fix:** Added a `handle_token` to the `QVariantMap` passed to the `CreateSession` call in `wayland_poc.cpp`.
|
||||||
|
|
||||||
* **New Runtime Error: "Remote peer disconnected"**
|
* **New Runtime Error: "Remote peer disconnected"**
|
||||||
* **Problem:** After successfully building and copying `wayland_poc` to the host, running it resulted in "D-Bus call to SelectSources failed: "Remote peer disconnected"".
|
* **Problem:** After successfully building and copying `wayland_poc` to the host, running it resulted in "D-Bus call to SelectSources failed: "Remote peer disconnected"".
|
||||||
* **Diagnosis:** This indicates a problem with the D-Bus connection itself, rather than a rejection from the portal. Possible causes include incorrect D-Bus environment variables on the host, `xdg-desktop-portal` not running, or permission issues.
|
* **Diagnosis:** This indicates a problem with the D-Bus connection itself, rather than a rejection from the portal. Possible causes include incorrect D-Bus environment variables on the host, `xdg-desktop-portal` not running, or permission issues.
|
||||||
|
|||||||
@ -145,7 +145,9 @@ int main(int argc, char *argv[]) {
|
|||||||
QDBusObjectPath sessionPath("/org/freedesktop/portal/session/12345/screencast_sess_1");
|
QDBusObjectPath sessionPath("/org/freedesktop/portal/session/12345/screencast_sess_1");
|
||||||
|
|
||||||
// Add arguments: handle, session_handle, app_id, options
|
// Add arguments: handle, session_handle, app_id, options
|
||||||
message << QVariantMap(); // Empty options map
|
QVariantMap options;
|
||||||
|
options.insert("handle_token", QUuid::createUuid().toString(QUuid::WithoutBraces)); // Add handle_token
|
||||||
|
message << options; // Empty options map
|
||||||
|
|
||||||
QDBusPendingCall pendingCall = sessionBus.asyncCall(message);
|
QDBusPendingCall pendingCall = sessionBus.asyncCall(message);
|
||||||
QDBusPendingCallWatcher *mainWatcher = new QDBusPendingCallWatcher(pendingCall);
|
QDBusPendingCallWatcher *mainWatcher = new QDBusPendingCallWatcher(pendingCall);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user