← Back to team overview

compiz team mailing list archive

[Bug 1078694] Re: Modal dialog broken on Unity

 

This bug is absolutely trivial to reproduce, here is a minimal GTK+
program which shows it:

#include <gtk/gtk.h>

static void activate_test(GtkMenuItem*, GtkWindow* window)
{
    GtkWidget* dialog = gtk_message_dialog_new(window, GTK_DIALOG_MODAL,
        GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "a message", NULL);
    gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);
}

int main(int argc, char** argv)
{
    gtk_init(&argc, &argv);
    GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    GtkWidget* menu = gtk_menu_new();
    GtkWidget* mi = gtk_menu_item_new_with_mnemonic("_Test");
    g_signal_connect(mi, "activate", G_CALLBACK(activate_test), window);
    gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);

    mi = gtk_menu_item_new_with_mnemonic("E_xit");
    g_signal_connect(mi, "activate", G_CALLBACK (gtk_main_quit), NULL);
    gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
    mi = gtk_menu_item_new_with_mnemonic("_File");
    gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), menu);

    GtkWidget* menubar = gtk_menu_bar_new();
    gtk_menu_shell_append(GTK_MENU_SHELL(menubar), mi);
    gtk_widget_show_all(menubar);
    gtk_container_add(GTK_CONTAINER(window), menubar);

    g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
    gtk_widget_show(window);
    gtk_main();
    return 0;
}

The menu stays enabled while the message box is shown and so multiple
message boxes can be opened.

Ubuntu behaviour here totally breaks the application logic and is
incompatible with GTK+ on all the other systems. It's amazing that this
is apparently not considered to be a problem at all.

** Changed in: compiz (Ubuntu)
       Status: Expired => Confirmed

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in Ubuntu.
https://bugs.launchpad.net/bugs/1078694

Title:
  Modal dialog broken on Unity

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/1078694/+subscriptions