Merge lp:~gero-bare/scratch/fix-1472377 into lp:~elementary-apps/scratch/scratch

Proposed by Gero.Bare
Status: Superseded
Proposed branch: lp:~gero-bare/scratch/fix-1472377
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 19 lines (+7/-2)
1 file modified
src/Widgets/DocumentView.vala (+7/-2)
To merge this branch: bzr merge lp:~gero-bare/scratch/fix-1472377
Reviewer Review Type Date Requested Status
The Lemon Man (community) code Approve
Review via email: mp+276929@code.launchpad.net

This proposal has been superseded by a proposal from 2015-11-09.

Description of the change

Move tab to new window from main loop (lp:1472377)

To post a comment you must log in.
Revision history for this message
The Lemon Man (lemonboy) wrote :

Code-wise LGTM, I'd just add a short comment explaining why it's being done in the main thread.

review: Approve (code)
lp:~gero-bare/scratch/fix-1472377 updated
1588. By Gero.Bare

Rework in the critical section.

1589. By Gero.Bare

Minor change.

1590. By Gero.Bare

Correcting the comment.

1591. By Gero.Bare

Some style fixes.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/DocumentView.vala'
2--- src/Widgets/DocumentView.vala 2015-10-29 23:03:09 +0000
3+++ src/Widgets/DocumentView.vala 2015-11-09 21:22:02 +0000
4@@ -249,8 +249,13 @@
5
6 DocumentView other_view = other_window.add_view ();
7
8- this.notebook.remove_tab (doc);
9- other_view.notebook.insert_tab (doc, -1);
10+ //We need to make sure switch back to the main thread
11+ //when we are modifiying Gtk widgets shared by two threads.
12+ Idle.add (() => {
13+ this.notebook.remove_tab (doc);
14+ other_view.notebook.insert_tab (doc, -1);
15+ return false;
16+ });
17 }
18
19 private void on_doc_reordered (Granite.Widgets.Tab tab, int new_pos) {

Subscribers

People subscribed via source and target branches