diff --git a/src/source_clang.cc b/src/source_clang.cc index d7a648e..bc35142 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -963,8 +963,8 @@ Source::ClangViewAutocomplete(file_path, project_path, language) { iter.forward_char(); } get_buffer()->place_cursor(iter); - while(gtk_events_pending()) - gtk_main_iteration(); + while(g_main_context_pending(NULL)) + g_main_context_iteration(NULL, false); scroll_to(get_buffer()->get_insert(), 0.0, 1.0, 0.5); } get_source_buffer()->end_user_action(); diff --git a/src/window.cc b/src/window.cc index a55f8b6..e61cba7 100644 --- a/src/window.cc +++ b/src/window.cc @@ -330,8 +330,8 @@ void Window::set_menu_actions() { }); menu->add_action("source_center_cursor", [this]() { if(notebook.get_current_page()!=-1) { - while(gtk_events_pending()) - gtk_main_iteration(); + while(g_main_context_pending(NULL)) + g_main_context_iteration(NULL, false); if(notebook.get_current_page()!=-1) notebook.get_current_view()->scroll_to(notebook.get_current_view()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); } @@ -396,8 +396,8 @@ void Window::set_menu_actions() { index=std::min(index, end_line_index); buffer->place_cursor(buffer->get_iter_at_line_index(line, index)); - while(gtk_events_pending()) - gtk_main_iteration(); + while(g_main_context_pending(NULL)) + g_main_context_iteration(NULL, false); if(notebook.get_current_page()!=-1) notebook.get_current_view()->scroll_to(notebook.get_current_view()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); } @@ -782,8 +782,8 @@ void Window::goto_line_entry() { if(line>0 && line<=buffer->get_line_count()) { line--; buffer->place_cursor(buffer->get_iter_at_line(line)); - while(gtk_events_pending()) - gtk_main_iteration(); + while(g_main_context_pending(NULL)) + g_main_context_iteration(NULL, false); if(notebook.get_current_page()!=-1) notebook.get_current_view()->scroll_to(buffer->get_insert(), 0.0, 1.0, 0.5); }