[gtk+] x11: Keep the drag window alive longer



commit ea0084cd995283dee00a327c92d9896994e738e1
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 8 11:29:58 2016 -0500

    x11: Keep the drag window alive longer
    
    We destroy the widget that is wrapped around the drag window
    when the object data on the drag context gets cleared. Destroying
    the window before that happens leads to unpleasantries. E.g. we may
    try to access the frame clock, which doesn't exist anymore, and
    things go downhill from there. So, keep the window alive for
    a little longer.

 gdk/x11/gdkdnd-x11.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 6bc87c4..dd07252 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -223,6 +223,7 @@ gdk_x11_drag_context_finalize (GObject *object)
 {
   GdkDragContext *context = GDK_DRAG_CONTEXT (object);
   GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (object);
+  GdkWindow *drag_window;
 
   if (context->source_window)
     {
@@ -235,7 +236,12 @@ gdk_x11_drag_context_finalize (GObject *object)
 
   contexts = g_list_remove (contexts, context);
 
+  drag_window = context->drag_window;
+
   G_OBJECT_CLASS (gdk_x11_drag_context_parent_class)->finalize (object);
+
+  if (drag_window)
+    gdk_window_destroy (drag_window);
 }
 
 /* Drag Contexts */


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