You are not logged in.

#1 2017-02-24 22:45:50

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

How to set default size for GTK+ 3 file dialog?

Problem: Currently file chooser dialogs in GTK+ 3 applications are higher than the screen, and can only be left by pressing ESC. This is independent of the window manager.

How do I configure the default size for file chooser dialogs?

In GTK+ 2 there is an ini file for file chooser dialogs, somewhere beneath .config. Can this be used for GTK+ 3 as well?

Offline

#2 2017-02-25 00:35:26

toz
Member
Registered: 2011-10-28
Posts: 497

Re: How to set default size for GTK+ 3 file dialog?

gsettings set org.gtk.Settings.FileChooser window-size '(w, h)'

Offline

#3 2017-02-25 09:42:15

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: How to set default size for GTK+ 3 file dialog?

toz wrote:
gsettings set org.gtk.Settings.FileChooser window-size '(w, h)'

Thanks. However, the setting is reset any time I start a GTK+ 3 application:

~ $ gsettings set org.gtk.Settings.FileChooser window-size '(800,600)'
~ $ gsettings get org.gtk.Settings.FileChooser window-size
(800, 600)
~ $ evince
~ $ gsettings get org.gtk.Settings.FileChooser window-size
(1203, 902)

What can we do?

The file chooser dialog is unusable with only part of it visible. The thing here is that the screen is a high res screen, and so I've enabled:

GDK_SCALE=2

This unfortunately also doubles the size of the file dialog.

Offline

#4 2017-02-25 15:16:00

toz
Member
Registered: 2011-10-28
Posts: 497

Re: How to set default size for GTK+ 3 file dialog?

Then the application (evince) is resetting the size.

I see you have opened a bug report. This is probably the way to go.

Offline

#5 2017-02-25 16:16:53

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: How to set default size for GTK+ 3 file dialog?

Thanks for the suggestion, I already did that, after asking in the GTK+ mailing list as well: GNOME Bugzilla – Bug 779218

Screenshot: screenshot of Emacs with file chooser dialog open

Window manager here is FVWM with my hiwiwi configuration. The issue, however, is also visible with TWM in default configuration.

Guess a rollback is necessary for the time being… (not today, though, won’t be on location)

Offline

#6 2017-02-25 16:28:56

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: How to set default size for GTK+ 3 file dialog?

toz wrote:

Then the application (evince) is resetting the size.

Forgot to mention: All GTK+ 3 applications with file chooser dialog are affected.

Offline

#7 2017-02-25 16:48:53

toz
Member
Registered: 2011-10-28
Posts: 497

Re: How to set default size for GTK+ 3 file dialog?

I'm not able to replicate that with my GTK3 apps (mousepad, transmission-gtk, gnumeric, abiword). They all respect the gsettings window-size setting. I'm using the Xfce DE.

Installed evince and it respects the setting as well.

What version of gtk3 are you running?

Name            : gtk3
Version         : 3.22.8-1

Note that I am not using GDK_SCALE.

Offline

#8 2017-02-25 18:01:29

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: How to set default size for GTK+ 3 file dialog?

toz wrote:

What version of gtk3 are you running?

$ pkg-config --modversion gtk+-3.0
3.22.8

Note that I am not using GDK_SCALE.

If it's not too much trouble, could you try something as follows and tell me how it goes?

$ export GDK_SCALE=2
$ evince

Offline

#9 2017-02-25 19:09:38

toz
Member
Registered: 2011-10-28
Posts: 497

Re: How to set default size for GTK+ 3 file dialog?

With GDK_SCALE=2 set, evince no longer properly sizes the FileChooserDialog. Its like it ignores that setting.

Offline

#10 2017-02-25 19:13:57

feklee
Member
Registered: 2015-04-03
Posts: 57
Website

Re: How to set default size for GTK+ 3 file dialog?

toz wrote:

With GDK_SCALE=2 set, evince no longer properly sizes the FileChooserDialog. Its like it ignores that setting.

Thanks for verifying the issue!

As a workaround, it may work to use FVWM to resize the window after it has been rendered. Gave it a brief try and I didn't succeed, but that was within an otherwise complex FVWM configuration.

Offline

Board footer

Powered by FluxBB