Skip to content

Commit

Permalink
Merge portals-gtk and portals-qt into portals, add a note about the u…
Browse files Browse the repository at this point in the history
…se of portal-gtk
  • Loading branch information
orowith2os authored and TingPing committed Nov 22, 2022
1 parent 8c55966 commit 0b8962f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
7 changes: 3 additions & 4 deletions docs/desktop-integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ including:
- Showing notifications
- Taking screenshots and screencasts

Toolkits like GTK and Qt provide transparent support for portals:
Toolkits like GTK and Qt provide transparent support for portals.

.. toctree::
:maxdepth: 2
:maxdepth: 1

portals-gtk
portals-qt
portals

If you are not using one of these toolkits, it is possible to access
the portals API directly. See the `Portals API documentation
Expand Down
13 changes: 0 additions & 13 deletions docs/portals-qt.rst

This file was deleted.

17 changes: 17 additions & 0 deletions docs/portals-gtk.rst → docs/portals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,20 @@ applications should do to benefit from this.
- Use ``g_application_send_notification()`` to show notifications
- Use the ``GtkApplication::screensaver-active`` property to monitor
scrensaver status

Additionally, xdg-desktop-portal-gtk is required for GTK themes and fonts.
It is also used as a fallback for the filepicker if the main xdg-desktop-portal implementation doesn't support filepicking.

Portal support in Qt and KDE
=============================

Qt and KDE libraries will transparently use portals for some functionality when
they detect that they are being used inside a Flatpak sandbox. Here are some
hints for what Qt or KDE applications should do to benefit from this.

- Use ``QDesktopServices::openUrl(const QUrl &url)`` or ``KIO::OpenUrlJob`` to
open URIs or send an email when using ``mailto`` URL
- Use ``QFileDialog`` class to open files and, as of Qt ``5.18.90``, directories. Avoid using
``QFileDialog::DontUseNativeDialog``. Note that portals cannot currently
give access to directories on the host filesystem
- Use ``KNotification::notify()`` to show notification

0 comments on commit 0b8962f

Please sign in to comment.