fix(frontend): honor -e/--executable and -b/--bottle CLI options in GUI#4521
Open
goingforstudying-ctrl wants to merge 1 commit into
Open
Conversation
564484f to
273d4f5
Compare
Author
|
rebased on latest main |
The GUI frontend was registering --executable, --bottle, and --arguments options but never acting on them. When users passed -e or -b to the main app binary, the options were silently ignored and the main window opened instead of launching the requested executable. This fix: 1. Parses the --arguments option (was registered but never read) 2. When --executable is provided with --bottle, launches via bottles-cli 3. When --executable is provided without --bottle, shows BottlePickerDialog 4. Returns early so the main window is not opened when launching an exe Fixes bottlesdevs#3606
273d4f5 to
421a4aa
Compare
Author
|
rebased on latest main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The GUI frontend (
bottles/frontend/main.py) registers--executable(-e),--bottle(-b), and--arguments(-a) as command-line options, butdo_command_line()never acts on them. When users launch the main Bottles app with these flags (e.g.,flatpak run com.usebottles.bottles -e /path/to/game.exe -b my-bottle), the options are parsed and then silently discarded—the main window opens instead of launching the requested executable.This is a regression in user expectations because
bottles-clihandles these same options correctly.Root Cause
arg_argswas not declared, and the"arguments"option was never read fromcommands.-eand-b, the code fell through toself.do_activate(), which createsBottlesWindow.BottlesWindowonly acceptsarg_bottle; it has no parameter forarg_exe, so the executable path is lost.Changes
arg_args = Noneclass variable."arguments"indo_command_line().arg_exeis set andarg_bottleis set, launch the executable viabottles-cli run -b <bottle> -e <exe> [-a <args>]and return early.arg_exeis set withoutarg_bottle, showBottlePickerDialog(the same behavior already used for URI handling) and return early.Verification Steps
flatpak run com.usebottles.bottles -e /path/to/executable.exeBottlePickerDialogopens to choose a bottle.flatpak run com.usebottles.bottles -b my-bottle -e /path/to/executable.exeflatpak run com.usebottles.bottles -b my-bottle -e /path/to/executable.exe -a "--some-arg"Related Issue
Fixes #3606