10

For some reason my terminals insist on starting maximized since a couple of days. Which is neither a wanted behaviour nor especially useful on an UHD display. I might have closed a terminal window in maximized state and for some reason Gnome has saved that...where exactly?

Where are window properties for different applications saved and when? In my experience this behaves a little erratically anyway and I'd like to edit those preferences if "automatic mode" behaves weird.


Bionic Desktop with Gnome 3.28.2, Gnome-Terminal

Annahri
  • 135
  • 5
Hinz
  • 562
  • 7
  • 21

2 Answers2

9

Gnome does not keep track of window size or state when a program is running or is closed. The window size and state upon program start is controlled by the application itself. Some applications will remember their windows settings between launches, others won't. Some use gsettings to store window sizes, others use a text config file, others do not store that at all.

Gnome does not keep track of where windows are positioned. Instead, it (actually the window manager Mutter) determines the position based on some algorithm. By default, an algorithm is used, where windows are maximally placed on place that is still free, or stacked if no free desktop space is available. This behavior can be changed to center new windows by changing the setting "org.gnome.mutter center-new-windows", eventually using Gnome Tweaks which exposes that setting. Programs themselves also may or may not store coordinates of the windows and restore them when relaunched.

I am aware that this does not solve your current issue of the always maximized terminal, but it answers the question you asked, i.e., where these settings are stored.

vanadium
  • 82,909
  • 6
  • 116
  • 186
6

In the case of the gnome-terminal app, there is a setting for that in the user profile (preferences):

Gnome-terminal window
  > Hamburger menu button
    > Preferences
      > "Preferences" window > sidebar > current profile (marked by checkmark)
        > "Text" tab > "Text appearance" section
          > "Initial terminal size" form group

terminal preferences screenshot

Beyond this setting, it is also interesting whether the window shows up in the center of the screen, or or somewhat to the left, or entirely to the left... In the case of gnome-terminal, I don't know where that is regulated.

Impact by Gnome Tweaks

The Gnome Tweaks app offers a setting to start every window at the center of the screen:

> Tweaks app
  > "Windows" sidebar item
    > "Center New Windows" toggle

Digging in gsettings

If you install dconf-editor, you can find numerous cases where the window position is stored in specific apps' gsettings schema.

sudo apt install dconf-editor

Then use the app's search feature: window-position related settings seem to come under the names of window-position, window-state, and window-ratio. So an useful search term in dconf is just window-.

Levente
  • 3,672
  • 1
  • 18
  • 40
  • If set this to 100x32 and it still set that way. Window's maximized to screen size. I'll have a look into dconf. – Hinz Feb 10 '21 at 11:08
  • @Hinz Do you mean you have set it as such and the setting keeps being ignored and it still opens full screen? – Levente Feb 10 '21 at 11:09
  • yes, exactly. Same as if you'd pull the window to top of screen e.g. – Hinz Feb 10 '21 at 11:10
  • Have you installed a new theme or gnome-shell theme recently? Otherwise look through `~/.bashrc` or `~./bash_profile` files? – Levente Feb 10 '21 at 11:28
  • If I unmaximize the terminal-window by pulling its title bar away from the screen's top, it takes on normal size for 100x32. No luck in dconf-settings. Nothing weird seems to be set for the terminal-app. – Hinz Feb 10 '21 at 11:29
  • Do you run any specific app in the terminal when this happens? Vim and Gvim can impact it through their corresponding `.vimrc` and `.gvimrc` files through `lines` and `columns` keys. – Levente Feb 10 '21 at 11:30
  • No, didn't touch bashrc recently, and nothing running in the shell, just a prompt. Ah, well I'll have to live with it I guess. – Hinz Feb 10 '21 at 11:32