5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 11:29:10 +08:00

add new programName option to linux options (#2817)

* add new programName option to linux options

* modify changelog

* free program name string
This commit is contained in:
Zámbó, Levente 2023-08-09 23:48:09 +02:00 committed by GitHub
parent b48579892b
commit e72e4aa179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions

View File

@ -190,6 +190,12 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
C.install_signal_handlers()
if appoptions.Linux != nil && appoptions.Linux.ProgramName != "" {
prgname := C.CString(appoptions.Linux.ProgramName)
C.g_set_prgname(prgname)
C.free(unsafe.Pointer(prgname))
}
return result
}

View File

@ -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 {

View File

@ -106,6 +106,7 @@ func main() {
Icon: icon,
WindowIsTranslucent: false,
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
ProgramName: "wails"
},
Debug: options.Debug{
OpenInspectorOnStartup: false,
@ -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.

View File

@ -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