Bug 495255 - Querying for appearance settings returns color-scheme twice.
Summary: Querying for appearance settings returns color-scheme twice.
Status: RESOLVED NOT A BUG
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-23 17:55 UTC by Emilio Cobos Álvarez (:emilio)
Modified: 2024-10-23 18:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emilio Cobos Álvarez (:emilio) 2024-10-23 17:55:51 UTC
SUMMARY

When asking for all the appearance settings, kde desktop portal sends two dictionaries instead of the expected response (just one). It also includes the color-scheme settings twice.

STEPS TO REPRODUCE
1.  `dbus-send --session --dest=org.freedesktop.portal.Desktop --print-reply /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.ReadAll 'array:string:org.freedesktop.appearance'`

OBSERVED RESULT

```
method return time=1729706075.670188 sender=:1.7 -> destination=:1.144 serial=4469 reply_serial=2
   array [
      dict entry(
         string "org.freedesktop.appearance"
         array [
            dict entry(
               string "accent-color"
               variant                   struct {
                     double 0.239216
                     double 0.682353
                     double 0.913725
                  }
            )
            dict entry(
               string "color-scheme"
               variant                   uint32 1
            )
         ]
      )
      dict entry(
         string "org.freedesktop.appearance"
         array [
            dict entry(
               string "color-scheme"
               variant                   uint32 1
            )
         ]
      )
   ]
```

EXPECTED RESULT

Only one?

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION
Comment 1 Nicolas Fella 2024-10-23 18:09:22 UTC
As far as I can tell this happens because the settings portal queries all portal backends, so if you have x-d-p-kde and x-d-p-gtk running (which is expected) you will get results from both.

Querying the backend directly via "dbus-send --session --dest=org.freedesktop.impl.portal.desktop.kde --print-reply /org/freedesktop/portal/desktop org.freedesktop.impl.portal.Settings.ReadAll 'array:string:org.freedesktop.appearance'a" should only give one result
Comment 2 Emilio Cobos Álvarez (:emilio) 2024-10-23 18:12:12 UTC
Ohh, indeed. Nice find, thanks! It seems settings portal could merge the results, otherwise applications could get confused... But alright, that indeed explains, thanks!