Adapt xdg desktop portal support for appimage (#22)
This commit is contained in:
parent
926abbe189
commit
10efd09c36
4 changed files with 23 additions and 14 deletions
2
.github/workflows/appimage-release.yml
vendored
2
.github/workflows/appimage-release.yml
vendored
|
|
@ -503,7 +503,7 @@ jobs:
|
|||
AppDir/usr/share/applications/*.desktop \
|
||||
-appimage \
|
||||
-exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \
|
||||
-extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration
|
||||
-extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration
|
||||
|
||||
- name: Move artifact.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
|
|
|
|||
2
.github/workflows/appimage.yml
vendored
2
.github/workflows/appimage.yml
vendored
|
|
@ -509,7 +509,7 @@ jobs:
|
|||
AppDir/usr/share/applications/*.desktop \
|
||||
-appimage \
|
||||
-exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \
|
||||
-extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration
|
||||
-extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration
|
||||
|
||||
- name: Get artifact name.
|
||||
if: env.ONLY_CACHE == 'false'
|
||||
|
|
|
|||
|
|
@ -252,6 +252,14 @@ bool IsStaticBinary() {
|
|||
#endif // !DESKTOP_APP_USE_PACKAGED
|
||||
}
|
||||
|
||||
bool IsGtkFileDialogForced() {
|
||||
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
return true;
|
||||
#else // TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
return false;
|
||||
#endif // !TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
}
|
||||
|
||||
bool IsXDGDesktopPortalPresent() {
|
||||
#ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
static const auto XDGDesktopPortalPresent = false;
|
||||
|
|
@ -607,21 +615,21 @@ void start() {
|
|||
qputenv("PULSE_PROP_application.name", AppName.utf8());
|
||||
qputenv("PULSE_PROP_application.icon_name", GetIconName().toLatin1());
|
||||
|
||||
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
LOG(("Checking for XDG Desktop Portal..."));
|
||||
// this can give us a chance to use a proper file dialog for current session
|
||||
if (IsXDGDesktopPortalPresent()) {
|
||||
LOG(("XDG Desktop Portal is present!"));
|
||||
if (UseXDGDesktopPortal()) {
|
||||
LOG(("Usage of XDG Desktop Portal is enabled."));
|
||||
qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal");
|
||||
if(IsStaticBinary() || InAppImage() || IsGtkFileDialogForced()) {
|
||||
LOG(("Checking for XDG Desktop Portal..."));
|
||||
// this can give us a chance to use a proper file dialog for current session
|
||||
if (IsXDGDesktopPortalPresent()) {
|
||||
LOG(("XDG Desktop Portal is present!"));
|
||||
if (UseXDGDesktopPortal()) {
|
||||
LOG(("Usage of XDG Desktop Portal is enabled."));
|
||||
qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal");
|
||||
} else {
|
||||
LOG(("Usage of XDG Desktop Portal is disabled."));
|
||||
}
|
||||
} else {
|
||||
LOG(("Usage of XDG Desktop Portal is disabled."));
|
||||
LOG(("XDG Desktop Portal is not present :("));
|
||||
}
|
||||
} else {
|
||||
LOG(("XDG Desktop Portal is not present :("));
|
||||
}
|
||||
#endif // TDESKTOP_FORCE_GTK_FILE_DIALOG
|
||||
}
|
||||
|
||||
void finish() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ bool InSandbox();
|
|||
bool InSnap();
|
||||
bool InAppImage();
|
||||
bool IsStaticBinary();
|
||||
bool IsGtkFileDialogForced();
|
||||
|
||||
bool IsXDGDesktopPortalPresent();
|
||||
bool UseXDGDesktopPortal();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue