GtkApplicationWindow show-menubar property not settable via GtkBuilder
Steps to reproduce
- Run
gtk4-demo-application
in an environment that does not have shell menubar support (e.g. XFCE). Observe that the menu bar is visible. - Apply the attached patch and recompile.
- Run the demo again. Observe that the menu bar is not visible.
Current behavior
Setting show-menubar
to TRUE
via the .ui
file for some reason doesn’t work (in fact one can even inspect the value of the property afterwards and discover that it is FALSE
!). It’s documented as being “read, write, construct”, suggesting that this should be acceptable, and in fact if one calls gtk_application_window_set_show_menubar
in the realize
callback, that also works properly.
Expected outcome
Either the property can be set in a .ui
file like almost any other property, or the documentation calls out that it cannot be.
Version information
- GTK 4.16.12 (local build in a temporary directory, using
meson setup build -Dwayland-backend=false -Dwin32-backend=false -Dmacos-backend=false -Dmedia-gstreamer=disabled -Dprint-cups=disabled
) - Gentoo Linux
- X11
- Nvidia proprietary 550.142
- Mesa 24.3.3
- XFCE 4.18
Patch showing the problem
Edited by Christopher Head