23

When I use an external monitor, my file selection dialog boxes seem to be huge -- wider than my larger screen. I assume it is a nautilus issue since it happens whether I'm trying to open a file to upload (in firefox) or attach (in thunderbird) or just open it in LibreOffice. See screenshot:

Screenshot

The browser window fills my left-hand monitor, the "open" dialog is wider than one screen, and wider than the window that spawned it. It's huge. It didn't used to be huge.

Is there some way to force dialog windows to be smaller by default? Whenever I try to open/attach/upload a file I have to re-size the finder dialog before I can see what I'm looking at. I don't understand why it is defaulting to such a huge window.

Jorge Castro
  • 71,754
Amanda
  • 9,333

7 Answers7

17

I managed to find a solution by figuring out that the dialog modal is always 1440 px wide. So I did grep -r "1440" ~/.config (I also looked in ~/.gnome, ~/.gconf, ~/.gconfd/ but they didn't turn up anything interesting.) I stumbled upon this gem:

.config/gtk-2.0/gtkfilechooser.ini:GeometryWidth=1440

Removing that line (and the corresponding GeometryHeight) solved the problem for me.

Amanda
  • 9,333
4

The window size in stored in a dconf key. You should install dconf-editor (it's in the software centre). Then, navigate to org.gtk.settings.file-chooser and adjust the window-size key.

Does this solve your problem?

Timo Kluck
  • 8,893
  • No, it doesn't. – Amanda Feb 08 '12 at 21:09
  • 2
    It always automatically resets to the old value. – xuhdev Apr 11 '17 at 10:01
  • @xuhdev have you been able to fix this issue? I'm struggling with issue after switching to 17.10 and recently to 18.04 alpha and still have the problem. – Moonwalker Feb 23 '18 at 20:13
  • ok, problem resolved by changing both size of file picker and its coordinates x,y. For some reason x,y were negative – Moonwalker Feb 24 '18 at 10:39
  • It worked once by setting both window-size and window-position to default, which was -1,-1 for both. But the default values got modified to the last position and size. There doesn't seem to be a way to lock the default values. Setting values in ~/.config/gtk-2.0/gtkfilechooser.ini as suggested in other answers didn't help either. But, one thing I noticed was that the manually modified window size other than (-1, -1) in dconf setting persists across different operations. Otherwise it defaults to a proportion of the largest monitor. Strange ways I say. – Sri Apr 14 '21 at 15:11
  • I expect that the default of (-1, -1) for window size should persist, and it's result should be to open to a proportion of the monitor on which file-chooser is opened, or a proportion of the smallest monitor, not the largest. The behavior for the window position is as expected though, i.e., if we set it to default (-1, -1) in dconf, everytime thereafter the dialog opens approximately centered on the monitor on which the app opening the file-chooser is on. – Sri Apr 14 '21 at 15:24
3

If I just do ALT-{SPACE BAR} and choose Restore it makes the box smaller. Then, next time it will open whatever size you made it.

  • 1
    Awesome! Tried the suggestion and edited the gtkfilechooser.ini file but it didn't work. Also tried the dconf-editor suggestion and it didn't work. This one is simple and fixes the problem! Thank. – Sufian May 31 '20 at 17:18
2

I solved this by modifying a plugin in compiz-config manager: Windows Manager:Windows Rules:Size Rules:

New-> Size Windows: "type=Dialog", and set the size.

Florentino
  • 21
  • 1
1

This worked for me: To prevent the settings from resetting you need to add StartupMode=cwd to the ~/.config/gtk-2.0/gtkfilechooser.ini file. Something like below.

GeometryX=100
GeometryY=100
GeometryWidth=600
GeometryHeight=400
StartupMode=cwd
Tomo90
  • 11
0

I'm not sure, but it looks like the Archlinux guys had a similar issue where the gconf-key /apps/nautilus/preferences/navigation_window_saved_geometry was missing.

Does this solve the problem?

root-11
  • 1,092
  • This is unrelated. The problem in this question is file selection dialogs, not Nautilus. Furthermore, the referenced GConf key already exists on my machine and is set to the size at which Nautilus windows open (598x318 in my case). And, the referenced page describes a bug existing in 2009, which has presumably been fixed by now. – Scott Severance Feb 03 '12 at 18:42
  • No dice. The key is there and changing it doesn't seem to impact the file selector dialog size. – Amanda Feb 04 '12 at 02:18
  • ok. sorry it didn't help. One option less then... – root-11 Feb 04 '12 at 13:26
0

Open the file below (no need to terminal; it’s under your own home):

 ~/.config/gtk-2.0/gtkfilechooser.ini

I solved my problem on my netbook by this numbers:

GeometryX=100
GeometryY=100
GeometryWidth=600
GeometryHeight=400

I’m not sure what these values really mean; but they are good and position the file chooser at middle center of your screen.

AliNajafies
  • 5,874