Use gtk_window_has_group() to know if the window has an explicit window group.

gtk_window_get_group() never returns NULL; if the window isn't in a group,
a default window group is returned instead. Use gtk_window_has_group() instead.
This fixes some previous commits to use accessors to access GtkWindow.

Reported by Philip Withnall in bug
https://bugzilla.gnome.org/show_bug.cgi?id=627828
This commit is contained in:
Javier Jardón
2010-08-24 16:10:38 +02:00
parent 891694d9ff
commit c05f344c0a
7 changed files with 30 additions and 51 deletions

View File

@ -467,8 +467,6 @@ error_dialogs (GtkPrintUnixDialog *print_dialog,
if (file != NULL &&
g_file_query_exists (file, NULL))
{
GtkWindowGroup *group;
toplevel = get_toplevel (GTK_WIDGET (print_dialog));
basename = g_file_get_basename (file);
@ -500,9 +498,8 @@ error_dialogs (GtkPrintUnixDialog *print_dialog,
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_ACCEPT);
group = gtk_window_get_group (toplevel);
if (group)
gtk_window_group_add_window (group,
if (gtk_window_has_group (toplevel))
gtk_window_group_add_window (gtk_window_get_group (toplevel),
GTK_WINDOW (dialog));
response = gtk_dialog_run (GTK_DIALOG (dialog));