The Birdfont Source Code
Fix glyph selection in alternate tab
These changes was commited to the Birdfont repository Sun, 19 Jun 2016 12:02:06 +0000.
Contributing
Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
Fix glyph selection in alternate tab
--- a/libbirdfont/OtfFeatureTable.vala
+++ b/libbirdfont/OtfFeatureTable.vala
@@ -54,7 +54,8 @@
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 @@
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 ());
});
--- a/libbirdfont/OverView.vala
+++ b/libbirdfont/OverView.vala
@@ -1269,9 +1269,12 @@
}
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 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 () {