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
1=== modified file 'src/PantheonTerminalWindow.vala'
2--- src/PantheonTerminalWindow.vala 2013-03-14 15:55:01 +0000
3+++ src/PantheonTerminalWindow.vala 2013-03-24 16:53:20 +0000
4@@ -151,10 +151,16 @@
5 notebook.allow_new_window = true;
6 notebook.allow_duplication = false;
7 notebook.margin_top = 3;
8-
9+ notebook.group_name = "pantheon-terminal";
10+
11 notebook.tab_added.connect ((tab) => {
12 new_tab ("", tab);
13 });
14+
15+ notebook.tab_detached.connect ((tab) => {
16+ if (notebook.n_tabs == 0)
17+ this.destroy ();
18+ });
19
20 notebook.tab_removed.connect ((tab) => {
21 var t = ((tab.page as Gtk.Grid).get_child_at (0, 0) as TerminalWidget);
22@@ -299,14 +305,9 @@
23 if (new_window) {
24 app.new_window_with_coords (x, y, false);
25 var win = app.windows.last ().data;
26- //win.move (x, y);
27-
28- var n = win.notebook;
29- //remove the one automatically created after inserting
30- n.insert_tab (tab, -1);
31- n.remove_tab (n.tabs.nth_data (1));
32-
33- //notebook.remove_tab (tab);
34+
35+ win.notebook.insert_tab (tab, -1);
36+
37 if (notebook.n_tabs == 0)
38 destroy ();
39 } else {

Subscribers

People subscribed via source and target branches