Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Unecessary Idle During Page Switch #720

Merged
merged 2 commits into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1035,28 +1035,19 @@ namespace Terminal {
return base.configure_event (event);
}

private void on_switch_page (Granite.Widgets.Tab? old,
Granite.Widgets.Tab new_tab) {

private void on_switch_page (Granite.Widgets.Tab? old, Granite.Widgets.Tab new_tab) {
current_terminal = get_term_widget (new_tab);
/* The font-scales of all terminals are currently the synchronized through saved-state binding */
new_tab.icon = null;
Idle.add (() => {
get_term_widget (new_tab).grab_focus ();
update_copy_output_sensitive ();
title = current_terminal.window_title != "" ? current_terminal.window_title
: current_terminal.current_working_directory;
if (Granite.Services.System.history_is_enabled () &&
Application.settings.get_boolean ("remember-tabs")) {

Terminal.Application.saved_state.set_int (
"focused-tab",
notebook.get_tab_position (new_tab)
);
}

return false;
});
if (Granite.Services.System.history_is_enabled () && Application.settings.get_boolean ("remember-tabs")) {
Application.saved_state.set_int ("focused-tab", notebook.get_tab_position (new_tab));
}

title = current_terminal.window_title != "" ? current_terminal.window_title
: current_terminal.current_working_directory;

update_copy_output_sensitive ();
current_terminal.grab_focus ();
}

private void open_tabs () {
Expand Down