Merge lp:~julien-spautz/pantheon-terminal/1157350 into lp:~elementary-apps/pantheon-terminal/trunk

Proposed by Julien Spautz
Status: Rejected
Rejected by: kay van der Zander
Proposed branch: lp:~julien-spautz/pantheon-terminal/1157350
Merge into: lp:~elementary-apps/pantheon-terminal/trunk
Diff against target: 39 lines (+10/-9)
1 file modified
src/PantheonTerminalWindow.vala (+10/-9)
To merge this branch: bzr merge lp:~julien-spautz/pantheon-terminal/1157350
Reviewer Review Type Date Requested Status
David Gomes (community) Needs Fixing
Review via email: mp+155124@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Julien Spautz (julien-spautz) wrote :

And btw, the first part of the diff actually fixes bug #1059940

Revision history for this message
David Gomes (davidgomes) wrote :

So that's what I had to do, group_name, I've been looking for this for so long! Thank you Julien.

Anyways, the code style is approved, but this doesn't work so well.

Steps:
1. Open pantheon-terminal.
2. Open 3 tabs
3. In the middle tab type in "ls" or something
4. Select the middle tab and Open it in a New Window
5. The new window has a brand new TerminalWidget.

Same thing for dragging the window out. I realize this is better behavior than just a blank Pantheon Terminal, but it's still not right.

review: Needs Fixing
465. By Julien Spautz

just insert the tab, granite should not destroy it

Revision history for this message
Julien Spautz (julien-spautz) wrote :

One more bug, when dragging a tab to create a new window, and then dragging it back to the old window, the new one is empty but doesn't close.

466. By Julien Spautz

connect to tab_detached signal so we can destroy the notebook when it's empty

Revision history for this message
Julien Spautz (julien-spautz) wrote :

Seems to work now, don't forget I pushed a new revision to the granite branch, too.

Not sure if that's the way to go. DynamicNotebook is kind of a mess because it doesn't inherit from Gtk.Notebook, but owns it as a private member, so we have to manually propagate it's signals, which doesn't seem to be the best option…

Revision history for this message
Julien Spautz (julien-spautz) wrote :

Terminal still sometimes segfaults when closing a tab. Not sure why this happens.

Revision history for this message
David Gomes (davidgomes) wrote :

I can confirm the SEGFAULTs with both branches activated.

Revision history for this message
Julien Spautz (julien-spautz) wrote :

I've done some testing with DynamicNotebook in a different app but I couldn't reproduce the crashes, so it seems to be terminals fault.

The crashes in terminal always happen when closing a tab, and it seems that the tabs content is sometimes destroyed before the actual "tab_removed" signal. It also only happens when creating multiple windows, i.e., you can't crash terminal when setting "allow_new_window" to false and making the tabs non-detachable.

Revision history for this message
David Gomes (davidgomes) wrote :

I am not entirely sure about what I'm saying but a week or two ago the terminal never SEGFAULT'd, so it must have been the new Granite branches, right?

Revision history for this message
David Gomes (davidgomes) wrote :

I approve this.

review: Approve
Revision history for this message
David Gomes (davidgomes) wrote :

It needs approval actually, my bad I approved the wrong branch.

review: Needs Fixing

Unmerged revisions

466. By Julien Spautz

connect to tab_detached signal so we can destroy the notebook when it's empty

465. By Julien Spautz

just insert the tab, granite should not destroy it

464. By Julien Spautz

fix bug #1157350

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/PantheonTerminalWindow.vala'
--- src/PantheonTerminalWindow.vala 2013-03-14 15:55:01 +0000
+++ src/PantheonTerminalWindow.vala 2013-03-24 16:53:20 +0000
@@ -151,10 +151,16 @@
151 notebook.allow_new_window = true;151 notebook.allow_new_window = true;
152 notebook.allow_duplication = false;152 notebook.allow_duplication = false;
153 notebook.margin_top = 3;153 notebook.margin_top = 3;
154154 notebook.group_name = "pantheon-terminal";
155
155 notebook.tab_added.connect ((tab) => {156 notebook.tab_added.connect ((tab) => {
156 new_tab ("", tab);157 new_tab ("", tab);
157 });158 });
159
160 notebook.tab_detached.connect ((tab) => {
161 if (notebook.n_tabs == 0)
162 this.destroy ();
163 });
158164
159 notebook.tab_removed.connect ((tab) => {165 notebook.tab_removed.connect ((tab) => {
160 var t = ((tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget);166 var t = ((tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget);
@@ -299,14 +305,9 @@
299 if (new_window) {305 if (new_window) {
300 app.new_window_with_coords (x, y, false);306 app.new_window_with_coords (x, y, false);
301 var win = app.windows.last ().data;307 var win = app.windows.last ().data;
302 //win.move (x, y);308
303309 win.notebook.insert_tab (tab, -1);
304 var n = win.notebook;310
305 //remove the one automatically created after inserting
306 n.insert_tab (tab, -1);
307 n.remove_tab (n.tabs.nth_data (1));
308
309 //notebook.remove_tab (tab);
310 if (notebook.n_tabs == 0)311 if (notebook.n_tabs == 0)
311 destroy ();312 destroy ();
312 } else {313 } else {

Subscribers

People subscribed via source and target branches