GtkWidget *dialog; dialog = create_dialog (); gtk_widget_show (dialog); gtk_device_grab_add (dialog, private_data->grabbed_device, FALSE); private_data->dialog = dialog;