Ignore:
Timestamp:
Aug 13, 2011, 10:05:51 PM (10 years ago)
Author:
sam
Message:

gtk: refactor the GtkGlArea handling so that it can be destroyed even if
we are not actually closing the whole application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/gtk/editor.cpp

    r785 r824  
    2323#include "glmapview.h"
    2424
    25 static gboolean delayed_quit(GtkWidget *w, GdkEvent *e, void *data)
     25/* Closing the window does not quit directly, we must first make sure the
     26 * GL widget is destroyed cleanly. */
     27static gboolean close_window(GtkWidget *w, GdkEvent *e, void *data)
    2628{
    2729    (void)w;
    2830    (void)e;
    29     (void)data;
     31    GlMapView *glmapview = (GlMapView *)data;
     32    glmapview->Shutdown();
    3033    gtk_main_quit();
    31     return TRUE;
     34    return FALSE;
    3235}
    3336
     
    6366    gtk_widget_show_all(window);
    6467    gtk_signal_connect(GTK_OBJECT(window), "delete_event",
    65                        GTK_SIGNAL_FUNC(delayed_quit), NULL);
     68                       GTK_SIGNAL_FUNC(close_window), glmapview);
    6669    g_object_unref(G_OBJECT(builder));
    6770
Note: See TracChangeset for help on using the changeset viewer.