-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Replace Granite.DynamicNotebook with Hdy TabView and TabBar #760
Conversation
Outstanding issue is a transparent gap between the tab bar and the header bar through which the desktop shows: This occurs on X and on Wayland, but does not occur in Files and Code which have very similar widgets. @danirabbit Is this a styling issue or a difference in coding that I can't see? |
@danirabbit The problem seems to be due to the "terminal-window" styleclass previously applied to the grid containing the header and view. I have removed that class for now. I am not sure what it did or how to fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/MainWindow.vala
Outdated
@@ -816,54 +747,61 @@ namespace Terminal { | |||
terminal_widget.run_program (program, location); | |||
} | |||
|
|||
save_opened_terminals (true, true); | |||
terminal_widget.child_exited.connect (() => { | |||
if (!terminal_widget.killed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will cause a memory leak since the lambda keeps a reference on us and the terminal widget so neither of them will be freed :(
See https://gitlab.gnome.org/GNOME/vala/-/issues/1548
And elementary/appcenter#2193 (comment)
@leolost2605 Yes, you are right - TerminalWidgets are not being destroyed when tabs are closed. I had similar issues a long time ago with Files widgets and ended up just disconnecting the signals before closing. I'll see if I can find a better way here. |
@jeremypw for the terminal_widget you can use the instance that's always passed in signal handlers (so something like |
I'm currently trying to write the logics behind this down maybe for inclusion in docs.vala.dev and for me to better understand it since it seems to be a pretty big problem especially in widget hierarchies so I'll leave it here might be completely wrong though :)
|
@Marukesu Just noticed that the test pass in two of the builds but not in the development-target build. I have not idea why (It pass locally on OS8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests look alright, the last fail is not consistent, and i believe there's no way to get the CI's coredumps to understand what happened there, sadily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
@Marukesu Is this OK to merge now, do you think? |
@jeremypw Thank you for this! Could you add |
@ryonakano Done! Sorry - I always forget to do that |
Fixes #766
This adapts the DocumentView in Code which is already based on the Hdy widgets.
This mostly reproduces current behaviour except:
Not sure whether dropping on tab labels is correctly implemented (or even whether it should be implemented at all). At present the tab dropped on resets and navigates to the dropped location (provided there is no foreground process running). Feedback required.
Note that a lot of terminal noise is produced when a tab is closed involving multiple messages of the type:
As far as I can tell this is an issue with the Hdy widgets themselves - it occurs even if all the handlers of signals relating closing a tab are disconnected. It also occurs in Code.