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

Handle-middle-click-24 #1378

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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;
}
}
}