Skip to content

Fix WinUIBackend & GtkBackend menu bar support#482

Merged
stackotter merged 1 commit intomainfrom
stackotter/fix_winui_menu_bar
Mar 11, 2026
Merged

Fix WinUIBackend & GtkBackend menu bar support#482
stackotter merged 1 commit intomainfrom
stackotter/fix_winui_menu_bar

Conversation

@stackotter
Copy link
Collaborator

@stackotter stackotter commented Mar 11, 2026

As mentioned in #388, WinUIBackend hasn't been showing app menu bars, even though it did already have all the code required to support them. This was because I had some issues with them in the past and essentially disabled them by setting the menu bar height to zero.

This PR re-enables WinUIBackend menu bars. And to fix the issue that originally made me disable support for them, it hides the window menu bars when the menu is empty.

I had to make some changes to the SceneGraphNode protocol in order to be able to compute the app's commands (menu bar items) before update each window's content, because whether or not the menu bar is empty now affects how much space is available in the windows (as the menu bar takes up window space when visible).

As a side effect of the SceneGraphNode protocol restructuring, I ended up resolving the GtkBackend menu bar support issues as well (I think because we could set the menu bar before showing the window).


This PR fully resolves #388

@stackotter stackotter force-pushed the stackotter/fix_winui_menu_bar branch 2 times, most recently from 5674b5d to 6d2fc47 Compare March 11, 2026 09:00
@stackotter stackotter force-pushed the stackotter/fix_winui_menu_bar branch from 6d2fc47 to d873fd6 Compare March 11, 2026 09:01
@stackotter stackotter changed the title Fix WinUIBackend menu bar support Fix WinUIBackend & GtkBackend menu bar support Mar 11, 2026
@stackotter stackotter merged commit e2c845d into main Mar 11, 2026
22 checks passed
@stackotter stackotter deleted the stackotter/fix_winui_menu_bar branch March 11, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GTK][WinUI] Main menu

1 participant