Window size (width and height) not remembered in the GTK4 version?
As I was trying out Fedora Rawhide (F40, GNOME 46 Wayland session) today, I noticed that gnome-system-monitor 46~alpha-1.fc40 doesn't seem to remember and restore its window dimensions on startup anymore, whereas it previously did in previous stable releases.
This is weird, because I didn't spot this issue when I tested with the git version compiled by GNOME Builder a few months ago, and a quick look at the app's main code file, I see in application.cpp that the GsmApplication::save_config ()
function is still there, and in interface.cpp there is still a gtk_window_set_default_size (GTK_WINDOW (app->main_window), width, height);
When I look at the app's gsettings using dconf-editor, and monitor the window-geometry
key, its values always remain 700
, 500
, any changes I do to the window size by resizing do not get saved into the gsetting.
In previous versions, this was controlled by a gsetting that bundled everything into it, window-state
(width, height, x pos and y pos) instead of only width and height. Is gtk_window_get_default_size
really the correct function?
In any case, the example at the bottom of https://developer.gnome.org/documentation/tutorials/save-state.html uses a different approach, it binds the properties so that they update themselves in realtime, instead of relying on a save function on shutdown.