liferea icon indicating copy to clipboard operation
liferea copied to clipboard

Is it possible to save and restore the internal geometry

Open AndyM48 opened this issue 1 year ago • 5 comments

When I open liferea I must manually restore any internal geometry to my preferred layout. For example I prefer a larger preview window, so I drag it to the larger size when I open liferea.

Liferea saves the external window geometry on exit. Is it possible to save the internal geometry at the same time?

AndyM48 avatar Jul 31 '24 08:07 AndyM48

The code actually does save the pane geometry on shutdown, but we have a longstanding bug that due to a race condition the restore on startup is not effective. Sadly trying to fix this over a year all effort so far was not successful :-(

lwindolf avatar Aug 01 '24 15:08 lwindolf

Not a show stopper fortunately

Thank you for all your efforts

AndyM48 avatar Aug 01 '24 16:08 AndyM48

I've just started the GTK4 port and will follow the best practices from the GNOME tutorial to implement GTK4 window state restoration. It might well be that this can improve the situation.

lwindolf avatar Jan 01 '25 12:01 lwindolf

Good to hear, thank you. Happy New Year.

AndyM48 avatar Jan 01 '25 12:01 AndyM48

I wish you a Happy New Year too!

lwindolf avatar Jan 01 '25 12:01 lwindolf

Commenting out:

	conf_get_bool_value (LAST_WINDOW_MAXIMIZED, &last_window_maximized);
	if (!last_window_maximized) {
		gtk_container_child_set (GTK_CONTAINER (liferea_shell_lookup ("normalViewPane")), liferea_shell_lookup ("normalViewItems"),
			"resize", TRUE, NULL);
		gtk_container_child_set (GTK_CONTAINER (liferea_shell_lookup ("wideViewPane")), liferea_shell_lookup ("wideViewItems"),
			"resize", TRUE, NULL);
	}

from /src/ui/liferea_shell.c (7297e87e2e273) fixed the pane restoration issue for my use case, from v1.15.3 and up (unfortunately I only now noticed that I actually forgot to share the info 🤦 ).

I have Liferea autostarted and tiled in the same position all the time (not maximized, nor resized/moved around), using normal view/layout, so I can't say if it fixes the issue for Wide view (most likely does) nor when starting in maximized state (though if I remember correctly it does), however the obvious trade-off is that the correct restoration is lost when unmaximizing the running instance.

To be absolutely sure I also (auto)start Liferea with: sh -c "dconf write /org/gnome/liferea/last-hpane-pos 290 && sleep 3s && liferea &" (doesn't seem to be needed anymore with 1.15.8 🤔 )

So for anybody reading/trying this, if you rarely or never maximize/unmaximize Liferea, any one or both of the above fixes might do the trick.
Btw, the "290" number for /org/gnome/liferea/last-hpane-pos needs to be adapted for your window/pane size! To get it, manually resize/set the preview pane to where you want it, quit Liferea, and run dconf read /org/gnome/liferea/last-hpane-pos.

cofi89 avatar Aug 19 '25 04:08 cofi89

The GTK4 port in main branch solves the problem. Window restoration is now implemented exactly as described in the GNOME/GTK tutorials and it works properly. The pane restoration is implemented the same way and I consider the problem solved.

Sorry that it took so long!

Fix will be released with 2.0

lwindolf avatar Sep 04 '25 09:09 lwindolf