Directory GtkFileChooserButton inside GtkPopover does not show menu in Wayland
moving from https://bugzilla.gnome.org/show_bug.cgi?id=792895
Attached a simple vala testcase. compile with "valac --pkg gtk+-3.0 filechooser.vala". Steps to reproduce:
- compile with "valac --pkg gtk+-3.0 filechooser.vala"
- run the compiled filechooser application
- click the About toggle button from the headerbar
- click the filechooser button from the popover appearing expected: filechooser list/dropdown appears what happens: nothing
- focus another window
- click the filechooser from the unfocused window ( from the still visible popover), but without focusing the window before what happens: this time filechooser list/dropdown appears, select a folder this time on subsequent clicks of the filechooser it always works, it looks like the magic lies in the default selection of (None)
public class Application : Gtk.Application {
Gtk.ToggleButton toggle;
Gtk.Popover popover;
public Application () {
Object(application_id: "my.application",
flags: ApplicationFlags.FLAGS_NONE);
}
protected override void activate () {
// create the window of this application and show it
Gtk.ApplicationWindow window = new Gtk.ApplicationWindow (this);
window.set_default_size (300, 200);
window.set_border_width (10);
// add headerbar with button
Gtk.HeaderBar headerbar = new Gtk.HeaderBar();
headerbar.show_close_button = true;
headerbar.title = "Window";
window.set_titlebar (headerbar);
toggle = new Gtk.ToggleButton.with_label ("About");
toggle.show ();
popover = new Gtk.Popover(toggle);
popover.height_request = 100;
popover.width_request = 100;
Gtk.FileChooserButton chooser = new Gtk.FileChooserButton ("Select folder", Gtk.FileChooserAction.SELECT_FOLDER);
chooser.show();
popover.add (chooser);
toggle.bind_property ("active", popover, "visible", BindingFlags.BIDIRECTIONAL);
// add button to headerbar
headerbar.pack_end (toggle);
window.show_all ();
}
public static int main (string[] args) {
Application app = new Application ();
return app.run (args);
}
}
The attached test case is working fine for me in weston but not when using mutter.
Does this mean that this is not a gtk+ bug but a mutter bug?
I'd say so, yes. It's probably due to the modal popover taking a grab and then the combobox menu tries to take another one. I tried reassigning to mutter but the mutter bugtracker is on gitlab now so someone should open a new bug/issue there.