Crash when hiding menubar on fullscreen in X11
Motivation: I'm trying to automatically hide an application's menubar when it is fullscreened.
Steps to reproduce
- Create a
GtkApplicationWindow
with a menubar (with submenus) set to be shown. - Create a callback function that calls
gtk_application_window_set_show_menubar()
- Connect this callback to the
notify::fullscreened
signal of the window - Run the app, and open one of the menubar's items at least once.
- Fullscreening the app will then cause it to crash.
Please see the attached video and example code.
Note: This only happens under X11, Wayland behaves as expected.
Version information
GTK 4.2.1, Arch linux
Warnings
(hello:203502): Gdk-ERROR **: 13:32:39.551: The program 'hello' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 2032 error_code 3 request_code 12 (core protocol) minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the GDK_SYNCHRONIZE environment
variable to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/breakpoint trap (core dumped)