Clone in a terminal:
Commit 0f5029c
Johan Mattsson - 2016-06-19T12:02:06+00:00
0f5029c9384cb29a96484b5b0d38b9680544d3ffjohan.mattsson.m@gmail.com

Fix glyph selection in alternate tab

Changed files (2)

Diff

diff --git a/libbirdfont/OtfFeatureTable.vala b/libbirdfont/OtfFeatureTable.valaindex 40c3e76..0a60b25 100644--- a/libbirdfont/OtfFeatureTable.vala+++ b/libbirdfont/OtfFeatureTable.vala@@ -54,7 +54,8 @@ public class OtfFeatureTable : Table { 			 			gs.selected_glyph.connect ((gc) => { 				glyph_collection = gc;-				replacement_glyph = null;		+				replacement_glyph = null;+				Tool.yield ();		 				MainWindow.get_tab_bar ().select_tab_name (get_name ()); 			}); 			@@ -63,7 +64,8 @@ public class OtfFeatureTable : Table { 			GlyphSelection gs = new GlyphSelection (); 			 			gs.selected_glyph.connect ((gc) => {-				replacement_glyph = gc;		+				replacement_glyph = gc;+				Tool.yield ();		 				MainWindow.get_tab_bar ().select_tab_name (get_name ()); 			}); 			diff --git a/libbirdfont/OverView.vala b/libbirdfont/OverView.valaindex 0e88a08..17eec3c 100644--- a/libbirdfont/OverView.vala+++ b/libbirdfont/OverView.vala@@ -1269,9 +1269,12 @@ public class OverView : FontDisplay { 	}  	public void open_overview_item (OverViewItem i) {+		return_if_fail (!is_null (i));+		 		if (i.glyphs != null) { 			open_glyph_signal ((!) i.glyphs);-			((!) i.glyphs).get_current ().close_path ();+			GlyphCollection gc = (!) i.glyphs;+			gc.get_current ().close_path (); 		} else { 			open_new_glyph_signal (i.character); 		}@@ -1405,7 +1408,20 @@ public class OverView : FontDisplay { 	} 	 	public void open_current_glyph () {-		open_overview_item (selected_item);+		// keep this object even if open_glyph_signal closes the display+		this.ref ();+		 +		selected_item = get_selected_item ();+		if (selected_item.glyphs != null) {+			open_glyph_signal ((!) selected_item.glyphs);+			GlyphCollection? gc2 = selected_item.glyphs;+			GlyphCollection gc = (!) selected_item.glyphs;+			gc.get_current ().close_path ();+		} else {+			open_new_glyph_signal (selected_item.character);+		}+		+		this.unref (); 	}  	public override void update_scrollbar () {

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112