diff --git a/build-aux/flatpak/com.github.liferooter.textpieces.yaml b/build-aux/flatpak/com.github.liferooter.textpieces.yaml index 0c43421..90a3de7 100644 --- a/build-aux/flatpak/com.github.liferooter.textpieces.yaml +++ b/build-aux/flatpak/com.github.liferooter.textpieces.yaml @@ -31,13 +31,6 @@ cleanup: modules: -- name: blueprint - buildsystem: meson - sources: - - type: git - url: https://gitlab.gnome.org/jwestman/blueprint-compiler - branch: main - - name: textpieces builddir: true buildsystem: meson @@ -46,6 +39,13 @@ modules: path: ../.. modules: + - name: blueprint + buildsystem: meson + sources: + - type: git + url: https://gitlab.gnome.org/jwestman/blueprint-compiler + branch: main + - name: python3-pyyaml buildsystem: simple build-commands: @@ -55,3 +55,16 @@ modules: - type: file url: https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz sha256: 68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2 + + - name: libportal + buildsystem: meson + config-opts: + - -Dbackend-gtk3=disabled + - -Dbackend-gtk4=enabled + - -Dbackend-qt5=disabled + - -Ddocs=false + - -Dtests=false + sources: + - type: git + url: https://github.com/flatpak/libportal + tag: main diff --git a/meson.build b/meson.build index ff239d0..4d88b60 100644 --- a/meson.build +++ b/meson.build @@ -91,6 +91,8 @@ textpieces_deps = [ dependency('gio-unix-2.0', version: '>= 2.50'), dependency('gtk4', version: '>= 4.2'), dependency('gee-0.8', version: '>= 0.8'), + dependency('libportal', version: '>= 0.6'), + dependency('libportal-gtk4', version: '>= 0.6'), json_glib_dep, gtksourceview_dep, libadwaita_dep, diff --git a/src/tools/Tool.vala b/src/tools/Tool.vala index 59ca1c4..4d09ddd 100644 --- a/src/tools/Tool.vala +++ b/src/tools/Tool.vala @@ -169,12 +169,13 @@ namespace TextPieces { */ public void open (Gtk.Window? window) requires (!this.is_system) { - Gtk.show_uri ( - window, + new Xdp.Portal ().open_uri.begin ( + Xdp.parent_new_gtk(window), File.new_build_filename ( Tool.CUSTOM_TOOLS_DIR.get (), this.script ).get_uri (), - Gdk.CURRENT_TIME + ASK | WRITABLE, + null ); }