Window positions on application startup

I’m currently trying out GNOME 3.36 on Fedora 32 and noticed the following issue that affects my setup: During startup, some applications (such as Chromium) seem to do a great job at restoring the position and size of the application window that was most recently closed. During the startup of other applications (such as Firefox), however, the opened window seems to be positioned at non-intuitive positions or even entirely at random. The previous size of the window, however, was restored in all my attempts.

Based on this observation, I had a look at the window positions of GNOME applications such as Nautilus, Calendar, and Photos. Most of them seem to open at non-intuitive positions as well. Sometimes, this will be the center of the screen. Sometimes, this will be the top-left corner of the screen. I was unable to recognize a reproducible pattern here. I noticed this for both the Wayland and the X11 versions of GNOME, although the nondeterminism seems to be more pronounced for the Wayland version.

This made me wonder: What is the intended behavior? How should the window position be determined?

And since I would prefer all my applications to just remember where they were positioned previously: Is there a way to get GNOME to take care of this? Or do I have to look out for applications that handle the positioning of windows in the same way that Chromium does?

To avoid possible confusion: GNOME 3.36 is the first DE that I try out on a 4K monitor. It’s very much possible that it is the same for all other DEs or GNOME versions. I just haven’t cared or noticed before.

1 Like

Not by applications. Positioning windows is the job of the window manager, since it’s the only privileged component of the session that:

  1. knows the geometry of every output
  2. knows where all the windows are placed
  3. can access the global coordinate system

Applications may have access to the first one, but they definitely don’t have access to the latter two—at least in Wayland, and most definitely they shouldn’t do that on X11 either.

Ideally, GNOME Shell could remember the location of every application, and store it out of band, but there are no current mechanisms for letting applications restore this information, especially since the layout of the windows or the geometry of the outputs might have changed, leading to weird results. We would need a better way to negotiate session saving and restoring than we currently have.

1 Like

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