Skip to content

Commit

Permalink
Merge branch 'flatpak:main' into systemhandler
Browse files Browse the repository at this point in the history
  • Loading branch information
xhorak authored Jan 22, 2024
2 parents 986296e + fd70f57 commit 1e6c910
Show file tree
Hide file tree
Showing 129 changed files with 4,576 additions and 4,595 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ jobs:
env:
TEST_IN_CI: 1
G_MESSAGES_DEBUG: all
ASAN_OPTIONS: detect_leaks=0 # Right now we're not fully clean, but this gets us use-after-free etc

- name: Install xdg-desktop-portal
run: $RUN_CMD meson install -C ${BUILDDIR}
Expand All @@ -117,7 +116,6 @@ jobs:
G_MESSAGES_DEBUG: all
TEST_IN_CI: 1
XDG_DATA_DIRS: /usr/local/share:/usr/share
ASAN_OPTIONS: detect_leaks=0 # Right now we're not fully clean, but this gets us use-after-free etc

- name: Create dist tarball
run: |
Expand All @@ -126,7 +124,6 @@ jobs:
env:
TEST_IN_CI: 1
G_MESSAGES_DEBUG: all
ASAN_OPTIONS: detect_leaks=0 # Right now we're not fully clean, but this gets us use-after-free etc

- name: Upload test logs
uses: actions/upload-artifact@v3
Expand Down
55 changes: 25 additions & 30 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,51 @@ jobs:
build:
runs-on: ubuntu-20.04
container:
image: ubuntu:22.04
image: fedora:latest
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get upgrade -y
apt-get install -y --no-install-recommends \
dnf install -y \
desktop-file-utils \
flatpak-devel \
fontconfig-devel \
fuse3 \
fuse3-devel \
gcc \
gdk-pixbuf2-devel \
geoclue2-devel \
gettext \
glib2-devel \
gnome-desktop-testing \
gtk-doc-tools \
libcap2-bin \
libflatpak-dev \
libfontconfig1-dev \
libfuse3-dev \
libgdk-pixbuf-2.0-dev \
libgeoclue-2-dev \
libglib2.0-dev \
libjson-glib-dev \
libpipewire-0.3-dev \
libportal-dev \
libsystemd-dev \
gtk-doc \
json-glib-devel \
libcap \
libcap-devel \
libportal-devel \
llvm \
meson \
python3-gi \
shared-mime-info
pipewire-devel \
python3-gobject \
shared-mime-info \
systemd-devel
- name: Install dependencies for doc builds
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get install -y --no-install-recommends \
dnf install -y \
ca-certificates \
git \
xmlto
python-sphinx-copybutton \
python-sphinxext-opengraph \
python3-furo \
python3-sphinx
- name: Check out xdg-desktop-portal
uses: actions/checkout@v3

- name: Build docs
run: |
meson setup builddir -Ddocbook-docs=enabled
meson compile -C builddir
meson setup builddir -Ddocumentation=enabled
ninja -C builddir doc/html
- name: Build website
uses: actions/jekyll-build-pages@v1
Expand All @@ -72,10 +70,7 @@ jobs:
- name: Prepare docs
working-directory: builddir/doc
run: |
mkdir ../../_site/docs/
mv portal-docs.html ../../_site/docs/index.html
mv redirect.html ../../_site/docs/portal-docs.html
mv docbook.css ../../_site/docs/
mv ./html ../../_site/docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
Expand Down
64 changes: 2 additions & 62 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,4 @@
# XDG Desktop Portal - Contributing Guide

Before developing features or fixing bugs, please make sure you are have done
the following:

- Your code is not on the *main* branch of your fork
- The code has been tested
- All commit messages are properly formatted and commits squashed where
appropriate
- You have included updates to all appropriate documentation

We use GitHub pull requests to review contributions. Please be kind and patient
as code reviews can be long and minutious.

## Development

xdg-desktop-portal usually runs as a user session service, initialized on
demand through D-Bus activation. It usually starts with the session though,
as many desktop environments try to talk to xdg-desktop-portal on startup.
xdg-desktop-portal initializes specific backends through D-Bus activation
as well.

### Building

To build xdg-desktop-portal, first make sure you have the build dependencies
installed through your distribution's package manager. With them installed,
run:

```
$ meson setup . _build
$ meson compile -C _build
```

Some distributions install portal configuration files in `/usr`, while Meson
defaults to the prefix `/usr/local`. If the portal configuration files in your
distribution are in `/usr/share/xdg-desktop-portal/portals`, re-configure
Meson using `meson setup --reconfigure . _build --prefix /usr` and compile
again.

### Running

xdg-desktop-portal needs to own the D-Bus name and replace the user session
service that might already be running. To do so, run:

```
$ _build/src/xdg-desktop-portal --replace
```

You may need to restart backends after replacing xdg-desktop-portal (please
replace `[name]` with the backend name, e.g. `gnome` or `kde` or `wlr`):

```
$ systemctl --user restart xdg-desktop-portal-[name].service
```

### Testing

To execute the test suite present in xdg-desktop-portal, make sure you built it
with `-Dlibportal=enabled`, and run:

```
$ meson test -C _build
```

The contribution guidelines have been moved to the online documentation:
https://flatpak.github.io/xdg-desktop-portal/docs/contributing.html
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ path (`/org/freedesktop/portal/desktop`).
The portal interfaces include APIs for file access, opening URIs, printing
and others.

Documentation for the available D-Bus interfaces can be found
Documentation for the available D-Bus interfaces can be found
[here](https://flatpak.github.io/xdg-desktop-portal/docs/).

## Version Numbering
Expand Down Expand Up @@ -55,6 +55,7 @@ Here are some examples of available backends:

There are several reasons for the frontend/backend separation of the portal
code:

- We want to have _native_ portal dialogs that match the session desktop (i.e.
GTK dialogs for GNOME, Qt dialogs for KDE)
- One of the limitations of the D-Bus proxying in flatpak is that allowing a
Expand Down Expand Up @@ -85,6 +86,7 @@ is working well as a backend for the GtkFileChooserNative API.
When it comes to files, we need to be careful to not let portal APIs subvert the
limited filesystem view that apps have in their sandbox. Therefore, files should
only be passed into portal APIs in one of two forms:

- As a document ID referring to a file that has been exported in the document
portal
- As an open fd. The portal can work its way back to a file path from the fd,
Expand All @@ -95,5 +97,4 @@ When it comes to processes, passing PIDs around is not useful in a sandboxed
world where apps are likely in their own PID namespace. And passing PIDs from
inside the sandbox is problematic, since the app can just lie.


[contributing]: https://github.com/flatpak/xdg-desktop-portal/blob/main/CONTRIBUTING.md
31 changes: 11 additions & 20 deletions data/org.freedesktop.background.Monitor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,17 @@
The list of applications that are considered to be running in
background. The following keys are supported:
<variablelist>
<varlistentry>
<term>app_id s</term>
<listitem><para>
App id of the application.
</para></listitem>
</varlistentry>
<varlistentry>
<term>instance s</term>
<listitem><para>
The Flatpak instance of the application.
</para></listitem>
</varlistentry>
<varlistentry>
<term>message s</term>
<listitem><para>
Status message reported by the application. Optional.
</para></listitem>
</varlistentry>
</variablelist>
* ``app_id`` (``s``)
App id of the application.
* ``instance`` (``s``)
The Flatpak instance of the application.
* ``message`` (``s``)
Status message reported by the application. Optional.
-->
<property name="BackgroundApps" type="aa{sv}" access="read"/>

Expand Down
64 changes: 28 additions & 36 deletions data/org.freedesktop.impl.portal.Access.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,53 +32,45 @@
AccessDialog:
@handle: Object path to export the Request object at
@app_id: App id of the application
@parent_window: Identifier for the application window, see <link linkend="parent_window">Common Conventions</link>
@parent_window: Identifier for the application window, see :doc:`window-identifiers`
@title: Title for the dialog
@subtitle: Subtitle for the dialog
@body: Body text, may be ""
@options: Vardict with optional further information
@response: Numeric response. The values allowed match the values allowed for #org.freedesktop.portal.Request::Response signal.
@response: Numeric response. The values allowed match the values allowed for :ref:`org.freedesktop.portal.Request::Response` signal.
@results: Vardict with the results of the call
Presents a "deny/grant" question to the user.
Supported keys in the @options include:
<variablelist>
<varlistentry>
<term>modal b</term>
<listitem><para>Whether to make the dialog modal. Defaults to true.</para></listitem>
</varlistentry>
<varlistentry>
<term>deny_label s</term>
<listitem><para>Label for the Deny button.</para></listitem>
</varlistentry>
<varlistentry>
<term>grant_label s</term>
<listitem><para>Label for the Grant button.</para></listitem>
</varlistentry>
<varlistentry>
<term>icon s</term>
<listitem><para>Icon name for an icon to show in the dialog. This should be a symbolic icon name.</para></listitem>
</varlistentry>
<varlistentry>
<term>choices a(ssa(ss)s)</term>
<listitem><para>
List of serialized choices.
See org.freedesktop.portal.FileChooser.OpenFile() for details.
</para></listitem>
</varlistentry>
</variablelist>
* ``modal`` (``b``)
Whether to make the dialog modal. Defaults to true.
* ``deny_label`` (``s``)
Label for the Deny button.
* ``grant_label`` (``s``)
Label for the Grant button.
* ``icon`` (``s``)
Icon name for an icon to show in the dialog. This should be a symbolic icon name.
* ``choices`` (``a(ssa(ss)s)``)
List of serialized choices.
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
The following results get returned via the @results vardict:
<variablelist>
<varlistentry>
<term>choices a(ss)</term>
<listitem><para>
An array of pairs of strings, corresponding to the passed-in choices.
See org.freedesktop.portal.FileChooser.OpenFile() for details.
</para></listitem>
</varlistentry>
</variablelist>
* ``choices`` (``a(ss)``)
An array of pairs of strings, corresponding to the passed-in choices.
See :ref:`org.freedesktop.portal.FileChooser.OpenFile` for details.
-->
<method name="AccessDialog">
<arg type="o" name="handle" direction="in"/>
Expand Down
Loading

0 comments on commit 1e6c910

Please sign in to comment.