Browse Source

Fixed potential crash when scrolling to selectiondialog item

pipelines/235045657
eidheim 6 years ago
parent
commit
7455cf36ee
  1. 7
      src/selection_dialog.cpp

7
src/selection_dialog.cpp

@ -182,10 +182,11 @@ void SelectionDialogBase::show() {
cursor_changed(); cursor_changed();
} }
else if(list_view_text.get_model()->children().begin() != list_view_text.get_selection()->get_selected()) { else if(list_view_text.get_model()->children().begin() != list_view_text.get_selection()->get_selected()) {
while(Gtk::Main::events_pending()) Glib::signal_idle().connect([this] {
Gtk::Main::iteration(); if((this == SelectionDialog::get().get() || this == CompletionDialog::get().get()) && is_visible())
if(is_visible())
list_view_text.scroll_to_row(list_view_text.get_model()->get_path(list_view_text.get_selection()->get_selected()), 0.5); list_view_text.scroll_to_row(list_view_text.get_model()->get_path(list_view_text.get_selection()->get_selected()), 0.5);
return false;
});
} }
} }
if(on_show) if(on_show)

Loading…
Cancel
Save