Sometimes GTK modal dialogs are not modal --- bug or feature? -
Sometimes GTK modal dialogs are not modal --- bug or feature? -
when create custom dialog in gtk (both, gtk2 or gtk3) , set modal, input other windows of application ignored. works always, fails under conditions.
when add together scrolledwindow containing treeview dialog, still works supposed. but if fill treeview entries until scrolledwindow starts display scroll bars --- modality lost , can click on other windows!
here basic illustration able set up. it's written in vala, you'll idea:
class mydialog: gtk.dialog { public mydialog() { this.modal = true; var info = new gtk.liststore(1, typeof(string)); // increment number -- dialog not modal anymore! (int i=0; i<2; ++i) { gtk.treeiter current; data.append(out current); data.set(current, 0, "lorem ipsum"); } var render = new gtk.cellrenderertext(); var column = new gtk.treeviewcolumn(); column.pack_start(render, true); column.add_attribute(render, "text", 0); var treeview = new gtk.treeview.with_model(data); treeview.append_column(column); treeview.show(); var scroll = new gtk.scrolledwindow(null, null); scroll.set_size_request(100, 100); scroll.add(treeview); scroll.show(); (this.get_content_area() gtk.box).add(scroll); } } int main (string[] args) { gtk.init (ref args); var window = new gtk.window(); window.set_default_size(350, 170); window.destroy.connect(gtk.main_quit); var button = new gtk.button.with_label("click me!"); button.clicked.connect(() => { var dialog = new mydialog(); dialog.set_transient_for(window); dialog.run(); dialog.destroy(); }); window.add(button); window.show_all(); gtk.main(); homecoming 0; }
compile with:
valac --pkg gtk+-3.0 main.vala
am missing something? behaviour wanted? or bug? if so, there workaround?
edit: investigated bit further: problem disappears when overlay-scrollbars ubuntu uninstalled. it's not solved yet, know have study this...
definitely bug. post bug study and/or upgrade gtk+ lib.
gtk modal-dialog vala
Comments
Post a Comment