Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs and tab-zooms not saved to settings continuously #741

Open
ldrahnik opened this issue Oct 28, 2023 · 7 comments · Fixed by #742
Open

Tabs and tab-zooms not saved to settings continuously #741

ldrahnik opened this issue Oct 28, 2023 · 7 comments · Fixed by #742
Labels
Priority: Wishlist Not a priority, but something that might be nice

Comments

@ldrahnik
Copy link
Contributor

ldrahnik commented Oct 28, 2023

What Happened?

When I open the terminal via io.elementary.terminal (--version is io.elementary.terminal 6.1.2) and together dconf ( /io/elementary/terminal/saved-state/) I see immediately updated all values except tabs and tab-zooms. Is that a known limitation or it should work? If yes please could you guide me on what I do wrong? Because other window-position, window-size even focused-tab are saved fine, immediately.

I discovered that values tabs and tab-zooms are saved when is the terminal closed manually but then when is the terminal opened and the state is restored successfully is value tabs in dconf reset to an empty array and value tab-zooms is not updated but is not reset , in my eyes it confirms does not work only continuous saving. Anyway would be helpful to have this continuous feature working as I forget a lot of times to close the terminal app before is my laptop suspended or rebooted.

Steps to Reproduce

  1. Open the terminal via io.elementary.terminal (--version -> io.elementary.terminal 6.1.2)
  2. Open in dconf /io/elementary/terminal/saved-state/
  3. Open tabs / close tabs and values of tabs and tab-zooms should reflect current state / be changed continually not only when is terminal app closed manually

Expected Behavior

Be able to restore the last tabs with defined zooms without closing the terminal manually.

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

ldrahnik@Zenbook-UP5401EA:~/$ G_MESSAGES_DEBUG=all io.elementary.terminal
(io.elementary.terminal:11923): GLib-GIO-DEBUG: 14:29:31.619: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
(io.elementary.terminal:11923): GLib-DEBUG: 14:29:31.634: unsetenv() is not thread-safe and should not be used after threads are created
(io.elementary.terminal:11923): Gtk-DEBUG: 14:29:31.634: Connecting to session manager
(io.elementary.terminal:11923): GLib-GIO-DEBUG: 14:29:31.635: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_fast: "/io/elementary/terminal/saved-state/" (establishing: 0, active: 0)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_fast: "/io/elementary/terminal/settings/" (establishing: 0, active: 0)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_fast: "/org/gnome/desktop/interface/" (establishing: 0, active: 0)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_established: "/io/elementary/terminal/saved-state/" (establishing: 1)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_established: "/io/elementary/terminal/settings/" (establishing: 1)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.635: watch_established: "/org/gnome/desktop/interface/" (establishing: 1)
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.640: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.721: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.721: change_notify: /io/elementary/terminal/saved-state/tabs
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.808: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:31.809: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:32.277: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:52.487: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:54.192: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:54.192: change_notify: /io/elementary/terminal/saved-state/window-state
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:54.192: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:54.193: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:54.193: change_notify: /io/elementary/terminal/saved-state/window-position
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:55.253: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:55.253: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:55.254: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:55.254: change_notify: /io/elementary/terminal/saved-state/window-position
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:59.528: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:59.528: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:59.529: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:29:59.529: change_notify: /io/elementary/terminal/saved-state/window-position
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:00.680: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:00.680: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:00.681: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:00.681: change_notify: /io/elementary/terminal/saved-state/window-position
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:01.753: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:01.753: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:01.753: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:01.753: change_notify: /io/elementary/terminal/saved-state/window-position
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:09.604: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:09.604: change_notify: /io/elementary/terminal/saved-state/focused-tab
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:15.081: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:15.081: change_notify: /io/elementary/terminal/saved-state/focused-tab
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:17.747: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:17.747: change_notify: /io/elementary/terminal/saved-state/focused-tab
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:18.584: change_fast
(io.elementary.terminal:11923): dconf-DEBUG: 14:30:18.584: change_notify: /io/elementary/terminal/saved-state/focused-tab

Hardware Info

No response

@jeremypw
Copy link
Collaborator

jeremypw commented Oct 28, 2023

Where a setting corresponds to a simple property of the app (e.g. a boolean or integer value) then it is easy to bind the two together so that they automaticaly keep in sync. However a list of uris is not a simple property and the setting has to be constructed in a function. I guess this is why it is done like this. However, it would not be too onerous to call the function whenever the tabs or zooms change, I think.

This would also fix the issue of the tabs/zooms not being stored if the session is ended without closing the app.

@jeremypw jeremypw added the Priority: Wishlist Not a priority, but something that might be nice label Oct 28, 2023
@ldrahnik
Copy link
Contributor Author

ldrahnik commented Oct 29, 2023

@jeremypw I made these changes https://github.com/ldrahnik/terminal/pull/1/files and it works when is tab removed or tabs are reordered but does not when a new tab is appended what is weird, in this situation is current state updated to gsettings with delay one opened tab, I do not know why atm. Do not you know? Anyway, I am satisfied even with this version which I will use on my laptop because of reason mentioned above. I can try finish work on this and make PR if you want. Let me know.

EDIT: About the new tab, I only misunderstood the purpose of the notebook events on_tab_added vs on_new_tab_requested. The code was updated and save together with insert tab now works fine.

@ldrahnik
Copy link
Contributor Author

@jeremypw Save on events zoom in/out committed.

@jeremypw
Copy link
Collaborator

@ldrahnik Thanks for looking into this! If you prepare a PR I would be happy to review it for you and merge when ready. You may need to update the gsettings in an Idle loop if it is being done in a signal handler to make sure everything is handled before saving the state.

@ldrahnik
Copy link
Contributor Author

@jeremypw Look at PR #742, please.

@ldrahnik
Copy link
Contributor Author

ldrahnik commented Nov 4, 2023

@jeremypw About tests I can imagine something like ldrahnik@21f9633 (not finished)

@jeremypw
Copy link
Collaborator

jeremypw commented Nov 5, 2023

@ldrahnik Yes, it makes sense to have tests that are explicitly designed for both situations (restore and not restore).

@jeremypw jeremypw changed the title Problem with continuous saving of tabs and tab-zooms to saved-state Tabs and tab-zooms not saved to settings continuously Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Wishlist Not a priority, but something that might be nice
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants