blocking window manager from closing window



I have the following destroy signal connected to the top level window of my app:

g_signal_connect(G_OBJECT(top_level_window), "destroy",
                           (GCallback) destroy_window, NULL);

The callback then looks like this:

void
destroy                                (gpointer         user_data)
{
   // Gracefully exit the program
   GET_WINDOW_SIZE(top_level_window, &WIDTH,
                                       &HEIGHT);
   GET_PANE_POSITIONS(top_level_window, &V_PANE_POS,
                                       &H_PANE_POS);
..........
   gtk_main_quit();
}

The problem is that if the window is closed by clicking the window manager's X button then the window closes 
before the destroy signal is emmited and the calls to GET_WINDOW_SIZE() and GET_PANE_POSITIONS() can't get 
the parameters for the window. Is there a way to slow down or stop the WM momentarily?

Thanks!



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]