Skip to content
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
16 changes: 7 additions & 9 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,19 @@ namespace Scratch {
}

protected override void activate () {
var window = get_last_window ();
if (window != null && create_new_window) {
if (active_window == null) {
add_window (new MainWindow (true)); // Will restore documents if required
} else if (create_new_window) {
create_new_window = false;
window = new MainWindow (false); // Will NOT restore documents in additional windows
} else if (window == null) {
window = new MainWindow (true); // Will restore documents if required
window.show ();
} else {
window.present ();
add_window (new MainWindow (false)); // Will NOT restore documents in additional windows
}

active_window.present ();

// Create a new document if requested
if (create_new_tab) {
create_new_tab = false;
Utils.action_from_group (MainWindow.ACTION_NEW_TAB, window.actions).activate (null);
activate_action (MainWindow.ACTION_PREFIX + MainWindow.ACTION_NEW_TAB, null);
}
}

Expand Down