Skip to content
Closed
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
10 changes: 8 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace Scratch {
create_new_tab = true;
}

if (options.contains ("new-window")) {
if (options.contains ("new-window") || has_no_command_line_args (options)) {
create_new_window = true;
}

Expand Down Expand Up @@ -137,7 +137,8 @@ namespace Scratch {
// Create a new document if requested
if (create_new_tab) {
create_new_tab = false;
activate_action (MainWindow.ACTION_PREFIX + MainWindow.ACTION_NEW_TAB, null);
var active_window_action_group = active_window.get_action_group (MainWindow.ACTION_GROUP);
active_window_action_group.activate_action (MainWindow.ACTION_NEW_TAB, null);
Comment on lines -140 to +141
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a separate fix unrelated to middle-click handling? If so should be submitted as a separate PR.

}
}

Expand Down Expand Up @@ -165,5 +166,10 @@ namespace Scratch {
public static int main (string[] args) {
return new Application ().run (args);
}

private bool has_no_command_line_args (GLib.VariantDict options) {
return options.contains ("new-tab") == false
&& options.contains (GLib.OPTION_REMAINING) == false;
}
}
}