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

add new programName option to linux options #2817

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions v2/internal/frontend/desktop/linux/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.

C.install_signal_handlers()

if appoptions.Linux != nil && appoptions.Linux.ProgramName != "" {
C.g_set_prgname(C.CString(appoptions.Linux.ProgramName))
lyimmi marked this conversation as resolved.
Show resolved Hide resolved
}

return result
}

Expand Down
9 changes: 9 additions & 0 deletions v2/pkg/options/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ type Options struct {
// - WebviewGpuPolicyOnDemand
// - WebviewGpuPolicyNever
WebviewGpuPolicy WebviewGpuPolicy

// ProgramName is used to set the program's name for the window manager via GTK's g_set_prgname().
//This name should not be localized. [see the docs]
//
//When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's Name
//property differs form the executable's filename.
//
//[see the docs]: https://docs.gtk.org/glib/func.set_prgname.html
ProgramName string
}

type Messages struct {
Expand Down
14 changes: 13 additions & 1 deletion website/docs/reference/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ func main() {
Linux: &linux.Options{
Icon: icon,
WindowIsTranslucent: false,
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
ProgramName: "wails"
},
Debug: options.Debug{
OpenInspectorOnStartup: false,
Expand Down Expand Up @@ -898,6 +899,17 @@ Default: `WebviewGpuPolicyAlways`
| WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents|
| WebviewGpuPolicyNever | Hardware acceleration is always disabled |
#### ProgramName
This option is used to set the program's name for the window manager via GTK's g_set_prgname().
This name should not be localized, [see the docs](https://docs.gtk.org/glib/func.set_prgname.html).
When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's `Name`
property differs form the executable's filename.
Name: ProgramName<br/>
Type: string<br/>
### Debug
This defines [Debug specific options](#Debug) that apply to debug builds.
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added smart functionality for the default context-menu in production with CSS styles to control it. Added by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2748)
- Added custom error formatting to allow passing structured errors back to the frontend.
- Added sveltekit.mdx guide. Added by @figuerom16 in [PR](https://github.com/wailsapp/wails/pull/2771)
- Added ProgramName option to [linux.Options](/docs/reference/options#linux). Added by @lyimmi in [PR](https://github.com/wailsapp/wails/pull/2817)

### Changed

Expand Down
Loading