Browse Source

Replaced old gtk_main_iteration with newer g_main_context_iteration.

merge-requests/365/head
eidheim 10 years ago
parent
commit
85d66b8f2d
  1. 4
      src/source_clang.cc
  2. 12
      src/window.cc

4
src/source_clang.cc

@ -963,8 +963,8 @@ Source::ClangViewAutocomplete(file_path, project_path, language) {
iter.forward_char(); iter.forward_char();
} }
get_buffer()->place_cursor(iter); get_buffer()->place_cursor(iter);
while(gtk_events_pending()) while(g_main_context_pending(NULL))
gtk_main_iteration(); g_main_context_iteration(NULL, false);
scroll_to(get_buffer()->get_insert(), 0.0, 1.0, 0.5); scroll_to(get_buffer()->get_insert(), 0.0, 1.0, 0.5);
} }
get_source_buffer()->end_user_action(); get_source_buffer()->end_user_action();

12
src/window.cc

@ -330,8 +330,8 @@ void Window::set_menu_actions() {
}); });
menu->add_action("source_center_cursor", [this]() { menu->add_action("source_center_cursor", [this]() {
if(notebook.get_current_page()!=-1) { if(notebook.get_current_page()!=-1) {
while(gtk_events_pending()) while(g_main_context_pending(NULL))
gtk_main_iteration(); g_main_context_iteration(NULL, false);
if(notebook.get_current_page()!=-1) 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); 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); index=std::min(index, end_line_index);
buffer->place_cursor(buffer->get_iter_at_line_index(line, index)); buffer->place_cursor(buffer->get_iter_at_line_index(line, index));
while(gtk_events_pending()) while(g_main_context_pending(NULL))
gtk_main_iteration(); g_main_context_iteration(NULL, false);
if(notebook.get_current_page()!=-1) 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); 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()) { if(line>0 && line<=buffer->get_line_count()) {
line--; line--;
buffer->place_cursor(buffer->get_iter_at_line(line)); buffer->place_cursor(buffer->get_iter_at_line(line));
while(gtk_events_pending()) while(g_main_context_pending(NULL))
gtk_main_iteration(); g_main_context_iteration(NULL, false);
if(notebook.get_current_page()!=-1) if(notebook.get_current_page()!=-1)
notebook.get_current_view()->scroll_to(buffer->get_insert(), 0.0, 1.0, 0.5); notebook.get_current_view()->scroll_to(buffer->get_insert(), 0.0, 1.0, 0.5);
} }

Loading…
Cancel
Save