mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Fix choosing directories in snap and flatpak
This commit is contained in:
parent
5c8820d5d8
commit
aec2b8df7e
1 changed files with 6 additions and 4 deletions
|
@ -113,15 +113,17 @@ bool UseNative(Type type = Type::ReadFile) {
|
|||
// or if QT_QPA_PLATFORMTHEME=(gtk2|gtk3)
|
||||
// or if portals are used and operation is to open folder
|
||||
// and portal doesn't support folder choosing
|
||||
const auto sandboxedOrCustomPortal = InFlatpak()
|
||||
|| InSnap()
|
||||
|| UseXDGDesktopPortal();
|
||||
|
||||
const auto neededForPortal = (type == Type::ReadFolder)
|
||||
&& !CanOpenDirectoryWithPortal();
|
||||
|
||||
const auto neededNonForced = DesktopEnvironment::IsGtkBased()
|
||||
|| (UseXDGDesktopPortal() && neededForPortal);
|
||||
|| (sandboxedOrCustomPortal && neededForPortal);
|
||||
|
||||
const auto excludeNonForced = InFlatpak()
|
||||
|| InSnap()
|
||||
|| (UseXDGDesktopPortal() && !neededForPortal);
|
||||
const auto excludeNonForced = sandboxedOrCustomPortal && !neededForPortal;
|
||||
|
||||
return IsGtkIntegrationForced()
|
||||
|| (neededNonForced && !excludeNonForced);
|
||||
|
|
Loading…
Add table
Reference in a new issue