How to get placessidebar from GtkFileChooserWidget

I have a difficulty of accessing placessidebar element from GtkFileChooserWidget. As far as I can tell there isn’t any method that will allow me to access it?

Correct: the places side bar is a private detail of the file selection dialog.

OK, so how can I for example interact with it? Specifically I need to “hide” unmount icon on filesystem entry.

You can’t do that without changing the code inside GTK and then shipping your own copy.

OK, so how can I register any sort of callback, similar to signal_clicked, that will allow me to intercept that event? So then I can deal with it?

No, you can’t do that either. You cannot change the behaviour of the file selection dialog from the outside.

OK, so basically this dialog is broken and unusable.

For you, and your very specific, unknown use case.

Not specific, I’m simply creating that dialog with setting starting path which exists on my hd. In placessidebar there is one of the entries “Filesystem root” with icon next to it and hint to that icon “unmount”. Clicking that unmount icon freezes the entire app. Surely that entry (Filesystem root) would be for everyone on that linux distribution (and plenty of people on different distros) using this dialog? Im using regular linux distro, widely used very popular. The dialog/widget is broken if one of the functionality freezes the entire app.

There’s no “file system root” in the side bar:

Even in the “Other Locations” tab:

Screenshot from 2022-03-17 13-07-36

And even there, it’s not unmountable.

Only volumes that can be unmounted by the user should have that functionality, and arguably the file system root should only be accessible by the root user.

It seems either your “regular Linux distro” is either not really regular, or you have changed some setting somewhere.

Now, this is some clue. Why would that icon show up next to the Filesystem root? Any ideas?

Maybe you’re running the application as root?

Hi, no, I’m running the app as a regular user. Linux distro: arch

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.