mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
fix panic when adding menuroles on linux (#4558)
* fix panic when adding menuroles on linux * update changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
db22cb234d
commit
4df077f9b2
2 changed files with 10 additions and 4 deletions
|
|
@ -34,8 +34,11 @@ void addAccelerator(GtkWidget* menuItem, GtkAccelGroup* group, guint key, GdkMod
|
|||
}
|
||||
*/
|
||||
import "C"
|
||||
import "github.com/wailsapp/wails/v2/pkg/menu"
|
||||
import "unsafe"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/wailsapp/wails/v2/pkg/menu"
|
||||
)
|
||||
|
||||
var menuIdCounter int
|
||||
var menuItemToId map[*menu.MenuItem]int
|
||||
|
|
@ -81,8 +84,10 @@ func (w *Window) SetApplicationMenu(inmenu *menu.Menu) {
|
|||
|
||||
func processMenu(window *Window, menu *menu.Menu) {
|
||||
for _, menuItem := range menu.Items {
|
||||
submenu := processSubmenu(menuItem, window.accels)
|
||||
C.gtk_menu_shell_append(C.toGtkMenuShell(unsafe.Pointer(window.menubar)), submenu)
|
||||
if menuItem.SubMenu != nil {
|
||||
submenu := processSubmenu(menuItem, window.accels)
|
||||
C.gtk_menu_shell_append(C.toGtkMenuShell(unsafe.Pointer(window.menubar)), submenu)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Added url validation for BrowserOpenURL by @APshenkin in [PR](https://github.com/wailsapp/wails/pull/4484)
|
||||
- Fixed C compilation error in onWayland on Linux due to declaration after label [#4446](https://github.com/wailsapp/wails/pull/4446) by [@jaesung9507](https://github.com/jaesung9507)
|
||||
- Use computed style when adding 'wails-drop-target-active' [PR](https://github.com/wailsapp/wails/pull/4420) by [@riannucci](https://github.com/riannucci)
|
||||
- Fixed panic when adding menuroles on Linux [#4558](https://github.com/wailsapp/wails/pull/4558) by [@jaesung9507](https://github.com/jaesung9507)
|
||||
|
||||
## v2.10.2 - 2025-07-06
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue