Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTK_USE_PORTAL=1 is ignored by Sublime Text 3 #4087

Closed
ghost opened this issue Apr 17, 2021 · 8 comments
Closed

GTK_USE_PORTAL=1 is ignored by Sublime Text 3 #4087

ghost opened this issue Apr 17, 2021 · 8 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2021

Description

Sublime Text 3 uses horrendous GTK default picker, when the environmental variable forces to use one provided by current xdg-desktop-portal, in my case KDE file picker.

Steps to reproduce

  1. Set GTK_USE_PORTAL=1 in /etc/profile.d/xdg.sh
  2. chmod +x /etc/profile.d/xdg.sh .
  3. Use KDE, install xdg-desktop-portal-kde.
  4. Reboot to apply changes.
  5. Launch applications and launch their file pickers.
  6. Only Sublime Text 3 doesn't launch KDE file picker.

Expected behavior

KDE File picker shows up.

Actual behavior

I get the GNOME/GTK file picker.

Any application(including firefox and other gtk apps on the left). Sublime Text 3 on the right.
image

Environment

  • Build: 3211
  • Operating system and version: Arch Linux
  • [Linux] Desktop Environment and/or Window Manager: KDE 5.21.4
@BenjaminSchaaf
Copy link
Member

Fixed in build 4103.

@Nantris
Copy link

Nantris commented Mar 15, 2023

@BenjaminSchaaf there's still the issue of Sublime Text opening the picker to a default folder rather than the folder than contains the currently opened file as occurs with the GTK picker and on other operating systems.

Can this be remedied? It's the only reason we haven't implemented GTK_USE_PORTAL=1 - but it would be a huge improvement in our workflow if we could resolve that.

I believe it's related to the "show on startup" setting:

Screenshot_20230315_183135

Edit: Actually, never mind - it seems to make no difference

@BenjaminSchaaf
Copy link
Member

@slapbox we use the same GTK API to set the initial directory regardless of whether the builtin dialog or portal is used. If that's not working that's an issue either with GTK or your setup.

@Nantris
Copy link

Nantris commented Mar 16, 2023

Presumably it's a GTK_USE_PORTAL limitation - but immense sadness. If there's anything that can be done to remedy this in the future, it would be a huge workflow improvement for us.

@BenjaminSchaaf
Copy link
Member

@slapbox Nope, the org.FreeDesktop.portal.FileChooser interface supports current_folder and that is also set by gtk: https://github.com/GNOME/gtk/blob/main/gtk/gtkfilechoosernativeportal.c#L406.

@Nantris
Copy link

Nantris commented Mar 16, 2023

Thanks for the reply @BenjaminSchaaf.

I can't imagine that there's anything wrong with our GTK setup. It's an entirely stable development machine with only minimal customizations made.

The file picker always defaults to the directory that was last opened when we use GTK_USE_PORTAL.

Does anyone on the Sublime team use KDE who would be able to do an independent test? If so, on Kubuntu 22.10, the file that needs to be modified is ~/.pam_environment

Or is there anything else you would recommend we try?

I know this is a bit beyond the scope of the issue tracker so I understand if you can't offer any additional advice. Thanks for reading!

@BenjaminSchaaf
Copy link
Member

Sounds like it could be an issue with: https://invent.kde.org/plasma/xdg-desktop-portal-kde, might be best to ask there.

@Nantris
Copy link

Nantris commented Mar 27, 2023

Thanks again for your help @BenjaminSchaaf!

I found the most relevant issue here: flatpak/xdg-desktop-portal#874

For whatever little a thumbs-up is worth, I'd appreciate if you could add one to that issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants