From: buliabyak Date: Tue, 1 Apr 2008 17:31:17 +0000 (+0000) Subject: suppress warnings when closing a desktop but not program X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4e5db1d8f2b6580c0dd13b940215362a92a99190;p=inkscape.git suppress warnings when closing a desktop but not program --- diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 357d6ade7..d528f05e2 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1146,6 +1146,10 @@ sp_canvas_unrealize (GtkWidget *widget) { SPCanvas *canvas = SP_CANVAS (widget); + canvas->current_item = NULL; + canvas->grabbed_item = NULL; + canvas->focused_item = NULL; + shutdown_transients (canvas); gdk_gc_destroy (canvas->pixmap_gc); @@ -1539,6 +1543,9 @@ sp_canvas_motion (GtkWidget *widget, GdkEventMotion *event) if (event->window != SP_CANVAS_WINDOW (canvas)) return FALSE; + if (canvas->pixmap_gc == NULL) // canvas being deleted + return FALSE; + if (canvas->grabbed_event_mask & GDK_POINTER_MOTION_HINT_MASK) { gint x, y; gdk_window_get_pointer (widget->window, &x, &y, NULL); @@ -2010,7 +2017,7 @@ paint (SPCanvas *canvas) static int do_update (SPCanvas *canvas) { - if (!canvas->root) // canvas may have already be destroyed by closing desktop durring interrupted display! + if (!canvas->root || !canvas->pixmap_gc) // canvas may have already be destroyed by closing desktop durring interrupted display! return TRUE; /* Cause the update if necessary */