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

Proposed by Gero.Bare
Status: Merged
Approved by: The Lemon Man
Approved revision: 1591
Merged at revision: 1589
Proposed branch: lp:~gero-bare/scratch/fix-1472377
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 20 lines (+8/-2)
1 file modified
src/Widgets/DocumentView.vala (+8/-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+277059@code.launchpad.net

This proposal supersedes a proposal from 2015-11-09.

Commit message

Move tab to new window from main loop

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 : Posted in a previous version of this proposal

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

review: Approve (code)
Revision history for this message
The Lemon Man (lemonboy) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/DocumentView.vala'
--- src/Widgets/DocumentView.vala 2015-10-29 23:03:09 +0000
+++ src/Widgets/DocumentView.vala 2015-11-09 21:27:51 +0000
@@ -249,8 +249,14 @@
249249
250 DocumentView other_view = other_window.add_view ();250 DocumentView other_view = other_window.add_view ();
251251
252 this.notebook.remove_tab (doc);252 // We need to make sure switch back to the main thread
253 other_view.notebook.insert_tab (doc, -1);253 // when we are modifiying Gtk widgets shared by two threads.
254 Idle.add (() => {
255 this.notebook.remove_tab (doc);
256 other_view.notebook.insert_tab (doc, -1);
257
258 return false;
259 });
254 }260 }
255261
256 private void on_doc_reordered (Granite.Widgets.Tab tab, int new_pos) {262 private void on_doc_reordered (Granite.Widgets.Tab tab, int new_pos) {

Subscribers

People subscribed via source and target branches