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

Open dialog enter file path text #14

Open
JanAxelsson opened this issue Oct 21, 2019 · 18 comments
Open

Open dialog enter file path text #14

JanAxelsson opened this issue Oct 21, 2019 · 18 comments

Comments

@JanAxelsson
Copy link

Previously the file path could be pasted in a file dialog.

With the new nice-looking OSX file dialog in Geany 1.36, this feature is no longer there. Standard behavior in OSX is "Command-Shift G" to bring up the path dialog. It would be super great if this expected OSX behavior was implemented also in Geany

@techee
Copy link
Member

techee commented Oct 21, 2019

This is the standard GTK3 file open dialog (which is a little stupid) so we can't change much (the previous one was GTK2). However, you can press Command+L and it will show an entry where you can paste arbitrary path. See e.g.

https://forums.linuxmint.com/viewtopic.php?t=272123

@JanAxelsson
Copy link
Author

I have a feeling, correct me if wrong, that the intention is that it should be standard Mac Command-Shift-G. See /Applications/Geany.app/Contents/Resources/share/themes/Mac/gtk-3.0/gtk-keys.css

In that file, the following section appears twice, but is not honored when Geany is executed :

@binding-set gtk-mac-file-chooser
{
  bind "<meta>v" { "location-popup-on-paste" () };
  unbind "<ctrl>v";

  bind "<meta><shift>G" { "location-popup" () };
  bind "<meta><shift>H" { "home-folder" () };
  bind "<meta>Up" { "up-folder" () };
}

@techee
Copy link
Member

techee commented Oct 22, 2019

Well, no idea what might be wrong. I tried setting gtk-key-theme-name=Mac inside .config/gtk-3.0/settings.ini but it didn't help. We do some magic in geany in order to make keybindings work so maybe it's affected by this in some way.

@JanAxelsson
Copy link
Author

JanAxelsson commented Oct 22, 2019 via email

@elextr
Copy link
Member

elextr commented Oct 22, 2019

@techee I doubt its anything to do with Geany if its for the GTK open dialog since we don't see any keys until the dialog finishes.

Just asking a dumb question, whats the "gtk-mac-file-chooser" that the bindings are set on? And are you using it?

@JanAxelsson
Copy link
Author

JanAxelsson commented Oct 22, 2019 via email

@elextr
Copy link
Member

elextr commented Oct 22, 2019

I assume somehow the binding of the keys needs to be injected from Geany, though.

No, GTK loads them from the standard places itself (I'm assuming the location you pasted above is one).

This gtk-mac-file-chooser is nothing I have invented, but seems to come from GTK.

Well, my googling can't find it, thats why I asked, but the question was directed to @techee who might.

@JanAxelsson
Copy link
Author

With the understanding you gave, and playing around with shifting locations of gtk-keys.css, I am sure this file is not used. Could there be some issues in the launcher scripts and the environmental variables set for GTK ? The settings.ini I manage to change, so it that path is apparently honored both in the .config and in the geany.app.

@techee
Copy link
Member

techee commented Oct 23, 2019

I'm pretty sure the file is used, the keybindings just don't work for the open file dialog for some reason. For instance, try to open the Find dialog in Geany and type several words to the entry. Now you can use Alt+left/right arrow to navigate one word to the left/right. When you completely delete the contents of the css, this won't work any more. In my opinion it's some GTK issue.

@zainengineer
Copy link

You can simply use Control + L and it will show GTK's input for File Path

@pragma-git
Copy link

I know. The issue is that it breaks mac standard key combinations

@elextr
Copy link
Member

elextr commented Mar 11, 2024

I know. The issue is that it breaks mac standard key combinations

Yes, its a Linux binding, if "somebody" contributed Macos standard rebindings in a PR they can probably be included.

The only actual CSS posted was 5 years ago but its missing the -gtk-key-bindings setting for filechooser that associates the bindings with the filechooser, see here which might be why its doesn't work.

@pragma-git
Copy link

I think a bigger issue is that native file dialogs are not used.

One of the problems following that, is the problem reported in this issue. Another problem is that none of the favourite folders, OneDrive and other cloud drives, etc are visible in the dialogs. The user not only have to learn new keyboard shortcuts, he also has to go through the trouble to sync favourite folders between native and Geany file dialogs. It is not a deal breaker, but it feels "clunky" and old.

Don't know if it helps, but found these two links regarding native file dialogs as part of GTK:
https://docs.gtk.org/gtk4/class.FileChooserNative.html
https://gitlab.gnome.org/GNOME/gimp/-/issues/1830

I wish I understood how to implement this myself, but I don't. Have tried the css files, but they don't seem to pick up when Geany starts.

@elextr
Copy link
Member

elextr commented Mar 11, 2024

Did you notice that the file chooser native has two problems:

  1. its GTK4, not GTK3 which is used by Geany
  2. its deprecated

Geany used to have support for native windows dialogs but it was removed as it caused crashes in some situations and nobody supported it.

Its a moot point if Geany "should" use native dialogs, its not a native application, it is a GTK application. Whether GTK itself makes its dialogs and its keybindings more native on various platforms, thats something that needs to be taken up with GTK.

@techee
Copy link
Member

techee commented Mar 11, 2024

its GTK4, not GTK3 which is used by Geany

It's GTK3, it's only deprecated in GTK4 (there's some other class for it in GTK4).

Native dialogs would definitely be nice and if FileChooserNative works, it might be a way to go. I'll try to have a look at it if it would require many changes in Geany to migrate to this class.

@elextr
Copy link
Member

elextr commented Mar 11, 2024

(there's some other class for it in GTK4)

I had a quick look and the alternative listed GTKFileDialog says nothing about native dialogs.

I'll try to have a look at it if it would require many changes in Geany to migrate to this class.

It would need to be optional, but I think the checkbox from the windows native dialogs is still in Glade unless @eht16 got around to removing it ;-)

@eht16
Copy link
Member

eht16 commented Mar 17, 2024

I'll try to have a look at it if it would require many changes in Geany to migrate to this class.

It would need to be optional

Why would it need to be optional? If it works well on relevant platforms and do not introduce too much restrictions, why not use it completely?

but I think the checkbox from the windows native dialogs is still in Glade unless @eht16 got around to removing it ;-)

thanks for the reminder :D.

@techee
Copy link
Member

techee commented Jun 12, 2024

Native dialog support has been implemented in geany/geany#3861 and it will be included in the next release.

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

No branches or pull requests

6 participants