0
votes

In my application the main window spawns several dialogs, often multiple dialogs are opened at the same time. On Ubuntu if I minimize the main window each of the child dialogs are also minimized. On Windows XP/Vista/7 the dialogs don't minimize with the main window.

On Windows, is there a way to get all top level windows to minimize when the main application gets minimized.

EDIT: Solved by setting a signal for a "window-state-event" and manually using gtk_window_iconify.

Setting the signal:

g_signal_connect(G_OBJECT(Main_Application),  "window-state-event", G_CALLBACK(minimize_windows), NULL);

Here is the minimize_windows function.

gboolean minimize_windows( GtkWidget *widget, GdkEventWindowState *event, gpointer user_data)
{
  GList *glist;
  /*Returns a GList of each toplevel window*/
  glist = gtk_window_list_toplevels();  

  /*Iconify check*/
  if(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)
      g_list_foreach(glist, (GFunc)gtk_window_iconify,NULL);
  /* If not make sure all the windows are deiconified */
  else
      g_list_foreach(glist, (GFunc)gtk_window_deiconify, NULL);

  g_list_free(glist);

  return TRUE;
}
1

1 Answers

0
votes

Try making the parent form the owner of the child forms:

Form2 f2 = new Form2();
f2.Show(this);